summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Chernov <[email protected]>2016-06-05 14:04:22 +0300
committerPali Roh├ír <[email protected]>2017-12-22 09:10:21 +0100
commit757b6c99b60507da6a8093c0c21f18c1024bc6c2 (patch)
treec0b7979230842abfb719819283595531bc6e15b1
parent145b72acc5da63134e82d7666d4060bb8bc58a85 (diff)
Get-it-compiled version of KF5-porting of Jabber protocol
There's still one change to libiris internal tree needed, but we'll try to solve it upstream first.
-rw-r--r--protocols/jabber/jabberaccount.cpp42
-rw-r--r--protocols/jabber/jabberbasecontact.cpp4
-rw-r--r--protocols/jabber/jabberbasecontact.h2
-rw-r--r--protocols/jabber/jabberbookmarks.cpp4
-rw-r--r--protocols/jabber/jabberbookmarks.h4
-rw-r--r--protocols/jabber/jabberchatsession.cpp2
-rw-r--r--protocols/jabber/jabbercontact.cpp49
-rw-r--r--protocols/jabber/jabbercontact.h6
-rw-r--r--protocols/jabber/jabberfiletransfer.cpp2
-rw-r--r--protocols/jabber/jabbergroupchatmanager.cpp6
-rw-r--r--protocols/jabber/jabbergroupcontact.cpp16
-rw-r--r--protocols/jabber/jabbergroupcontact.h6
-rw-r--r--protocols/jabber/jabbergroupmembercontact.cpp8
-rw-r--r--protocols/jabber/jabbergroupmembercontact.h6
-rw-r--r--protocols/jabber/jabberprotocol.cpp48
-rw-r--r--protocols/jabber/jabberprotocol.h2
-rw-r--r--protocols/jabber/jabbertransport.cpp18
-rw-r--r--protocols/jabber/libiris/CMakeLists.txt14
-rw-r--r--protocols/jabber/ui/dlgjabberbookmarkeditor.cpp2
-rw-r--r--protocols/jabber/ui/dlgjabberchangepassword.cpp10
-rw-r--r--protocols/jabber/ui/dlgjabberchatjoin.cpp2
-rw-r--r--protocols/jabber/ui/dlgjabberchatroomslist.cpp2
-rw-r--r--protocols/jabber/ui/dlgjabberservices.cpp16
-rw-r--r--protocols/jabber/ui/dlgjabberservices.h3
-rw-r--r--protocols/jabber/ui/dlgjabbervcard.cpp4
-rw-r--r--protocols/jabber/ui/dlgsearch.cpp39
-rw-r--r--protocols/jabber/ui/dlgsearch.h9
-rw-r--r--protocols/jabber/ui/dlgxmppconsole.cpp29
-rw-r--r--protocols/jabber/ui/dlgxmppconsole.h4
-rw-r--r--protocols/jabber/ui/jabberchooseserver.cpp2
-rw-r--r--protocols/jabber/ui/jabbereditaccountwidget.cpp2
-rw-r--r--protocols/jabber/ui/jabberregisteraccount.cpp4
-rw-r--r--protocols/jabber/ui/privacydlg.cpp16
33 files changed, 220 insertions, 163 deletions
diff --git a/protocols/jabber/jabberaccount.cpp b/protocols/jabber/jabberaccount.cpp
index 8446333..a3f9cd3 100644
--- a/protocols/jabber/jabberaccount.cpp
+++ b/protocols/jabber/jabberaccount.cpp
@@ -40,7 +40,6 @@
#include <QAbstractSocket>
#include <QPointer>
-#include <kcomponentdata.h>
#include <kconfig.h>
#include <kdebug.h>
#include <kmessagebox.h>
@@ -52,7 +51,6 @@
#include <kicon.h>
#include <kactionmenu.h>
#include <kglobal.h>
-#include <KComponentData>
#include "kopetepassword.h"
#include "kopetemetacontact.h"
@@ -202,7 +200,7 @@ void JabberAccount::setS5BServerPort ( int port )
{
if ( !m_jabberClient->setS5BServerPort ( port ) && !m_notifiedUserCannotBindTransferPort)
{
- KMessageBox::queuedMessageBox ( Kopete::UI::Global::mainWidget (), KMessageBox::Sorry,
+ KMessageBox::sorry ( Kopete::UI::Global::mainWidget (),
i18n ( "Could not bind the Jabber file transfer manager to a local port. Please check if the file transfer port is already in use, or choose another port in the account settings." ),
i18n ( "Failed to start Jabber File Transfer Manager" ) );
m_notifiedUserCannotBindTransferPort = true;
@@ -216,9 +214,9 @@ void JabberAccount::fillActionMenu( KActionMenu *actionMenu )
actionMenu->addSeparator();
- KAction *action;
+ QAction *action;
- action = new KAction( this );
+ action = new QAction( this );
action->setIcon( KIcon("jabber_group") );
action->setText( i18n("Join Groupchat...") );
QObject::connect( action, SIGNAL(triggered(bool)), this, SLOT(slotJoinNewChat()) );
@@ -232,20 +230,20 @@ void JabberAccount::fillActionMenu( KActionMenu *actionMenu )
actionMenu->addSeparator();
- action = new KAction( this );
+ action = new QAction( this );
action->setIcon( KIcon("jabber_serv_on") );
action->setText( i18n ("Services...") );
QObject::connect( action, SIGNAL(triggered(bool)), this, SLOT(slotGetServices()) );
action->setEnabled( isConnected() );
actionMenu->addAction( action );
- action = new KAction( this );
+ action = new QAction( this );
action->setIcon( ( KIcon("mail-message-new") ) );
action->setText( i18n ("XML Console") );
QObject::connect( action, SIGNAL(triggered(bool)), this, SLOT(slotXMPPConsole()) );
actionMenu->addAction( action );
- action = new KAction( this );
+ action = new QAction( this );
action->setIcon( ( KIcon("document-properties") ) );
action->setText( i18n ("Edit User Info...") );
QObject::connect( action, SIGNAL(triggered(bool)), this, SLOT(slotEditVCard()) );
@@ -255,7 +253,7 @@ void JabberAccount::fillActionMenu( KActionMenu *actionMenu )
KActionMenu *mMoodMenu = new KActionMenu(i18n("Set Mood"), actionMenu);
for(int i = 0; i <= Mood::Worried; i++)
{
- action = new KAction(mMoodMenu);
+ action = new QAction(mMoodMenu);
action->setText(MoodManager::self()->getMoodName((Mood::Type)i));
action->setData(QVariant(i));
QObject::connect( action, SIGNAL(triggered(bool)), this, SLOT(slotSetMood()) );
@@ -317,8 +315,7 @@ bool JabberAccount::createContact (const QString & contactId, Kopete::MetaConta
void JabberAccount::errorConnectFirst ()
{
- KMessageBox::queuedMessageBox ( Kopete::UI::Global::mainWidget (),
- KMessageBox::Error,
+ KMessageBox::error ( Kopete::UI::Global::mainWidget (),
i18n ("Please connect first."), i18n ("Jabber Error") );
}
@@ -394,13 +391,13 @@ void JabberAccount::connectWithPassword ( const QString &password )
uname (&utsBuf);
m_jabberClient->setClientName ("Kopete");
- m_jabberClient->setClientVersion (KGlobal::mainComponent().aboutData()->version ());
+ m_jabberClient->setClientVersion (KAboutData::applicationData().version ());
m_jabberClient->setOSName (QString ("%1 %2").arg (utsBuf.sysname, 1).arg (utsBuf.release, 2));
}
// Set caps node information
m_jabberClient->setCapsNode(KOPETE_CAPS_NODE);
- m_jabberClient->setCapsVersion(KGlobal::mainComponent().aboutData()->version());
+ m_jabberClient->setCapsVersion(KAboutData::applicationData().version());
// Set Disco Identity information
DiscoItem::Identity identity;
@@ -452,7 +449,7 @@ void JabberAccount::connectWithPassword ( const QString &password )
{
case JabberClient::NoTLS:
// no SSL support, at the connecting stage this means the problem is client-side
- KMessageBox::queuedMessageBox(Kopete::UI::Global::mainWidget (), KMessageBox::Error,
+ KMessageBox::error(Kopete::UI::Global::mainWidget (),
i18n ("SSL support could not be initialized for account %1. This is most likely because TLS support for QCA is not available.",
myself()->contactId()),
i18n ("Jabber SSL Error"));
@@ -613,7 +610,7 @@ void JabberAccount::slotClientError ( JabberClient::ErrorCode errorCode )
{
case JabberClient::NoTLS:
default:
- KMessageBox::queuedMessageBox ( Kopete::UI::Global::mainWidget (), KMessageBox::Error,
+ KMessageBox::error ( Kopete::UI::Global::mainWidget (),
i18n ("An encrypted connection with the Jabber server could not be established."),
i18n ("Jabber Connection Error"));
disconnect ( Kopete::Account::Manual );
@@ -1194,7 +1191,7 @@ void JabberAccount::slotXMPPConsole ()
void JabberAccount::slotSetMood()
{
- KAction *action = (KAction *)sender();
+ QAction *action = (QAction *)sender();
Mood::Type type = (Mood::Type)action->data().toInt();
PubSubItem psi("current", Mood(type).toXml(*client()->client()->rootTask()->doc()));
@@ -1672,15 +1669,13 @@ void JabberAccount::slotGroupChatError (const XMPP::Jid &jid, int error, const Q
break;
case JabberClient::BannedFromThisMUC:
- KMessageBox::queuedMessageBox ( Kopete::UI::Global::mainWidget (),
- KMessageBox::Error,
+ KMessageBox::error ( Kopete::UI::Global::mainWidget (),
i18n ("You cannot join the room %1 because you have been banned", jid.node()),
i18n ("Jabber Group Chat") );
break;
case JabberClient::MaxUsersReachedForThisMuc:
- KMessageBox::queuedMessageBox ( Kopete::UI::Global::mainWidget (),
- KMessageBox::Error,
+ KMessageBox::error ( Kopete::UI::Global::mainWidget (),
i18n ("You cannot join the room %1 because the maximum number of users has been reached", jid.node()),
i18n ("Jabber Group Chat") );
break;
@@ -1689,8 +1684,7 @@ void JabberAccount::slotGroupChatError (const XMPP::Jid &jid, int error, const Q
{
QString detailedReason = reason.isEmpty () ? i18n ( "No reason given by the server" ) : reason;
- KMessageBox::queuedMessageBox ( Kopete::UI::Global::mainWidget (),
- KMessageBox::Error,
+ KMessageBox::error ( Kopete::UI::Global::mainWidget (),
i18n ("There was an error processing your request for groupchat %1. (Reason: %2, Code %3)", jid.full (), detailedReason, error ),
i18n ("Jabber Group Chat") );
}
@@ -1812,7 +1806,7 @@ void JabberAccount::slotUnregisterFinished( )
if ( task && ! task->success ())
{
- KMessageBox::queuedMessageBox ( 0L, KMessageBox::Error,
+ KMessageBox::error ( 0L,
i18n ("An error occurred while trying to remove the account:\n%1", task->statusString()),
i18n ("Jabber Account Unregistration"));
m_removing=false;
@@ -1915,7 +1909,7 @@ bool JabberAccount::oldEncrypted()
/*
JabberMoodAction::JabberMoodAction(const Mood::Type type, QObject *parent):
-KAction(parent)
+QAction(parent)
{
mType = type;
setText(MoodManager::self()->getMoodName(mType));
diff --git a/protocols/jabber/jabberbasecontact.cpp b/protocols/jabber/jabberbasecontact.cpp
index e4c630e..b9fa5ea 100644
--- a/protocols/jabber/jabberbasecontact.cpp
+++ b/protocols/jabber/jabberbasecontact.cpp
@@ -316,7 +316,7 @@ void JabberBaseContact::updateResourceList ()
// resource timestamp
resourceListStr += QString ( "<tr><td>%1: %2</td></tr>" ).
- arg ( i18n ( "Timestamp" ), KGlobal::locale()->formatDateTime ( (*it)->resource().status().timeStamp(), KLocale::ShortDate, true ) );
+ arg ( i18n ( "Timestamp" ), QLocale().toString ( (*it)->resource().status().timeStamp(), QLocale::ShortFormat ) );
// message, if any
if ( !(*it)->resource().status().status().trimmed().isEmpty () )
@@ -682,7 +682,7 @@ void JabberBaseContact::setPropertiesFromVCard ( const XMPP::VCard &vCard )
// Downalod photo from URI.
if( !KIO::NetAccess::download( vCard.photoURI(), tempPhotoPath, 0) )
{
- KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget (), KMessageBox::Sorry, i18n( "Failed to download Jabber contact photo." ) );
+ KMessageBox::sorry( Kopete::UI::Global::mainWidget (), i18n( "Failed to download Jabber contact photo." ) );
return;
}
diff --git a/protocols/jabber/jabberbasecontact.h b/protocols/jabber/jabberbasecontact.h
index 5164fdc..cd9a132 100644
--- a/protocols/jabber/jabberbasecontact.h
+++ b/protocols/jabber/jabberbasecontact.h
@@ -75,7 +75,7 @@ public:
* Create custom context menu items for the contact
* FIXME: implement manager version here?
*/
- virtual QList<KAction*> *customContextMenuActions () = 0;
+ virtual QList<QAction *> *customContextMenuActions () = 0;
using Kopete::Contact::customContextMenuActions;
/**
diff --git a/protocols/jabber/jabberbookmarks.cpp b/protocols/jabber/jabberbookmarks.cpp
index 65b45bf..ecfdcf0 100644
--- a/protocols/jabber/jabberbookmarks.cpp
+++ b/protocols/jabber/jabberbookmarks.cpp
@@ -21,7 +21,7 @@
#include <QPointer>
#include <kdebug.h>
-#include <kaction.h>
+#include <QAction>
#include <kselectaction.h>
#include <klocale.h>
#include <kicon.h>
@@ -223,7 +223,7 @@ void JabberBookmarks::insertGroupChat(const XMPP::Jid &jid)
task->go( true );
}
-KAction * JabberBookmarks::bookmarksAction(QObject *parent)
+QAction * JabberBookmarks::bookmarksAction(QObject *parent)
{
Q_UNUSED( parent )
diff --git a/protocols/jabber/jabberbookmarks.h b/protocols/jabber/jabberbookmarks.h
index 182e4aa..e71bff7 100644
--- a/protocols/jabber/jabberbookmarks.h
+++ b/protocols/jabber/jabberbookmarks.h
@@ -25,7 +25,7 @@
namespace XMPP { class Jid; }
class JabberAccount;
-class KAction;
+class QAction;
class JabberBookmark
{
@@ -82,7 +82,7 @@ class JabberBookmarks : public QObject
/**
* return an action that will be added in the jabber popup menu
*/
- KAction *bookmarksAction(QObject * parent);
+ QAction *bookmarksAction(QObject * parent);
private slots:
void accountConnected();
void slotReceivedBookmarks();
diff --git a/protocols/jabber/jabberchatsession.cpp b/protocols/jabber/jabberchatsession.cpp
index 0a294b2..15e9021 100644
--- a/protocols/jabber/jabberchatsession.cpp
+++ b/protocols/jabber/jabberchatsession.cpp
@@ -50,8 +50,6 @@ JabberChatSession::JabberChatSession ( JabberProtocol *protocol, const JabberBas
{
kDebug ( JABBER_DEBUG_GLOBAL ) << "New message manager for " << user->contactId ();
- setComponentData(protocol->componentData());
-
// make sure Kopete knows about this instance
Kopete::ChatSessionManager::self()->registerChatSession ( this );
diff --git a/protocols/jabber/jabbercontact.cpp b/protocols/jabber/jabbercontact.cpp
index a6a49f5..ba92034 100644
--- a/protocols/jabber/jabbercontact.cpp
+++ b/protocols/jabber/jabbercontact.cpp
@@ -36,7 +36,7 @@
#include <klocale.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
-#include <kaction.h>
+#include <QAction>
#include <kactionmenu.h>
#include <kicon.h>
#include <kstandarddirs.h>
@@ -134,30 +134,30 @@ JabberContact::~JabberContact()
kDebug(JABBER_DEBUG_GLOBAL) << contactId() << " is destroyed - " << this;
}
-QList<KAction*> *JabberContact::customContextMenuActions ()
+QList<QAction *> *JabberContact::customContextMenuActions ()
{
- QList<KAction*> *actions = new QList<KAction*>();
+ QList<QAction *> *actions = new QList<QAction*>();
KActionMenu *actionAuthorization = new KActionMenu ( KIcon("network-connect"), i18n ("Authorization"), this);
- KAction *resendAuthAction, *requestAuthAction, *removeAuthAction;
+ QAction *resendAuthAction, *requestAuthAction, *removeAuthAction;
- resendAuthAction = new KAction( this );
+ resendAuthAction = new QAction( this );
resendAuthAction->setIcon( (KIcon("mail-forward") ) );
resendAuthAction->setText( i18n ("(Re)send Authorization To") );
resendAuthAction->setEnabled( mRosterItem.subscription().type() == XMPP::Subscription::To || mRosterItem.subscription().type() == XMPP::Subscription::None );
connect(resendAuthAction, SIGNAL(triggered(bool)), SLOT(slotSendAuth()));
actionAuthorization->addAction(resendAuthAction);
- requestAuthAction = new KAction( this );
+ requestAuthAction = new QAction( this );
requestAuthAction->setIcon( (KIcon("mail-reply-sender") ) );
requestAuthAction->setText( i18n ("(Re)request Authorization From") );
requestAuthAction->setEnabled( mRosterItem.subscription().type() == XMPP::Subscription::From || mRosterItem.subscription().type() == XMPP::Subscription::None );
connect(requestAuthAction, SIGNAL(triggered(bool)), SLOT(slotRequestAuth()));
actionAuthorization->addAction(requestAuthAction);
- removeAuthAction = new KAction( this );
+ removeAuthAction = new QAction( this );
removeAuthAction->setIcon( (KIcon("edit-delete") ) );
removeAuthAction->setText( i18n ("Remove Authorization From") );
removeAuthAction->setEnabled( mRosterItem.subscription().type() == XMPP::Subscription::Both || mRosterItem.subscription().type() == XMPP::Subscription::From );
@@ -168,8 +168,8 @@ QList<KAction*> *JabberContact::customContextMenuActions ()
if ( account()->enabledLibjingle() ) {
- KAction *libjingleCallAction;
- libjingleCallAction = new KAction( this );
+ QAction *libjingleCallAction;
+ libjingleCallAction = new QAction( this );
libjingleCallAction->setIcon( (KIcon("voicecall") ) );
libjingleCallAction->setText( i18n ("Call contact") );
libjingleCallAction->setEnabled( account()->supportLibjingle(contactId()) );
@@ -183,7 +183,7 @@ QList<KAction*> *JabberContact::customContextMenuActions ()
KActionMenu *actionSetAvailability = new KActionMenu ( KIcon("user-identity", 0, QStringList() << QString() << "user-online"), i18n ("Set Availability"), this );
#define KACTION(status, text, name, slot) \
- { KAction *tmp = new KAction(this); \
+ { QAction *tmp = new QAction(this); \
tmp->setIcon( KIcon(QIcon((status).iconFor(this)))); \
tmp->setText( text ); \
connect(tmp, SIGNAL(triggered(bool)), (slot));\
@@ -235,7 +235,7 @@ QList<KAction*> *JabberContact::customContextMenuActions ()
{
if( i == activeItem )
{
- KAction *tmp = new KAction( this );
+ QAction *tmp = new QAction( this );
tmp->setIcon( KIcon("dialog-ok") );
tmp->setText( str);
tmp->setObjectName( QString::number(i) );
@@ -251,7 +251,7 @@ QList<KAction*> *JabberContact::customContextMenuActions ()
QIcon iconSet ( !i ?
protocol()->resourceToKOS ( account()->resourcePool()->bestResource ( mRosterItem.jid(), false ) ).iconFor ( account () ) : protocol()->resourceToKOS ( *availableResources.find(str) ).iconFor ( account () ));
- KAction *tmp = new KAction(this);
+ QAction *tmp = new QAction(this);
tmp->setIcon( KIcon(iconSet) );
tmp->setText( str );
tmp->setObjectName( QString::number(i) );
@@ -270,14 +270,14 @@ QList<KAction*> *JabberContact::customContextMenuActions ()
#if 0
- KAction *testAction = new KAction(i18n("Test action"), this);
+ QAction *testAction = new QAction(i18n("Test action"), this);
actionJingleAudioCall->setEnabled( true );
actionCollection->append( testAction );
- KAction *actionJingleAudioCall = new KAction(i18n("Jingle Audio call"), this);
+ QAction *actionJingleAudioCall = new QAction(i18n("Jingle Audio call"), this);
connect(actionJingleAudioCall, SIGNAL(triggered(bool)), SLOT(slotJingleAudioCall()));
- KAction *actionJingleVideoCall = new KAction(i18n("Jingle Video call"), this);
+ QAction *actionJingleVideoCall = new QAction(i18n("Jingle Video call"), this);
connect(actionJingleVideoCall, SIGNAL(triggered(bool)), SLOT(slotJingleVideoCall()));
// Check if the current contact support jingle calls, also honor lock by default.
@@ -817,7 +817,7 @@ void JabberContact::setPhoto( const QString &photoPath )
if(contactPhoto.width() > 96 || contactPhoto.height() > 96)
{
// Save image to a new location if the image isn't the correct format.
- QString newLocation( KStandardDirs::locateLocal( "appdata", "jabberphotos/"+ KUrl(photoPath).fileName().toLower() ) );
+ QString newLocation( KStandardDirs::locateLocal( "appdata", "jabberphotos/"+ QUrl(photoPath).fileName().toLower() ) );
// Scale and crop the picture.
contactPhoto = contactPhoto.scaled( 96, 96, Qt::KeepAspectRatio, Qt::SmoothTransformation );
@@ -836,7 +836,7 @@ void JabberContact::setPhoto( const QString &photoPath )
else if (contactPhoto.width() < 32 || contactPhoto.height() < 32)
{
// Save image to a new location if the image isn't the correct format.
- QString newLocation( KStandardDirs::locateLocal( "appdata", "jabberphotos/"+ KUrl(photoPath).fileName().toLower() ) );
+ QString newLocation( KStandardDirs::locateLocal( "appdata", "jabberphotos/"+ QUrl(photoPath).fileName().toLower() ) );
// Scale and crop the picture.
contactPhoto = contactPhoto.scaled( 32, 32, Qt::KeepAspectRatio, Qt::SmoothTransformation );
@@ -855,7 +855,7 @@ void JabberContact::setPhoto( const QString &photoPath )
else if (contactPhoto.width() != contactPhoto.height())
{
// Save image to a new location if the image isn't the correct format.
- QString newLocation( KStandardDirs::locateLocal( "appdata", "jabberphotos/"+ KUrl(photoPath).fileName().toLower() ) );
+ QString newLocation( KStandardDirs::locateLocal( "appdata", "jabberphotos/"+ QUrl(photoPath).fileName().toLower() ) );
if(contactPhoto.width() < contactPhoto.height())
contactPhoto = contactPhoto.copy((contactPhoto.width()-contactPhoto.height())/2, 0, contactPhoto.height(), contactPhoto.height());
@@ -1107,15 +1107,15 @@ void JabberContact::slotDelayedSync( )
}
-void JabberContact::sendFile ( const KUrl &sourceURL, const QString &/*fileName*/, uint /*fileSize*/ )
+void JabberContact::sendFile ( const QUrl &sourceURL, const QString &/*fileName*/, uint /*fileSize*/ )
{
QString filePath;
// if the file location is null, then get it from a file open dialog
if ( !sourceURL.isValid () )
- filePath = KFileDialog::getOpenFileName( KUrl(), "*", 0L, i18n ( "Kopete File Transfer" ) );
+ filePath = KFileDialog::getOpenFileName( QUrl(), "*", 0L, i18n ( "Kopete File Transfer" ) );
else
- filePath = sourceURL.path(KUrl::RemoveTrailingSlash);
+ filePath = sourceURL.adjusted(QUrl::StripTrailingSlash).path();
QFile file ( filePath );
@@ -1173,7 +1173,7 @@ void JabberContact::sendSubscription ( const QString& subType )
void JabberContact::slotSelectResource ()
{
- int currentItem = QString ( static_cast<const KAction *>( sender() )->objectName () ).toUInt ();
+ int currentItem = QString ( static_cast<const QAction *>( sender() )->objectName () ).toUInt ();
/*
* Warn the user if there is already an active chat window.
@@ -1182,8 +1182,7 @@ void JabberContact::slotSelectResource ()
*/
if ( manager ( Kopete::Contact::CannotCreate ) != 0 )
{
- KMessageBox::queuedMessageBox ( Kopete::UI::Global::mainWidget (),
- KMessageBox::Information,
+ KMessageBox::information ( Kopete::UI::Global::mainWidget (),
i18n ("You have preselected a resource for contact %1, "
"but you still have open chat windows for this contact. "
"The preselected resource will only apply to newly opened "
@@ -1200,7 +1199,7 @@ void JabberContact::slotSelectResource ()
else
{
// use iconText() instead of text(), because we need stripped value without '&'
- QString selectedResource = static_cast<const KAction *>(sender())->iconText();
+ QString selectedResource = static_cast<const QAction *>(sender())->iconText();
kDebug (JABBER_DEBUG_GLOBAL) << "Moving to resource " << selectedResource;
diff --git a/protocols/jabber/jabbercontact.h b/protocols/jabber/jabbercontact.h
index ffac9db..74d27a3 100644
--- a/protocols/jabber/jabbercontact.h
+++ b/protocols/jabber/jabbercontact.h
@@ -44,7 +44,7 @@ public:
* Create custom context menu items for the contact
* FIXME: implement manager version here?
*/
- QList<KAction*> *customContextMenuActions ();
+ QList<QAction *> *customContextMenuActions ();
using JabberBaseContact::customContextMenuActions;
/**
@@ -88,13 +88,13 @@ public slots:
/**
* This is the JabberContact level slot for sending files.
*
- * @param sourceURL The actual KUrl of the file you are sending
+ * @param sourceURL The actual QUrl of the file you are sending
* @param fileName (Optional) An alternate name for the file - what the
* receiver will see
* @param fileSize (Optional) Size of the file being sent. Used when sending
* a nondeterminate file size (such as over a socket)
*/
- virtual void sendFile( const KUrl &sourceURL = KUrl(),
+ virtual void sendFile( const QUrl &sourceURL = QUrl(),
const QString &fileName = QString(), uint fileSize = 0L );
/**
diff --git a/protocols/jabber/jabberfiletransfer.cpp b/protocols/jabber/jabberfiletransfer.cpp
index 006f894..5835ba5 100644
--- a/protocols/jabber/jabberfiletransfer.cpp
+++ b/protocols/jabber/jabberfiletransfer.cpp
@@ -150,7 +150,7 @@ JabberFileTransfer::JabberFileTransfer ( JabberAccount *account, JabberBaseConta
if(canOpen) {
- mXMPPTransfer->sendFile ( XMPP::Jid ( contact->fullAddress () ), KUrl(file).fileName (), mLocalFile.size (), "", preview);
+ mXMPPTransfer->sendFile ( XMPP::Jid ( contact->fullAddress () ), QUrl(file).fileName (), mLocalFile.size (), "", preview);
} else {
mKopeteTransfer->slotError ( KIO::ERR_CANNOT_OPEN_FOR_READING, file );
}
diff --git a/protocols/jabber/jabbergroupchatmanager.cpp b/protocols/jabber/jabbergroupchatmanager.cpp
index c5e967d..1b203c4 100644
--- a/protocols/jabber/jabbergroupchatmanager.cpp
+++ b/protocols/jabber/jabbergroupchatmanager.cpp
@@ -36,11 +36,9 @@ JabberGroupChatManager::JabberGroupChatManager ( JabberProtocol *protocol, const
{
kDebug ( JABBER_DEBUG_GLOBAL ) << "New message manager for " << user->contactId ();
- setComponentData(protocol->componentData());
-
mRoomJid = roomJid;
- mInviteAction = new KActionMenu (KIcon("system-users"), i18n ("&Invite"), this);
+ mInviteAction = new KActionMenu (QIcon::fromTheme(QStringLiteral("system-users")), i18n ("&Invite"), this);
mInviteAction->setDelayed(false);
connect( mInviteAction->menu(), SIGNAL(aboutToShow()), this, SLOT(showInviteMenu()) );
connect( mInviteAction->menu(), SIGNAL(aboutToHide()), this, SLOT(hideInviteMenu()) );
@@ -198,7 +196,7 @@ void JabberGroupChatManager::showInviteMenu() {
QHash <QString, Kopete::Contact *> contactList = account()->contacts();
for ( QHash <QString, Kopete::Contact *>::Iterator it = contactList.begin(); it != contactList.end(); ++it ) {
if ( ! members().contains(it.value()) && it.value()->isOnline() && it.value()->onlineStatus().status() != Kopete::OnlineStatus::Offline ) {
- KAction *a = new Kopete::UI::ContactAction(it.value(), actionCollection());
+ QAction *a = new Kopete::UI::ContactAction(it.value(), actionCollection());
connect( a, SIGNAL(triggered(QString,bool)), this, SLOT(inviteContact(QString)) );
mInviteAction->addAction(a);
}
diff --git a/protocols/jabber/jabbergroupcontact.cpp b/protocols/jabber/jabbergroupcontact.cpp
index 386e30d..8c83abd 100644
--- a/protocols/jabber/jabbergroupcontact.cpp
+++ b/protocols/jabber/jabbergroupcontact.cpp
@@ -22,7 +22,7 @@
#include <klocale.h>
#include <kfiledialog.h>
#include <kinputdialog.h>
-#include <kaction.h>
+#include <QAction>
#include "jabberprotocol.h"
#include "jabberaccount.h"
@@ -123,13 +123,13 @@ JabberGroupContact::~JabberGroupContact ()
}
}
-QList<KAction*> *JabberGroupContact::customContextMenuActions ()
+QList<QAction *> *JabberGroupContact::customContextMenuActions ()
{
- QList<KAction*> *actionCollection = new QList<KAction*>();
+ QList<QAction *> *actionCollection = new QList<QAction*>();
- KAction *actionSetNick = new KAction(this);
+ QAction *actionSetNick = new QAction(this);
actionSetNick->setText( i18n ("Change nickname") );
- actionSetNick->setIcon( KIcon("jabber_changenick") );
+ actionSetNick->setIcon( QIcon::fromTheme(QStringLiteral("jabber_changenick")) );
connect(actionSetNick, SIGNAL(triggered(bool)), this, SLOT(slotChangeNick()));
actionCollection->append( actionSetNick );
@@ -348,15 +348,15 @@ void JabberGroupContact::removeSubContact ( const XMPP::RosterItem &rosterItem )
}
-void JabberGroupContact::sendFile ( const KUrl &sourceURL, const QString &/*fileName*/, uint /*fileSize*/ )
+void JabberGroupContact::sendFile ( const QUrl &sourceURL, const QString &/*fileName*/, uint /*fileSize*/ )
{
QString filePath;
// if the file location is null, then get it from a file open dialog
if ( !sourceURL.isValid () )
- filePath = KFileDialog::getOpenFileName( KUrl(), "*", 0L, i18n ( "Kopete File Transfer" ) );
+ filePath = KFileDialog::getOpenFileName( QUrl(), "*", 0L, i18n ( "Kopete File Transfer" ) );
else
- filePath = sourceURL.path(KUrl::RemoveTrailingSlash);
+ filePath = sourceURL.adjusted(QUrl::StripTrailingSlash).path();
QFile file ( filePath );
diff --git a/protocols/jabber/jabbergroupcontact.h b/protocols/jabber/jabbergroupcontact.h
index ef22601..dfeea2f 100644
--- a/protocols/jabber/jabbergroupcontact.h
+++ b/protocols/jabber/jabbergroupcontact.h
@@ -41,7 +41,7 @@ public:
* Create custom context menu items for the contact
* FIXME: implement manager version here?
*/
- QList<KAction*> *customContextMenuActions ();
+ QList<QAction *> *customContextMenuActions ();
using JabberBaseContact::customContextMenuActions;
/**
@@ -66,13 +66,13 @@ public slots:
/**
* This is the JabberContact level slot for sending files.
*
- * @param sourceURL The actual KUrl of the file you are sending
+ * @param sourceURL The actual QUrl of the file you are sending
* @param fileName (Optional) An alternate name for the file - what the
* receiver will see
* @param fileSize (Optional) Size of the file being sent. Used when sending
* a nondeterminate file size (such as over a socket)
*/
- virtual void sendFile( const KUrl &sourceURL = KUrl(),
+ virtual void sendFile( const QUrl &sourceURL = QUrl(),
const QString &fileName = QString(), uint fileSize = 0L );
private slots:
diff --git a/protocols/jabber/jabbergroupmembercontact.cpp b/protocols/jabber/jabbergroupmembercontact.cpp
index 5446744..75480d2 100644
--- a/protocols/jabber/jabbergroupmembercontact.cpp
+++ b/protocols/jabber/jabbergroupmembercontact.cpp
@@ -64,7 +64,7 @@ JabberGroupMemberContact::~JabberGroupMemberContact ()
}
}
-QList<KAction*> *JabberGroupMemberContact::customContextMenuActions ()
+QList<QAction *> *JabberGroupMemberContact::customContextMenuActions ()
{
return 0;
@@ -291,15 +291,15 @@ QString JabberGroupMemberContact::lastReceivedMessageId () const
return mLastReceivedMessageId;
}
-void JabberGroupMemberContact::sendFile ( const KUrl &sourceURL, const QString &/*fileName*/, uint /*fileSize*/ )
+void JabberGroupMemberContact::sendFile ( const QUrl &sourceURL, const QString &/*fileName*/, uint /*fileSize*/ )
{
QString filePath;
// if the file location is null, then get it from a file open dialog
if ( !sourceURL.isValid () )
- filePath = KFileDialog::getOpenFileName( KUrl(), "*", 0L, i18n ( "Kopete File Transfer" ) );
+ filePath = KFileDialog::getOpenFileName( QUrl(), "*", 0L, i18n ( "Kopete File Transfer" ) );
else
- filePath = sourceURL.path(KUrl::RemoveTrailingSlash);
+ filePath = sourceURL.adjusted(QUrl::StripTrailingSlash).path();
QFile file ( filePath );
diff --git a/protocols/jabber/jabbergroupmembercontact.h b/protocols/jabber/jabbergroupmembercontact.h
index cfb45b2..6cd7400 100644
--- a/protocols/jabber/jabbergroupmembercontact.h
+++ b/protocols/jabber/jabbergroupmembercontact.h
@@ -39,7 +39,7 @@ public:
* Create custom context menu items for the contact
* FIXME: implement manager version here?
*/
- QList<KAction*> *customContextMenuActions ();
+ QList<QAction *> *customContextMenuActions ();
using JabberBaseContact::customContextMenuActions;
/**
@@ -62,13 +62,13 @@ public slots:
/**
* This is the JabberContact level slot for sending files.
*
- * @param sourceURL The actual KUrl of the file you are sending
+ * @param sourceURL The actual QUrl of the file you are sending
* @param fileName (Optional) An alternate name for the file - what the
* receiver will see
* @param fileSize (Optional) Size of the file being sent. Used when sending
* a nondeterminate file size (such as over a socket)
*/
- virtual void sendFile( const KUrl &sourceURL = KUrl(),
+ virtual void sendFile( const QUrl &sourceURL = QUrl(),
const QString &fileName = QString(), uint fileSize = 0L );
private slots:
diff --git a/protocols/jabber/jabberprotocol.cpp b/protocols/jabber/jabberprotocol.cpp
index dc979b2..55fe96b 100644
--- a/protocols/jabber/jabberprotocol.cpp
+++ b/protocols/jabber/jabberprotocol.cpp
@@ -63,7 +63,7 @@ K_PLUGIN_FACTORY( JabberProtocolFactory, registerPlugin<JabberProtocol>(); )
K_EXPORT_PLUGIN( JabberProtocolFactory( "kopete_jabber" ) )
JabberProtocol::JabberProtocol (QObject * parent, const QVariantList &)
-: Kopete::Protocol( JabberProtocolFactory::componentData(), parent),
+: Kopete::Protocol(parent),
JabberKOSChatty(Kopete::OnlineStatus::Online, 100, this, JabberFreeForChat, QStringList("jabber_chatty"), i18n ("Free for Chat"), i18n ("Free for Chat"), Kopete::OnlineStatusManager::FreeForChat, Kopete::OnlineStatusManager::HasStatusMessage ),
JabberKOSOnline(Kopete::OnlineStatus::Online, 90, this, JabberOnline, QStringList(), i18n ("Online"), i18n ("Online"), Kopete::OnlineStatusManager::Online, Kopete::OnlineStatusManager::HasStatusMessage ),
JabberKOSAway(Kopete::OnlineStatus::Away, 80, this, JabberAway, QStringList("contact_away_overlay"), i18n ("Away"), i18n ("Away"), Kopete::OnlineStatusManager::Away, Kopete::OnlineStatusManager::HasStatusMessage),
@@ -351,27 +351,31 @@ XMPP::Status JabberProtocol::kosToStatus( const Kopete::OnlineStatus & status ,
#include <accountselector.h>
#include <kopeteuiglobal.h>
-#include <kvbox.h>
+#include <QVBoxLayout>
#include "jabbercontactpool.h"
#include <kopeteview.h>
#include <kmessagebox.h>
#include <kinputdialog.h>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <QVBoxLayout>
-void JabberProtocol::handleURL(const QString&, const KUrl & kurl) const
+void JabberProtocol::handleURL(const QString&, const QUrl &url) const
{
- QUrl url=kurl; //QUrl has better query handling.
if(url.scheme() != "xmpp" && !url.scheme().isEmpty() )
return;
- url.setQueryDelimiters( '=' , ';' );
+ QUrlQuery query(url);
+ query.setQueryDelimiters( '=' , ';' );
QString accountid=url.authority();
QString jid_str=url.path();
if(jid_str.startsWith('/'))
jid_str=jid_str.mid(1);
XMPP::Jid jid = jid_str;
- QString action=url.queryItems().isEmpty() ? QString() : url.queryItems().first().first;
+ QString action=query.queryItems().isEmpty() ? QString() : query.queryItems().first().first;
- kDebug() << url.queryItemValue("body");
+ kDebug() << query.queryItemValue("body");
if(jid.isEmpty())
{
@@ -390,17 +394,27 @@ void JabberProtocol::handleURL(const QString&, const KUrl & kurl) const
account = static_cast<JabberAccount*>(accounts.first());
else
{
- QPointer <KDialog> chooser = new KDialog(Kopete::UI::Global::mainWidget());
- chooser->setCaption( i18n("Choose Account") );
- chooser->setButtons( KDialog::Ok | KDialog::Cancel );
- chooser->setDefaultButton(KDialog::Ok);
- KVBox * vb = new KVBox(chooser);
- chooser->setMainWidget(vb);
- QLabel * label = new QLabel(vb);
- label->setText(i18n("Choose an account to handle the URL %1" , kurl.prettyUrl()));
+ QPointer <QDialog> chooser = new QDialog(Kopete::UI::Global::mainWidget());
+ chooser->setWindowTitle( i18n("Choose Account") );
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
+ QWidget *mainWidget = new QWidget(chooser);
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ chooser->setLayout(mainLayout);
+ mainLayout->addWidget(mainWidget);
+ QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
+ okButton->setDefault(true);
+ okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
+ chooser->connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ chooser->connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
+ QLabel * label = new QLabel(mainWidget);
+ mainLayout->addWidget(label);
+ label->setText(i18n("Choose an account to handle the URL %1" , url.toDisplayString()));
// label->setSizePolicy(QSizePolicy::Minimum , QSizePolicy::MinimumExpanding);
label->setWordWrap(true);
- QPointer <AccountSelector> accSelector = new AccountSelector(const_cast<JabberProtocol*>(this), vb);
+ QPointer <AccountSelector> accSelector = new AccountSelector(const_cast<JabberProtocol*>(this), mainWidget);
+ mainLayout->addWidget(accSelector);
+ mainLayout->addWidget(buttonBox);
// accSelector->setSizePolicy(QSizePolicy::MinimumExpanding , QSizePolicy::MinimumExpanding);
int ret = chooser->exec();
if (ret == QDialog::Rejected || !accSelector)
@@ -537,7 +551,7 @@ void JabberProtocol::handleURL(const QString&, const KUrl & kurl) const
}//TODO: recvfile
else
{
- kWarning(JABBER_DEBUG_GLOBAL) << "unable to handle URL "<< kurl.prettyUrl();
+ kWarning(JABBER_DEBUG_GLOBAL) << "unable to handle URL "<< url.toDisplayString();
}
}
diff --git a/protocols/jabber/jabberprotocol.h b/protocols/jabber/jabberprotocol.h
index 41c971d..c6f3939 100644
--- a/protocols/jabber/jabberprotocol.h
+++ b/protocols/jabber/jabberprotocol.h
@@ -148,7 +148,7 @@ public:
/**
* inherited from Kopete::MimeTypeHandler
*/
- virtual void handleURL(const QString&, const KUrl & kurl) const;
+ virtual void handleURL(const QString&, const QUrl &url) const;
using Kopete::MimeTypeHandler::handleURL;
private:
diff --git a/protocols/jabber/jabbertransport.cpp b/protocols/jabber/jabbertransport.cpp
index aef7948..f0593d2 100644
--- a/protocols/jabber/jabbertransport.cpp
+++ b/protocols/jabber/jabbertransport.cpp
@@ -32,8 +32,8 @@
#include <qpixmap.h>
#include <qtimer.h>
-#include <kmenu.h>
-#include <kaction.h>
+#include <QMenu>
+#include <QAction>
#include <kactionmenu.h>
#include <kdebug.h>
#include <klocale.h>
@@ -132,16 +132,16 @@ void JabberTransport::fillActionMenu( KActionMenu *actionMenu )
else
nick = myself()->displayName();
- actionMenu->menu()->addTitle( myself()->onlineStatus().iconFor( myself() ),
+ actionMenu->menu()->addAction( myself()->onlineStatus().iconFor( myself() ),
nick.isNull() ? accountLabel() : i18n( "%2 <%1>", accountLabel(), nick )
);
- QList<KAction*> *customActions = myself()->customContextMenuActions( );
+ QList<QAction *> *customActions = myself()->customContextMenuActions( );
if( customActions && !customActions->isEmpty() )
{
actionMenu->addSeparator();
- foreach( KAction *a, *customActions )
+ foreach( QAction *a, *customActions )
actionMenu->menu()->addAction(a);
}
delete customActions;
@@ -150,18 +150,18 @@ void JabberTransport::fillActionMenu( KActionMenu *actionMenu )
m_actionMenu->popupMenu()->insertSeparator();
- m_actionMenu->insert(new KAction (i18n ("Join Groupchat..."), "jabber_group", 0,
+ m_actionMenu->insert(new QAction (i18n ("Join Groupchat..."), "jabber_group", 0,
this, SLOT (slotJoinNewChat()), this, "actionJoinChat"));
m_actionMenu->popupMenu()->insertSeparator();
- m_actionMenu->insert ( new KAction ( i18n ("Services..."), "jabber_serv_on", 0,
+ m_actionMenu->insert ( new QAction ( i18n ("Services..."), "jabber_serv_on", 0,
this, SLOT (slotGetServices()), this, "actionJabberServices") );
- m_actionMenu->insert ( new KAction ( i18n ("Send Raw Packet to Server..."), "mail_new", 0,
+ m_actionMenu->insert ( new QAction ( i18n ("Send Raw Packet to Server..."), "mail_new", 0,
this, SLOT (slotSendRaw()), this, "actionJabberSendRaw") );
- m_actionMenu->insert ( new KAction ( i18n ("Edit User Info..."), "identity", 0,
+ m_actionMenu->insert ( new QAction ( i18n ("Edit User Info..."), "identity", 0,
this, SLOT (slotEditVCard()), this, "actionEditVCard") );
return m_actionMenu;*/
diff --git a/protocols/jabber/libiris/CMakeLists.txt b/protocols/jabber/libiris/CMakeLists.txt
index 5c11d28..b23978a 100644
--- a/protocols/jabber/libiris/CMakeLists.txt
+++ b/protocols/jabber/libiris/CMakeLists.txt
@@ -30,6 +30,17 @@ ${ZLIB_INCLUDE_DIR}
${DNSSD_INCLUDE_DIR}
)
+qt_wrap_cpp(iris_kopete iris_MOC_SRCS
+src/xmpp/xmpp-im/xmpp_client.h
+src/xmpp/xmpp-core/xmpp.h
+src/xmpp/xmpp-core/xmpp_clientstream.h
+src/xmpp/xmpp-core/xmpp_stream.h
+src/xmpp/xmpp-core/td.h
+src/jdns/src/qjdns/qjdnsshared_p.h
+src/jdns/include/jdns/qjdns.h
+src/jdns/include/jdns/qjdnsshared.h
+)
+
set(iris_SRCS
src/xmpp/base/randomnumbergenerator.cpp
src/xmpp/base/timezone.cpp
@@ -120,6 +131,7 @@ endif(WIN32)
set(libiris_SRCS
${cutestuff_SRCS}
${iris_SRCS}
+ ${iris_MOC_SRCS}
)
add_definitions(-DIRISNET_STATIC)
@@ -131,7 +143,7 @@ endif(CMAKE_COMPILER_IS_GNUCXX)
add_library(iris_kopete STATIC ${libiris_SRCS})
-set(iris_kopete_libs Qt5::Core Qt5::Network Qt5::Xml
+set(iris_kopete_libs Qt5::Core Qt5::Network Qt5::Xml Qt5::Gui Qt5::Widgets
${IDN_LIBRARIES} qca-qt5 ${ZLIB_LIBRARIES} )
if(WIN32)
diff --git a/protocols/jabber/ui/dlgjabberbookmarkeditor.cpp b/protocols/jabber/ui/dlgjabberbookmarkeditor.cpp
index b5506c4..aba82eb 100644
--- a/protocols/jabber/ui/dlgjabberbookmarkeditor.cpp
+++ b/protocols/jabber/ui/dlgjabberbookmarkeditor.cpp
@@ -62,7 +62,7 @@ class JabberBookmarkModel : public QAbstractListModel
case Qt::DisplayRole:
return QString( "%1 (%2)" ).arg( bookmark.fullJId() ).arg( bookmark.name() );
case Qt::DecorationRole:
- return bookmark.autoJoin() ? KIcon( "irc-join-channel" ) : QVariant();
+ return bookmark.autoJoin() ? QIcon::fromTheme(QStringLiteral("irc-join-channel")) : QVariant();
case NameRole:
return bookmark.name();
case AutoJoinRole:
diff --git a/protocols/jabber/ui/dlgjabberchangepassword.cpp b/protocols/jabber/ui/dlgjabberchangepassword.cpp
index 58a9d7b..9536ffd 100644
--- a/protocols/jabber/ui/dlgjabberchangepassword.cpp
+++ b/protocols/jabber/ui/dlgjabberchangepassword.cpp
@@ -60,7 +60,7 @@ void DlgJabberChangePassword::slotOk ()
{
if ( m_account->password().cachedValue () != m_mainWidget->peCurrentPassword->text() )
{
- KMessageBox::queuedMessageBox ( this, KMessageBox::Sorry,
+ KMessageBox::sorry ( this,
i18n ( "You entered your current password incorrectly." ),
i18n ( "Password Incorrect" ) );
return;
@@ -68,7 +68,7 @@ void DlgJabberChangePassword::slotOk ()
if ( m_mainWidget->peNewPassword1->text() != m_mainWidget->peNewPassword2->text() )
{
- KMessageBox::queuedMessageBox ( this, KMessageBox::Sorry,
+ KMessageBox::sorry ( this,
i18n ( "Your new passwords do not match. Please enter them again." ),
i18n ( "Password Incorrect" ) );
return;
@@ -76,7 +76,7 @@ void DlgJabberChangePassword::slotOk ()
if ( m_mainWidget->peNewPassword1->text().isEmpty() )
{
- KMessageBox::queuedMessageBox ( this, KMessageBox::Sorry,
+ KMessageBox::sorry ( this,
i18n ( "For security reasons, you are not allowed to set an empty password." ),
i18n ( "Password Incorrect" ) );
return;
@@ -124,7 +124,7 @@ void DlgJabberChangePassword::slotChangePasswordDone ()
if ( task->success () )
{
- KMessageBox::queuedMessageBox ( dynamic_cast<QWidget*>(parent()), KMessageBox::Information,
+ KMessageBox::information ( dynamic_cast<QWidget*>(parent()),
i18n ( "Your password has been changed successfully. Please note that the change may not be instantaneous. If you have problems logging in with your new password, please contact the administrator." ),
i18n ( "Jabber Password Change" ) );
@@ -132,7 +132,7 @@ void DlgJabberChangePassword::slotChangePasswordDone ()
}
else
{
- KMessageBox::queuedMessageBox ( dynamic_cast<QWidget*>(parent()), KMessageBox::Sorry,
+ KMessageBox::sorry ( dynamic_cast<QWidget*>(parent()),
i18n ( "Your password could not be changed. Either your server does not support this feature or the administrator does not allow you to change your password." ) );
}
diff --git a/protocols/jabber/ui/dlgjabberchatjoin.cpp b/protocols/jabber/ui/dlgjabberchatjoin.cpp
index a3fb4ef..416cbf4 100644
--- a/protocols/jabber/ui/dlgjabberchatjoin.cpp
+++ b/protocols/jabber/ui/dlgjabberchatjoin.cpp
@@ -140,7 +140,7 @@ void dlgJabberChatJoin::slotChatRooomsQueryFinished()
XMPP::JT_DiscoItems *task = (XMPP::JT_DiscoItems*)sender();
if (!task->success())
{
- KMessageBox::queuedMessageBox(this, KMessageBox::Error, i18n("Unable to retrieve the list of chat rooms."), i18n("Jabber Error"));
+ KMessageBox::error(this, i18n("Unable to retrieve the list of chat rooms."), i18n("Jabber Error"));
return;
}
diff --git a/protocols/jabber/ui/dlgjabberchatroomslist.cpp b/protocols/jabber/ui/dlgjabberchatroomslist.cpp
index 619ac75..847139f 100644
--- a/protocols/jabber/ui/dlgjabberchatroomslist.cpp
+++ b/protocols/jabber/ui/dlgjabberchatroomslist.cpp
@@ -90,7 +90,7 @@ void dlgJabberChatRoomsList::slotQueryFinished()
XMPP::JT_DiscoItems *task = (XMPP::JT_DiscoItems*)sender();
if (!task->success())
{
- KMessageBox::queuedMessageBox(this, KMessageBox::Error, i18n("Unable to retrieve the list of chat rooms."), i18n("Jabber Error"));
+ KMessageBox::error(this, i18n("Unable to retrieve the list of chat rooms."), i18n("Jabber Error"));
return;
}
diff --git a/protocols/jabber/ui/dlgjabberservices.cpp b/protocols/jabber/ui/dlgjabberservices.cpp
index 8b1011a..d0314c0 100644
--- a/protocols/jabber/ui/dlgjabberservices.cpp
+++ b/protocols/jabber/ui/dlgjabberservices.cpp
@@ -27,6 +27,9 @@
#include <KMessageBox>
#include <KLocale>
#include <KDebug>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QVBoxLayout>
#include "jabberaccount.h"
#include "jabberclient.h"
@@ -36,14 +39,19 @@
#include "dlgahclist.h"
dlgJabberServices::dlgJabberServices(JabberAccount *account, QWidget *parent):
-KDialog(parent)
+QDialog(parent)
{
setAttribute(Qt::WA_DeleteOnClose);
QWidget *widget = new QWidget(this);
ui.setupUi(widget);
- setMainWidget(widget);
- setButtons(Close);
- setCaption(i18n("Services"));
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ mainLayout->addWidget(widget);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ mainLayout->addWidget(buttonBox);
+ setWindowTitle(i18n("Services"));
mAccount = account;
if(mAccount->isConnected())
diff --git a/protocols/jabber/ui/dlgjabberservices.h b/protocols/jabber/ui/dlgjabberservices.h
index 0eb68e5..2dba317 100644
--- a/protocols/jabber/ui/dlgjabberservices.h
+++ b/protocols/jabber/ui/dlgjabberservices.h
@@ -20,6 +20,7 @@
#define DLGJABBERSERVICES_H
#include <qwidget.h>
+#include <QDialog>
#include "jabberaccount.h"
#include "xmpp_tasks.h"
@@ -32,7 +33,7 @@
class ServiceItem;
-class dlgJabberServices : public KDialog
+class dlgJabberServices : public QDialog
{
Q_OBJECT
public:
diff --git a/protocols/jabber/ui/dlgjabbervcard.cpp b/protocols/jabber/ui/dlgjabbervcard.cpp
index 3ec01b2..3c74f06 100644
--- a/protocols/jabber/ui/dlgjabbervcard.cpp
+++ b/protocols/jabber/ui/dlgjabbervcard.cpp
@@ -496,7 +496,7 @@ void dlgJabberVCard::slotSelectPhoto()
}
else
{
- KMessageBox::queuedMessageBox( this, KMessageBox::Sorry, i18n( "<qt>An error occurred when trying to change the photo.<br />"
+ KMessageBox::sorry( this, i18n( "<qt>An error occurred when trying to change the photo.<br />"
"Make sure that you have selected a valid image file</qt>" ) );
m_photoPath.clear();
}
@@ -511,7 +511,7 @@ void dlgJabberVCard::slotClearPhoto()
void dlgJabberVCard::slotOpenURL(const QString &url)
{
if ( !url.isEmpty () || (url == QString::fromLatin1("mailto:") ) )
- new KRun( KUrl( url ), this );
+ new KRun( QUrl( url ), this );
}
#include "dlgjabbervcard.moc"
diff --git a/protocols/jabber/ui/dlgsearch.cpp b/protocols/jabber/ui/dlgsearch.cpp
index 92eadaf..efd7316 100644
--- a/protocols/jabber/ui/dlgsearch.cpp
+++ b/protocols/jabber/ui/dlgsearch.cpp
@@ -31,25 +31,36 @@
#include "jabberxdatawidget.h"
#include "jt_xsearch.h"
#include <kdebug.h>
+#include <KConfigGroup>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <QVBoxLayout>
dlgSearch::dlgSearch(JabberAccount *account, const XMPP::Jid &jid, QWidget *parent):
-KDialog(parent)
+QDialog(parent)
{
setAttribute(Qt::WA_DeleteOnClose);
QWidget *widget = new QWidget(this);
ui.setupUi(widget);
- setMainWidget(widget);
- setButtons(Close | User1);
- setButtonText(User1, i18n("Search"));
- setCaption(i18n("Search"));
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ mainLayout->addWidget(widget);
+ mButtonBox = new QDialogButtonBox(QDialogButtonBox::Close);
+ mSearchButton = new QPushButton;
+ mButtonBox->addButton(mSearchButton, QDialogButtonBox::ActionRole);
+ connect(mButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(mButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ mainLayout->addWidget(mButtonBox);
+ mSearchButton->setText(i18n("Search"));
+ setWindowTitle(i18n("Search"));
mAccount = account;
mXDataWidget = 0L;
ui.tblResults->header()->setResizeMode(QHeaderView::ResizeToContents);
ui.lblWait->setText(i18n("Please wait while retrieving search form..."));
- enableButton(User1, false);
- connect(this, SIGNAL(user1Clicked()), this, SLOT(slotSendForm()));
+ mSearchButton->setEnabled(false);
+ connect(mSearchButton, SIGNAL(clicked()), this, SLOT(slotSendForm()));
// get form
JT_XSearch * task = new JT_XSearch(mAccount->client()->rootTask());
connect(task, SIGNAL(finished()), this, SLOT(slotGotForm()));
@@ -70,7 +81,7 @@ void dlgSearch::slotGotForm()
if(!task->success())
{
- KMessageBox::queuedMessageBox(this, KMessageBox::Information, i18n("Unable to retrieve search form."), i18n ("Jabber Error"));
+ KMessageBox::information(this, i18n("Unable to retrieve search form."), i18n ("Jabber Error"));
return;
}
@@ -102,7 +113,7 @@ void dlgSearch::slotGotForm()
}
// enable the send button
- enableButton(User1, true);
+ mSearchButton->setEnabled(true);
resize(sizeHint());
}
@@ -123,19 +134,19 @@ void dlgSearch::slotSendForm()
}
task->go(true);
ui.tblResults->clear();
- enableButton(User1, false);
- enableButton(Close, false);
+ mSearchButton->setEnabled(false);
+ mButtonBox->button(QDialogButtonBox::Close)->setEnabled(false);
}
void dlgSearch::slotSentForm()
{
JT_XSearch * task = (JT_XSearch *) sender ();
- enableButton(User1, true);
- enableButton(Close, true);
+ mSearchButton->setEnabled(true);
+ mButtonBox->button(QDialogButtonBox::Close)->setEnabled(true);
if (!task->success ())
{
- KMessageBox::queuedMessageBox (this, KMessageBox::Error, i18n ("The Jabber server rejected the search."), i18n ("Jabber Search"));
+ KMessageBox::error (this, i18n ("The Jabber server rejected the search."), i18n ("Jabber Search"));
return;
}
diff --git a/protocols/jabber/ui/dlgsearch.h b/protocols/jabber/ui/dlgsearch.h
index e1d7c6d..8453fb3 100644
--- a/protocols/jabber/ui/dlgsearch.h
+++ b/protocols/jabber/ui/dlgsearch.h
@@ -19,13 +19,18 @@
#ifndef DLGSEARCH_H
#define DLGSEARCH_H
+#include <QDialog>
+
#include "jabberaccount.h"
#include "jabberformtranslator.h"
#include "ui_dlgsearch.h"
+class QPushButton;
+class QDialogButtonBox;
+
class JabberXDataWidget;
-class dlgSearch : public KDialog
+class dlgSearch : public QDialog
{
Q_OBJECT
public:
@@ -41,6 +46,8 @@ private:
Ui::dlgSearch ui;
JabberAccount *mAccount;
JabberXDataWidget *mXDataWidget;
+ QPushButton* mSearchButton;
+ QDialogButtonBox* mButtonBox;
Form mForm;
JabberFormTranslator * translator;
};
diff --git a/protocols/jabber/ui/dlgxmppconsole.cpp b/protocols/jabber/ui/dlgxmppconsole.cpp
index 3c3df46..d80a173 100644
--- a/protocols/jabber/ui/dlgxmppconsole.cpp
+++ b/protocols/jabber/ui/dlgxmppconsole.cpp
@@ -15,23 +15,36 @@
#include "dlgxmppconsole.h"
+#include <QDialogButtonBox>
+#include <QPushButton>
+
#include "jabberclient.h"
dlgXMPPConsole::dlgXMPPConsole(JabberClient *client, QWidget *parent):
-KDialog(parent)
+QDialog(parent)
{
mClient = client;
setAttribute(Qt::WA_DeleteOnClose);
QWidget *widget = new QWidget(this);
ui.setupUi(widget);
- setMainWidget(widget);
- setCaption(i18n("XML Console"));
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ setLayout(mainLayout);
+ mainLayout->addWidget(widget);
+ setWindowTitle(i18n("XML Console"));
// Buttons
- setButtons(Close | User1 | User2);
- setButtonText(User1, i18n("Clear"));
- setButtonText(User2, i18n("Send"));
- connect(this, SIGNAL(user1Clicked()), this, SLOT(slotClear()));
- connect(this, SIGNAL(user2Clicked()), this, SLOT(slotSend()));
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
+ QPushButton *user1Button = new QPushButton;
+ buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
+ QPushButton *user2Button = new QPushButton;
+ buttonBox->addButton(user2Button, QDialogButtonBox::ActionRole);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ //PORTING SCRIPT: WARNING mainLayout->addWidget(buttonBox) must be last item in layout. Please move it.
+ mainLayout->addWidget(buttonBox);
+ user1Button->setText(i18n("Clear"));
+ user2Button->setText(i18n("Send"));
+ connect(user1Button, SIGNAL(clicked()), this, SLOT(slotClear()));
+ connect(user2Button, SIGNAL(clicked()), this, SLOT(slotSend()));
}
dlgXMPPConsole::~dlgXMPPConsole()
diff --git a/protocols/jabber/ui/dlgxmppconsole.h b/protocols/jabber/ui/dlgxmppconsole.h
index 73efc04..33a8636 100644
--- a/protocols/jabber/ui/dlgxmppconsole.h
+++ b/protocols/jabber/ui/dlgxmppconsole.h
@@ -16,11 +16,13 @@
#ifndef DLGXMPPCONSOLE_H
#define DLGXMPPCONSOLE_H
+#include <QDialog>
+
#include "ui_dlgxmppconsole.h"
class JabberClient;
-class dlgXMPPConsole : public KDialog
+class dlgXMPPConsole : public QDialog
{
Q_OBJECT
public:
diff --git a/protocols/jabber/ui/jabberchooseserver.cpp b/protocols/jabber/ui/jabberchooseserver.cpp
index 0c7174f..53814eb 100644
--- a/protocols/jabber/ui/jabberchooseserver.cpp
+++ b/protocols/jabber/ui/jabberchooseserver.cpp
@@ -52,7 +52,7 @@ JabberChooseServer::JabberChooseServer ( JabberRegisterAccount *parent )
mMainWidget->lblStatus->setText ( i18n ( "Retrieving server list...") );
// retrieve server list
- mTransferJob = KIO::get ( KUrl("https://xmpp.net/services.php") );
+ mTransferJob = KIO::get ( QUrl("https://xmpp.net/services.php") );
connect ( mTransferJob, SIGNAL (result(KJob*)), this, SLOT (slotTransferResult(KJob*)) );
connect ( mTransferJob, SIGNAL (data(KIO::Job*,QByteArray)), this, SLOT (slotTransferData(KIO::Job*,QByteArray)) );
diff --git a/protocols/jabber/ui/jabbereditaccountwidget.cpp b/protocols/jabber/ui/jabbereditaccountwidget.cpp
index 0585163..c35bcc5 100644
--- a/protocols/jabber/ui/jabbereditaccountwidget.cpp
+++ b/protocols/jabber/ui/jabbereditaccountwidget.cpp
@@ -277,7 +277,7 @@ Kopete::Account *JabberEditAccountWidget::apply ()
if(account()->isConnected())
{
- KMessageBox::queuedMessageBox(this, KMessageBox::Information,
+ KMessageBox::information(this,
i18n("The changes you just made will take effect next time you log in with Jabber."),
i18n("Jabber Changes During Online Jabber Session"));
}
diff --git a/protocols/jabber/ui/jabberregisteraccount.cpp b/protocols/jabber/ui/jabberregisteraccount.cpp
index e92d9b0..2e47a55 100644
--- a/protocols/jabber/ui/jabberregisteraccount.cpp
+++ b/protocols/jabber/ui/jabberregisteraccount.cpp
@@ -290,7 +290,7 @@ void JabberRegisterAccount::slotOk ()
{
case JabberClient::NoTLS:
// no SSL support, at the connecting stage this means the problem is client-side
- KMessageBox::queuedMessageBox(Kopete::UI::Global::mainWidget (), KMessageBox::Error,
+ KMessageBox::error(Kopete::UI::Global::mainWidget (),
i18n ("SSL support could not be initialized for account %1. This is most likely because the QCA TLS plugin is not installed on your system.",
mMainWidget->leJID->text () ),
i18n ("Jabber SSL Error"));
@@ -405,7 +405,7 @@ void JabberRegisterAccount::slotRegisterUserDone ()
else
{
mMainWidget->lblStatusMessage->setText ( i18n ( "Registration failed." ) );
- KMessageBox::queuedMessageBox (Kopete::UI::Global::mainWidget (), KMessageBox::Information,
+ KMessageBox::information (Kopete::UI::Global::mainWidget (),
i18n ("Unable to create an account on the server. The Jabber ID is probably already in use."),
i18n ("Jabber Account Registration"));
diff --git a/protocols/jabber/ui/privacydlg.cpp b/protocols/jabber/ui/privacydlg.cpp
index 5b29f54..f70d9b9 100644
--- a/protocols/jabber/ui/privacydlg.cpp
+++ b/protocols/jabber/ui/privacydlg.cpp
@@ -68,14 +68,14 @@ PrivacyDlg::PrivacyDlg(JabberAccount* acc, QWidget* parent) : KDialog(parent), a
connect(ui_.pb_down,SIGNAL(clicked()),SLOT(moveCurrentRuleDown()));
connect(ui_.pb_apply,SIGNAL(clicked()),SLOT(applyList()));
- ui_.pb_newList->setIcon(KIcon("list-add"));
- ui_.pb_deleteList->setIcon(KIcon("list-remove"));
- ui_.pb_add->setIcon(KIcon("list-add"));
- ui_.pb_remove->setIcon(KIcon("list-remove"));
- ui_.pb_up->setIcon(KIcon("arrow-up"));
- ui_.pb_down->setIcon(KIcon("arrow-down"));
- ui_.pb_edit->setIcon(KIcon("edit-rename"));
- ui_.pb_apply->setIcon(KIcon("dialog-ok-apply"));
+ ui_.pb_newList->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
+ ui_.pb_deleteList->setIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
+ ui_.pb_add->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
+ ui_.pb_remove->setIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
+ ui_.pb_up->setIcon(QIcon::fromTheme(QStringLiteral("arrow-up")));
+ ui_.pb_down->setIcon(QIcon::fromTheme(QStringLiteral("arrow-down")));
+ ui_.pb_edit->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename")));
+ ui_.pb_apply->setIcon(QIcon::fromTheme(QStringLiteral("dialog-ok-apply")));
setWidgetsEnabled(false);