Commit 8ec5d751 authored by Alexey Chernov's avatar Alexey Chernov Committed by Pali Rohár

'Get it compiled' version of Groupwise protocol port

parent 43b0d587
......@@ -56,7 +56,7 @@ add_library(kopete_groupwise MODULE ${kopete_groupwise_PART_SRCS})
link_directories( ${CMAKE_CURRENT_BINARY_DIR}/libgroupwise )
target_link_libraries(kopete_groupwise KF5::KDELibs4Support ${KDE4_KDE3SUPPORT_LIBS} qgroupwise kopete ${QCA2_LIBRARIES})
target_link_libraries(kopete_groupwise KF5::KDELibs4Support qgroupwise kopete ${QCA2_LIBRARIES})
install(TARGETS kopete_groupwise DESTINATION ${PLUGIN_INSTALL_DIR})
......
......@@ -26,7 +26,6 @@
#include <kaboutdata.h>
#include <kconfig.h>
#include <kcomponentdata.h>
#include <kdebug.h>
#include <kinputdialog.h>
#include <klocale.h>
......@@ -251,7 +250,7 @@ void GroupWiseAccount::connectWithPassword( const QString &password )
if (!sslPossible)
{
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.",
myself()->contactId()),
i18n ("GroupWise SSL Error"));
......@@ -350,7 +349,7 @@ void GroupWiseAccount::connectWithPassword( const QString &password )
struct utsname utsBuf;
uname (&utsBuf);
m_client->setClientName ("Kopete");
m_client->setClientVersion ( KGlobal::mainComponent().aboutData()->version () );
m_client->setClientVersion ( KAboutData::applicationData().version () );
m_client->setOSName (QString ("%1 %2").arg (utsBuf.sysname, 1).arg (utsBuf.release, 2));
kDebug () << "Connecting to GroupWise server " << server() << ':' << port();
......@@ -366,7 +365,7 @@ void GroupWiseAccount::connectWithPassword( const QString &password )
void GroupWiseAccount::slotMessageSendingFailed()
{
KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry,
KMessageBox::sorry( Kopete::UI::Global::mainWidget(),
i18nc("Message Sending Failed using the named local account", "Kopete was not able to send the last message sent on account '%1'.\nIf possible, please send the console output from Kopete to <wstephenson@novell.com> for analysis.", accountId() ) , i18nc("message sending failed using the named local account", "Unable to Send Message on Account '%1'", accountId() ) );
}
......@@ -657,7 +656,7 @@ void GroupWiseAccount::slotKopeteGroupRemoved( Kopete::Group * group )
void GroupWiseAccount::slotConnError()
{
kDebug () ;
KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Sorry,
KMessageBox::sorry( Kopete::UI::Global::mainWidget(),
i18nc( "Error shown when connecting failed", "Kopete was not able to connect to the GroupWise Messenger server for account '%1'.\nPlease check your server and port settings and try again.", accountId() ) , i18n ("Unable to Connect '%1'", accountId() ) );
disconnect();
......@@ -1271,7 +1270,7 @@ void GroupWiseAccount::receiveContactCreated()
delete c;
}
}
KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget (), KMessageBox::Error,
KMessageBox::error( Kopete::UI::Global::mainWidget (),
i18n ("The contact %1 could not be added to the contact list, with error message: %2",
cct->userId(), cct->statusString() ),
i18n ("Error Adding Contact") );
......
......@@ -29,7 +29,7 @@
#include "gwcontact.h"
#include <qmap.h>
#include <kaction.h>
#include <QAction>
#include <KActionCollection>
#include <kdebug.h>
#include <kicon.h>
......@@ -152,15 +152,15 @@ Kopete::ChatSession * GroupWiseContact::manager( Kopete::Contact::CanCreateFlags
return account()->chatSession( chatMembers, QString("")/*FIXME Check this is right*/, canCreate );
}
QList<KAction*> *GroupWiseContact::customContextMenuActions()
QList<QAction *> *GroupWiseContact::customContextMenuActions()
{
QList<KAction *> * actions = new QList<KAction *>;
QList<QAction *> * actions = new QList<QAction *>;
// Block/unblock contact
QString label = account()->isContactBlocked( m_dn ) ? i18n( "Unblock User" ) : i18n( "Block User" );
if( !m_actionBlock )
{
m_actionBlock = new KAction( KIcon( "msn_blocked" ), label, 0 );
m_actionBlock = new QAction( KIcon( "msn_blocked" ), label, 0 );
QObject::connect( m_actionBlock, SIGNAL(triggered(bool)), SLOT(slotBlock()) );
}
else
......
......@@ -38,7 +38,7 @@
#include "gwfield.h"
#include "gwmessagemanager.h"
class KAction;
class QAction;
class KActionCollection;
namespace Kopete { class Account; }
class GroupWiseAccount;
......@@ -99,7 +99,7 @@ public:
/**
* Return the actions for this contact
*/
virtual QList<KAction *> *customContextMenuActions();
virtual QList<QAction *> *customContextMenuActions();
using Kopete::Contact::customContextMenuActions;
/**
......@@ -180,8 +180,8 @@ protected:
int m_sequence;
QString m_dn;
QString m_displayName;
KAction* m_actionPrefs;
KAction *m_actionBlock;
QAction * m_actionPrefs;
QAction *m_actionBlock;
// Novell Messenger Properties, as received by the server.
// Unfortunately we don't know the domain of the set of keys, so they are not easily mappable to KopeteContactProperties
QMap< QString, QVariant > m_serverProperties;
......
......@@ -43,6 +43,10 @@
#include <kopeteprotocol.h>
#include <kopeteuiglobal.h>
#include <kopeteview.h>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include "client.h"
#include "gwaccount.h"
......@@ -59,9 +63,6 @@ GroupWiseChatSession::GroupWiseChatSession(const Kopete::Contact* user, Kopete::
kDebug () << "New message manager for " << user->contactId();
// Needed because this is (indirectly) a KXMLGuiClient, so it can find the gui description .rc file
setComponentData( protocol->componentData() );
// make sure Kopete knows about this instance
Kopete::ChatSessionManager::self()->registerChatSession ( this );
......@@ -78,11 +79,11 @@ GroupWiseChatSession::GroupWiseChatSession(const Kopete::Contact* user, Kopete::
actionCollection()->addAction( "gwInvite", m_actionInvite );
connect( m_actionInvite->menu(), SIGNAL(aboutToShow()), this, SLOT(slotActionInviteAboutToShow()) ) ;
m_secure = new KAction( KIcon( "security-high" ), i18n( "Security Status" ), 0 ); // "gwSecureChat"
m_secure = new QAction( QIcon::fromTheme(QStringLiteral("security-high")), i18n( "Security Status" ), 0 ); // "gwSecureChat"
QObject::connect( m_secure, SIGNAL(triggered(bool)), SLOT(slotShowSecurity()) );
m_secure->setToolTip( i18n( "Conversation is secure" ) );
m_logging = new KAction( KIcon( "utilities-log-viewer" ), i18n( "Archiving Status" ), 0 ); // "gwLoggingChat"
m_logging = new QAction( QIcon::fromTheme(QStringLiteral("utilities-log-viewer")), i18n( "Archiving Status" ), 0 ); // "gwLoggingChat"
QObject::connect( m_secure, SIGNAL(triggered(bool)), SLOT(slotShowArchiving()) );
updateArchiving();
......@@ -303,7 +304,7 @@ void GroupWiseChatSession::dequeueMessagesAndInvites()
void GroupWiseChatSession::slotActionInviteAboutToShow()
{
// We can't simply insert KAction in this menu bebause we don't know when to delete them.
// We can't simply insert QAction in this menu bebause we don't know when to delete them.
// items inserted with insert items are automatically deleted when we call clear
qDeleteAll(m_inviteActions);
......@@ -316,7 +317,7 @@ void GroupWiseChatSession::slotActionInviteAboutToShow()
{
if( !members().contains( contact ) && contact->isOnline() )
{
KAction *a = new Kopete::UI::ContactAction( contact,
QAction *a = new Kopete::UI::ContactAction( contact,
actionCollection() );
m_actionInvite->addAction( a );
QObject::connect( a, SIGNAL(triggered(Kopete::Contact*,bool)),
......@@ -325,7 +326,7 @@ void GroupWiseChatSession::slotActionInviteAboutToShow()
}
}
// Invite someone off-list
KAction *b = new KAction( i18n("&Other..."), this );
QAction *b = new QAction( i18n("&Other..."), this );
actionCollection()->addAction( "actionOther", b );
QObject::connect( b, SIGNAL(triggered(bool)),
this, SLOT(slotInviteOtherContact()) );
......@@ -371,14 +372,23 @@ void GroupWiseChatSession::slotInviteOtherContact()
// show search dialog
QWidget * w = ( view(false) ? dynamic_cast<KMainWindow*>( view(false)->mainWidget()->topLevelWidget() ) :
Kopete::UI::Global::mainWidget() );
m_searchDlg = new KDialog( w);
m_searchDlg->setCaption(i18n( "Search for Contact to Invite" ));
m_searchDlg->setButtons(KDialog::Ok|KDialog::Cancel );
m_searchDlg->setDefaultButton(KDialog::Ok);
m_searchDlg = new QDialog( w);
m_searchDlg->setWindowTitle(i18n( "Search for Contact to Invite" ));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget();
QVBoxLayout *mainLayout = new QVBoxLayout;
m_searchDlg->setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
m_searchDlg->connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
m_searchDlg->connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
mainLayout->addWidget(buttonBox);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
m_search = new GroupWiseContactSearch( account(), QAbstractItemView::SingleSelection, true, m_searchDlg );
m_searchDlg->setMainWidget( m_search );
connect( m_search, SIGNAL(selectionValidates(bool)), m_searchDlg, SLOT(enableButtonOk(bool)) );
m_searchDlg->enableButtonOk( false );
connect( m_search, SIGNAL(selectionValidates(bool)), m_searchDlg, SLOT(okButton->setEnabled(bool)) );
okButton->setEnabled( false );
}
m_searchDlg->show();
}
......@@ -514,14 +524,14 @@ void GroupWiseChatSession::slotShowSecurity()
{
QWidget * w = ( view(false) ? dynamic_cast<KMainWindow*>( view(false)->mainWidget()->topLevelWidget() ) :
Kopete::UI::Global::mainWidget() );
KMessageBox::queuedMessageBox( w, KMessageBox::Information, i18n( "This conversation is secured with SSL security." ), i18n("Security Status" ) );
KMessageBox::information( w, i18n( "This conversation is secured with SSL security." ), i18n("Security Status" ) );
}
void GroupWiseChatSession::slotShowArchiving()
{
QWidget * w = ( view(false) ? dynamic_cast<KMainWindow*>( view(false)->mainWidget()->topLevelWidget() ) :
Kopete::UI::Global::mainWidget() );
KMessageBox::queuedMessageBox( w, KMessageBox::Information, i18n( "This conversation is being logged administratively." ), i18n("Archiving Status" ) );
KMessageBox::information( w, i18n( "This conversation is being logged administratively." ), i18n("Archiving Status" ) );
}
#include "gwmessagemanager.moc"
......@@ -30,9 +30,9 @@
#include "gwerror.h"
class QLabel;
class KAction;
class QAction;
class KActionMenu;
class KDialog;
class QDialog;
class GroupWiseAccount;
class GroupWiseContact;
class GroupWiseContactSearch;
......@@ -164,13 +164,13 @@ private:
QList< Kopete::Message > m_pendingOutgoingMessages; // messages queued while we wait for the server to tell us the conference is created.
Kopete::ContactPtrList m_pendingInvites; // people we wanted to invite to the conference, queued while waiting for the conference to be created.
KActionMenu *m_actionInvite;
QList<KAction*> m_inviteActions;
QList<QAction *> m_inviteActions;
// labels showing secure and logging status
KAction *m_secure;
KAction *m_logging;
QAction *m_secure;
QAction *m_logging;
// search widget and dialog used for inviting contacts
GroupWiseContactSearch * m_search;
KDialog * m_searchDlg;
QDialog * m_searchDlg;
// contacts who have been invited to join but have not yet joined the chat
Kopete::ContactPtrList m_invitees;
// track the number of members actually in the chat
......
......@@ -45,7 +45,7 @@ K_EXPORT_PLUGIN( GroupWiseProtocolFactory( "kopete_groupwise" ) )
GroupWiseProtocol *GroupWiseProtocol::s_protocol = 0L;
GroupWiseProtocol::GroupWiseProtocol( QObject* parent, const QVariantList &/*args*/ )
: Kopete::Protocol( GroupWiseProtocolFactory::componentData(), parent ),
: Kopete::Protocol( parent ),
/* initialise Kopete::OnlineStatus that should be user selectable in the user interface */
groupwiseOffline ( Kopete::OnlineStatus::Offline, 0, this, GroupWise::Offline, QStringList(),
i18n( "Offline" ), i18n( "O&ffline" ), Kopete::OnlineStatusManager::Offline ),
......@@ -253,7 +253,7 @@ QString GroupWiseProtocol::rtfizeText( const QString & plain )
}
else
{
kDebug() << "bogus utf-8 lead byte: 0x" << QTextStream::hex << current;
kDebug() << "bogus utf-8 lead byte: 0x" << hex << current;
ucs4Char = 0x003F;
bytesEncoded = 1;
}
......
......@@ -82,7 +82,7 @@ set( libqgroupwise_SRCS
add_library( qgroupwise SHARED ${libqgroupwise_tasks_SRCS} ${libqgroupwise_SRCS} )
target_link_libraries( qgroupwise Qt5::Core Qt5::Gui Qt5::Network ${QT_QT3SUPPORT_LIBRARY} ${QCA2_LIBRARIES} ${ZLIB_LIBRARIES} KF5::KDELibs4Support)
target_link_libraries( qgroupwise Qt5::Core Qt5::Gui Qt5::Network qca-qt5 ${ZLIB_LIBRARIES} KF5::KDELibs4Support)
########### install files ###############
......
......@@ -19,7 +19,6 @@
#include "chatroommanager.h"
#include <qmap.h>
#include <q3valuelist.h>
#include <kdebug.h>
......
......@@ -28,7 +28,6 @@
#include <qdatastream.h>
#include <qdatetime.h>
#include <q3textstream.h>
#include <QByteArray>
......
......@@ -22,7 +22,6 @@
#define GW_CORE_PROTOCOL_H
#include <QLatin1Char>
#include <q3cstring.h>
#include <qobject.h>
#include "gwfield.h"
......
......@@ -22,7 +22,7 @@
#include <QHostAddress>
#include <QtCrypto>
#include <QtCrypto/QtCrypto>
#include "gwfield.h"
#include "libgroupwise_export.h"
......
......@@ -19,8 +19,6 @@
#include "gwfield.h"
#include <q3cstring.h>
#include "gwerror.h"
#ifdef LIBGW_USE_KDEBUG
......
......@@ -22,7 +22,7 @@
#include <qtimer.h>
#include <QtCrypto>
#include <QtCrypto/QtCrypto>
class QCATLSHandler::Private
{
......
......@@ -22,7 +22,7 @@
#ifndef SECURESTREAM_H
#define SECURESTREAM_H
#include <QtCrypto>
#include <QtCrypto/QtCrypto>
#include "tlshandler.h"
#include"bytestream.h"
......
......@@ -21,8 +21,6 @@
#ifndef POLLSEARCHRESULTSTASK_H
#define POLLSEARCHRESULTSTASK_H
#include <q3valuelist.h>
#include "gwerror.h"
#include "requesttask.h"
......
......@@ -30,7 +30,6 @@
#include <qpushbutton.h>
#include <qradiobutton.h>
#include <qtabwidget.h>
#include <q3valuelist.h>
#include <QVBoxLayout>
#include <kdebug.h>
......
......@@ -26,7 +26,7 @@
#include "gwerror.h"
#include <addcontactpage.h>
#include <QtGui/QLabel>
#include <QLabel>
class QLabel;
namespace Kopete { class Account; }
......
......@@ -19,7 +19,6 @@
#include "gwcontactproperties.h"
#include <qclipboard.h>
#include <q3header.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qmap.h>
......@@ -33,8 +32,13 @@
#include <kopeteonlinestatus.h>
#include <kopetemetacontact.h>
#include <kopeteuiglobal.h>
#include <kaction.h>
#include <QAction>
#include <kstandardaction.h>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <QDialog>
#include "gwcontact.h"
#include "gwprotocol.h"
......@@ -76,14 +80,21 @@ GroupWiseContactProperties::~GroupWiseContactProperties()
void GroupWiseContactProperties::init()
{
m_dialog = new KDialog( qobject_cast<QWidget*>( parent() ));
m_dialog->setCaption(i18n( "Contact Properties" ));
m_dialog->setButtons(KDialog::Ok);
m_dialog->setDefaultButton(KDialog::Ok);
m_dialog = new QDialog( qobject_cast<QWidget*>( parent() ));
m_dialog->setWindowTitle(i18n( "Contact Properties" ));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
QWidget *mainWidget = new QWidget();
QVBoxLayout *mainLayout = new QVBoxLayout;
m_dialog->setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
m_dialog->connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
m_dialog->connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
mainLayout->addWidget(buttonBox);
m_dialog->setModal(false);
QWidget * wid = new QWidget( m_dialog );
m_dialog->setMainWidget( wid );
m_ui.setupUi( wid );
m_ui.setupUi( mainWidget );
m_copyAction = KStandardAction::copy( this, SLOT(copy()), 0 );
m_ui.propsView->addAction( m_copyAction );
}
......
......@@ -26,8 +26,8 @@
#include "ui_gwcontactprops.h"
namespace Ui { class GroupWiseContactPropsWidget; }
class KDialog;
class KAction;
class QDialog;
class QAction;
/**
Logic, wrapping UI, for displaying contact properties
......@@ -54,8 +54,8 @@ protected slots:
void copy();
private:
Ui::GroupWiseContactProps m_ui;
KAction * m_copyAction;
KDialog * m_dialog;
QAction * m_copyAction;
QDialog * m_dialog;
};
#endif // GWCONTACTPROPERTIES_H
......@@ -24,7 +24,7 @@
#include <QStringList>
#include <QtGui/QPainter>
#include <QtGui/QPixmap>
#include <QtGui/QLabel>
#include <QLabel>
#include <kdebug.h>
#include <kiconloader.h>
......@@ -358,7 +358,7 @@ void GroupWisePrivacyDialog::commitChanges()
void GroupWisePrivacyDialog::errorNotConnected()
{
KMessageBox::queuedMessageBox( this, KMessageBox::Information,
KMessageBox::information( this,
i18n( "You can only change privacy settings while you are logged in to the GroupWise Messenger server." ) , i18n("'%1' Not Logged In", m_account->accountId() ) );
}
......
......@@ -19,12 +19,12 @@
#include "gwsearch.h"
#include <QtCore/QAbstractItemModel>
#include <QtGui/QComboBox>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QPainter>
#include <QtGui/QSortFilterProxyModel>
#include <QComboBox>
#include <QHeaderView>
#include <QLabel>
#include <QLineEdit>
#include <QPainter>
#include <QSortFilterProxyModel>
#include <kdebug.h>
#include <klocale.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment