TQt4 port kopete-otr

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kopete-otr@1238882 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent c99e1ecc99
commit c54c3c07f6

@ -6,11 +6,11 @@ AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN AC_CHECK_KDEMAXPATHLEN
# Make sure that kde includes, etc. are part of the CPPFLAGS ... # Make sure that kde includes, etc. are part of the CPPFLAGS ...
CPPFLAGS="$CPPFLAGS $all_includes -I$kde_includes/kopete" CPPFLAGS="$CPPFLAGS $all_includes -I$kde_includes/kopete -I$kde_includes/kde/kopete"
# check for libkopete headers and library # check for libkopete headers and library
AC_CHECK_HEADER(kopeteversion.h,, KDE_CHECK_HEADER(kopeteversion.h,,
AC_MSG_ERROR([libkopete header files missing])) AC_MSG_ERROR([libkopete header files missing]))
#AC_CHECK_LIB([kopete], [_ZN6Kopete7AccountD0Ev],, #AC_CHECK_LIB([kopete], [_ZN6Kopete7AccountD0Ev],,

@ -4,7 +4,7 @@ messages:
extractrc `find . -name \*.ui -o -name \*.rc` > rc.cpp extractrc `find . -name \*.ui -o -name \*.rc` > rc.cpp
$(XGETTEXT) --keyword=i18n *.cpp -o $(top_srcdir)/po/kopete_otr.pot $(XGETTEXT) --keyword=i18n *.cpp -o $(top_srcdir)/po/kopete_otr.pot
INCLUDES = $(all_includes) -I$(kde_includes)/kopete -I$(kde_includes)/kopete/ui INCLUDES = $(all_includes) -I$(kde_includes)/kopete -I$(kde_includes)/kde/kopete -I$(kde_includes)/kopete/ui -I$(kde_includes)/kde/kopete/ui
kde_module_LTLIBRARIES = kcm_kopete_otr.la kopete_otr.la kde_module_LTLIBRARIES = kcm_kopete_otr.la kopete_otr.la

@ -39,30 +39,30 @@
*/ */
OtrGUIClient::OtrGUIClient( Kopete::ChatSession *parent, const char *name ) OtrGUIClient::OtrGUIClient( Kopete::ChatSession *tqparent, const char *name )
: QObject( parent, name ), KXMLGUIClient( parent ) : TQObject( tqparent, name ), KXMLGUIClient( tqparent )
{ {
setInstance( OTRPlugin::plugin()->instance() ); setInstance( OTRPlugin::plugin()->instance() );
connect( OTRPlugin::plugin(), connect( OTRPlugin::plugin(),
SIGNAL( destroyed( QObject * ) ), this, TQT_SIGNAL( destroyed( TQObject * ) ), this,
SLOT( deleteLater() ) TQT_SLOT( deleteLater() )
); );
connect(this, SIGNAL( signalOtrChatsession(Kopete::ChatSession*, bool) ), OTRPlugin::plugin(), SLOT(slotEnableOtr(Kopete::ChatSession*, bool))); connect(this, TQT_SIGNAL( signalOtrChatsession(Kopete::ChatSession*, bool) ), OTRPlugin::plugin(), TQT_SLOT(slotEnableOtr(Kopete::ChatSession*, bool)));
connect( OTRPlugin::plugin(), SIGNAL( goneSecure( Kopete::ChatSession *, int ) ), connect( OTRPlugin::plugin(), TQT_SIGNAL( goneSecure( Kopete::ChatSession *, int ) ),
this, SLOT( encryptionEnabled( Kopete::ChatSession *, int ) ) ); this, TQT_SLOT( encryptionEnabled( Kopete::ChatSession *, int ) ) );
connect( this, SIGNAL( signalVerifyFingerprint( Kopete::ChatSession * ) ), OTRPlugin::plugin(), SLOT(slotVerifyFingerprint( Kopete::ChatSession * )) ); connect( this, TQT_SIGNAL( signalVerifyFingerprint( Kopete::ChatSession * ) ), OTRPlugin::plugin(), TQT_SLOT(slotVerifyFingerprint( Kopete::ChatSession * )) );
m_manager = parent; m_manager = tqparent;
otrActionMenu = new KActionMenu(i18n("OTR Settings"),"otr_disabled", actionCollection(), "otr_settings"); otrActionMenu = new KActionMenu(i18n("OTR Settings"),"otr_disabled", actionCollection(), "otr_settings");
otrActionMenu->setDelayed( false ); otrActionMenu->setDelayed( false );
actionEnableOtr = new KAction(i18n( "Start OTR session" ), "otr_private", 0,this,SLOT(slotEnableOtr()),actionCollection(), "enable_otr"); actionEnableOtr = new KAction(i18n( "Start OTR session" ), "otr_private", 0,this,TQT_SLOT(slotEnableOtr()),actionCollection(), "enable_otr");
actionDisableOtr = new KAction(i18n("End OTR session"), "otr_disabled",0, this,SLOT(slotDisableOtr()), actionCollection(), "disable_otr"); actionDisableOtr = new KAction(i18n("End OTR session"), "otr_disabled",0, this,TQT_SLOT(slotDisableOtr()), actionCollection(), "disable_otr");
actionVerifyFingerprint = new KAction(i18n("Authenticate Contact"), "signature",0, this,SLOT(slotVerifyFingerprint()), actionCollection(), "verify_fingerprint"); actionVerifyFingerprint = new KAction(i18n("Authenticate Contact"), "signature",0, this,TQT_SLOT(slotVerifyFingerprint()), actionCollection(), "verify_fingerprint");
otrActionMenu->insert(actionEnableOtr); otrActionMenu->insert(actionEnableOtr);
otrActionMenu->insert(actionDisableOtr); otrActionMenu->insert(actionDisableOtr);
@ -70,7 +70,7 @@ OtrGUIClient::OtrGUIClient( Kopete::ChatSession *parent, const char *name )
setXMLFile("otrchatui.rc"); setXMLFile("otrchatui.rc");
encryptionEnabled( parent, OtrlChatInterface::self()->privState(parent) ); encryptionEnabled( tqparent, OtrlChatInterface::self()->privState(tqparent) );
} }

@ -22,7 +22,7 @@
#ifndef OTRGUICLIENT_H #ifndef OTRGUICLIENT_H
#define OTRGUICLIENT_H #define OTRGUICLIENT_H
#include <qobject.h> #include <tqobject.h>
#include <kxmlguiclient.h> #include <kxmlguiclient.h>
//#include <kio/job.h> //#include <kio/job.h>
@ -47,13 +47,14 @@ namespace Kopete { class ChatSession; }
class OtrGUIClient : public QObject , public KXMLGUIClient class OtrGUIClient : public TQObject , public KXMLGUIClient
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
OtrGUIClient( Kopete::ChatSession *parent, const char *name=0L ); OtrGUIClient( Kopete::ChatSession *tqparent, const char *name=0L );
~OtrGUIClient(); ~OtrGUIClient();

@ -44,14 +44,14 @@
#include <kanimwidget.h> #include <kanimwidget.h>
#include <kpushbutton.h> #include <kpushbutton.h>
#include <qvbox.h> #include <tqvbox.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qnamespace.h> #include <tqnamespace.h>
#include <qeventloop.h> #include <tqeventloop.h>
#include <qapplication.h> #include <tqapplication.h>
#include <qfile.h> #include <tqfile.h>
#include <qfileinfo.h> #include <tqfileinfo.h>
#include <qptrlist.h> #include <tqptrlist.h>
#include "otrlchatinterface.h" #include "otrlchatinterface.h"
#include "otrguiclient.h" #include "otrguiclient.h"
@ -74,7 +74,7 @@ static OtrlPolicy policy(void *opdata, ConnContext *context){
kdDebug() << "Disabling OTR for: " << session->protocol()->pluginId() << endl; kdDebug() << "Disabling OTR for: " << session->protocol()->pluginId() << endl;
return OTRL_POLICY_NEVER; return OTRL_POLICY_NEVER;
} }
QString policy = session->members().getFirst()->metaContact()->pluginData( OTRPlugin::plugin(), "otr_policy" ); TQString policy = session->members().getFirst()->metaContact()->pluginData( OTRPlugin::plugin(), "otr_policy" );
switch( policy.toInt( &noerr, 10 ) ){ switch( policy.toInt( &noerr, 10 ) ){
case 1: case 1:
return OTRL_POLICY_ALWAYS; return OTRL_POLICY_ALWAYS;
@ -93,7 +93,7 @@ static void create_privkey(void *opdata, const char *accountname, const char *pr
Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata); Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata);
PrivKeyPopup *popup = new PrivKeyPopup( session->view()->mainWidget(), i18n("Generating private key"), Qt::WStyle_Dialog | Qt::WStyle_StaysOnTop ); PrivKeyPopup *popup = new PrivKeyPopup( session->view()->mainWidget(), i18n("Generating private key"), TQt::WStyle_Dialog | TQt::WStyle_StaysOnTop );
KAnimWidget *anim = new KAnimWidget( "kde", 72, popup->animFrame, "kopete" ); KAnimWidget *anim = new KAnimWidget( "kde", 72, popup->animFrame, "kopete" );
anim->start(); anim->start();
anim->show(); anim->show();
@ -103,7 +103,7 @@ static void create_privkey(void *opdata, const char *accountname, const char *pr
KeyGenThread *keyGenThread = new KeyGenThread( accountname, protocol ); KeyGenThread *keyGenThread = new KeyGenThread( accountname, protocol );
keyGenThread->start(); keyGenThread->start();
while( !keyGenThread->wait(100) ){ while( !keyGenThread->wait(100) ){
qApp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers, 100); tqApp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers, 100);
} }
popup->setCloseLock( false ); popup->setCloseLock( false );
popup->close(); popup->close();
@ -112,7 +112,7 @@ static void create_privkey(void *opdata, const char *accountname, const char *pr
static int is_logged_in(void *opdata, const char *accountname, const char *protocol, const char *recipient){ static int is_logged_in(void *opdata, const char *accountname, const char *protocol, const char *recipient){
Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata); Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata);
Kopete::ContactPtrList list = session->members(); Kopete::ContactPtrList list = session->members();
for ( QPtrListIterator<Kopete::Contact> it( list ); Kopete::Contact *contact = it.current(); ++it ){ for ( TQPtrListIterator<Kopete::Contact> it( list ); Kopete::Contact *contact = it.current(); ++it ){
if( contact->contactId().compare( recipient ) == 0 ){ if( contact->contactId().compare( recipient ) == 0 ){
Kopete::OnlineStatus status = session->contactOnlineStatus( contact ); Kopete::OnlineStatus status = session->contactOnlineStatus( contact );
if( status == Kopete::OnlineStatus::Unknown){ if( status == Kopete::OnlineStatus::Unknown){
@ -128,12 +128,12 @@ static int is_logged_in(void *opdata, const char *accountname, const char *proto
} }
static void inject_message( void *opdata, const char *accountname, const char *protocol, const char *recipient, const char *message ){ static void inject_message( void *opdata, const char *accountname, const char *protocol, const char *recipient, const char *message ){
//KMessageBox::information( NULL, QString(accountname) + ":" + QString(protocol) + ":" + QString(recipient) + ":" + QString(message) ); //KMessageBox::information( NULL, TQString(accountname) + ":" + TQString(protocol) + ":" + TQString(recipient) + ":" + TQString(message) );
Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata); Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata);
Kopete::ContactPtrList list = session->members(); Kopete::ContactPtrList list = session->members();
for ( QPtrListIterator<Kopete::Contact> it( list ); Kopete::Contact *contact = it.current(); ++it ){ for ( TQPtrListIterator<Kopete::Contact> it( list ); Kopete::Contact *contact = it.current(); ++it ){
if( contact->contactId().compare( recipient ) == 0 ){ if( contact->contactId().compare( recipient ) == 0 ){
Kopete::Message msg( session->account()->myself(), contact, QString( message ), Kopete::Message::Outbound ); Kopete::Message msg( session->account()->myself(), contact, TQString( message ), Kopete::Message::Outbound );
session->sendMessage( msg ); session->sendMessage( msg );
return; return;
} }
@ -141,16 +141,16 @@ static void inject_message( void *opdata, const char *accountname, const char *p
} }
static void notify(void *opdata, OtrlNotifyLevel level, const char *accountname, const char *protocol, const char *username, const char *title, const char *primary, const char *secondary){ static void notify(void *opdata, OtrlNotifyLevel level, const char *accountname, const char *protocol, const char *username, const char *title, const char *primary, const char *secondary){
KMessageBox::information(NULL, QString( primary ) + QString( secondary ), QString( title ) ); KMessageBox::information(NULL, TQString( primary ) + TQString( secondary ), TQString( title ) );
} }
static int display_otr_message( void *opdata, const char *accountname, const char *protocol, const char *username, const char *message ){ static int display_otr_message( void *opdata, const char *accountname, const char *protocol, const char *username, const char *message ){
Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata); Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata);
Kopete::ContactPtrList list = session->members(); Kopete::ContactPtrList list = session->members();
for ( QPtrListIterator<Kopete::Contact> it( list ); Kopete::Contact *contact = it.current(); ++it ){ for ( TQPtrListIterator<Kopete::Contact> it( list ); Kopete::Contact *contact = it.current(); ++it ){
if( contact->contactId().compare( username ) == 0 ){ if( contact->contactId().compare( username ) == 0 ){
Kopete::Message msg( session->members().getFirst(), session->account()->myself(), QString( message ), Kopete::Message::Internal ); Kopete::Message msg( session->members().getFirst(), session->account()->myself(), TQString( message ), Kopete::Message::Internal );
msg.setBody( QString( message ), Kopete::Message::RichText ); msg.setBody( TQString( message ), Kopete::Message::RichText );
session->appendMessage( msg ); session->appendMessage( msg );
return 0; return 0;
} }
@ -175,13 +175,13 @@ static void protocol_name_free(void *opdata, const char *protocol_name){
static void new_fingerprint(void *opdata, OtrlUserState us, const char *accountname, const char *protocol, const char *username, unsigned char fingerprint[20]){ static void new_fingerprint(void *opdata, OtrlUserState us, const char *accountname, const char *protocol, const char *username, unsigned char fingerprint[20]){
kdDebug() << "Received a new Fingerprint" << endl; kdDebug() << "Received a new Fingerprint" << endl;
Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata); Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata);
Kopete::Message msg( session->members().getFirst(), session->account()->myself(), i18n("<b>Received a new fingerprint from <a>%1</a>. You should authenticate this contact.</b>").arg( session->members().getFirst()->contactId() ), Kopete::Message::Internal, Kopete::Message::RichText ); Kopete::Message msg( session->members().getFirst(), session->account()->myself(), i18n("<b>Received a new fingerprint from <a>%1</a>. You should authenticate this contact.</b>").tqarg( session->members().getFirst()->contactId() ), Kopete::Message::Internal, Kopete::Message::RichText );
session->appendMessage( msg ); session->appendMessage( msg );
} }
static void write_fingerprints(void *opdata){ static void write_fingerprints(void *opdata){
kdDebug() << "Writing fingerprints" << endl; kdDebug() << "Writing fingerprints" << endl;
otrl_privkey_write_fingerprints( userstate, QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); otrl_privkey_write_fingerprints( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" );
} }
static void gone_secure(void *opdata, ConnContext *context){ static void gone_secure(void *opdata, ConnContext *context){
@ -257,11 +257,11 @@ OtrlChatInterface::OtrlChatInterface(){
userstate = otrl_userstate_create(); userstate = otrl_userstate_create();
otrl_privkey_read( userstate, QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); otrl_privkey_read( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" );
otrl_privkey_read_fingerprints(userstate, QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints", NULL, NULL); otrl_privkey_read_fingerprints(userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints", NULL, NULL);
} }
@ -284,8 +284,8 @@ OtrlUserState OtrlChatInterface::getUserstate(){
} }
int OtrlChatInterface::decryptMessage( QString *msg, QString accountId, int OtrlChatInterface::decryptMessage( TQString *msg, TQString accountId,
QString protocol, QString contactId , Kopete::ChatSession *chatSession){ TQString protocol, TQString contactId , Kopete::ChatSession *chatSession){
int ignoremessage; int ignoremessage;
char *newMessage = NULL; char *newMessage = NULL;
@ -300,7 +300,7 @@ int OtrlChatInterface::decryptMessage( QString *msg, QString accountId,
tlv = otrl_tlv_find(tlvs, OTRL_TLV_DISCONNECTED); tlv = otrl_tlv_find(tlvs, OTRL_TLV_DISCONNECTED);
if( tlv ){ if( tlv ){
Kopete::Message msg( chatSession->members().getFirst(), chatSession->account()->myself(), i18n("<b>%1</b> has ended the OTR session. You should do the same.").arg(chatSession->members().getFirst()->contactId()) , Kopete::Message::Internal, Kopete::Message::RichText ); Kopete::Message msg( chatSession->members().getFirst(), chatSession->account()->myself(), i18n("<b>%1</b> has ended the OTR session. You should do the same.").tqarg(chatSession->members().getFirst()->contactId()) , Kopete::Message::Internal, Kopete::Message::RichText );
chatSession->appendMessage( msg ); chatSession->appendMessage( msg );
OTRPlugin::plugin()->emitGoneSecure( chatSession, 3 ); OTRPlugin::plugin()->emitGoneSecure( chatSession, 3 );
@ -315,7 +315,7 @@ int OtrlChatInterface::decryptMessage( QString *msg, QString accountId,
if (nextMsg != OTRL_SMP_EXPECT1){ if (nextMsg != OTRL_SMP_EXPECT1){
abortSMP( context, chatSession ); abortSMP( context, chatSession );
} else { } else {
SMPPopup *popup = new SMPPopup( chatSession->view()->mainWidget(), i18n("Enter authentication secret"), Qt::WStyle_Dialog | Qt::WStyle_StaysOnTop, context, chatSession, false ); SMPPopup *popup = new SMPPopup( chatSession->view()->mainWidget(), i18n("Enter authentication secret"), TQt::WStyle_Dialog | TQt::WStyle_StaysOnTop, context, chatSession, false );
popup->show(); popup->show();
} }
} }
@ -378,42 +378,42 @@ int OtrlChatInterface::decryptMessage( QString *msg, QString accountId,
if( !ignoremessage ){ if( !ignoremessage ){
// message is decrypted // message is decrypted
if( newMessage != NULL ){ if( newMessage != NULL ){
*msg = QString::fromUtf8(newMessage); *msg = TQString::fromUtf8(newMessage);
otrl_message_free( newMessage ); otrl_message_free( newMessage );
msg->replace( '\n', "<br>", false ); msg->tqreplace( TQString('\n'), TQString("<br>"), false );
} }
} }
return ignoremessage; return ignoremessage;
} }
QString OtrlChatInterface::encryptMessage( QString msg, QString accountId, TQString OtrlChatInterface::encryptMessage( TQString msg, TQString accountId,
QString protocol, QString contactId , Kopete::ChatSession *chatSession ){ TQString protocol, TQString contactId , Kopete::ChatSession *chatSession ){
int err; int err;
char * newMessage; char * newMessage;
if( otrl_proto_message_type( msg ) == OTRL_MSGTYPE_NOTOTR ){ if( otrl_proto_message_type( msg ) == OTRL_MSGTYPE_NOTOTR ){
msg.replace( '<', "&lt;", false ); msg.tqreplace( TQString('<'), TQString("&lt;"), false );
err = otrl_message_sending( userstate, &ui_ops, chatSession, accountId.latin1(), protocol.latin1(), contactId.latin1(), msg.utf8(), NULL, &newMessage, NULL, NULL ); err = otrl_message_sending( userstate, &ui_ops, chatSession, accountId.latin1(), protocol.latin1(), contactId.latin1(), msg.utf8(), NULL, &newMessage, NULL, NULL );
if( err != 0 ){ if( err != 0 ){
msg = i18n("Encryption error"); msg = i18n("Encryption error");
} else { } else {
if( newMessage != NULL ){ if( newMessage != NULL ){
msg = QString::fromUtf8( newMessage ); msg = TQString::fromUtf8( newMessage );
otrl_message_free( newMessage ); otrl_message_free( newMessage );
} }
} }
} }
OtrlMessageType type = otrl_proto_message_type( msg ); OtrlMessageType type = otrl_proto_message_type( msg );
if( type == OTRL_MSGTYPE_NOTOTR | type == OTRL_MSGTYPE_TAGGEDPLAINTEXT ){ if( type == OTRL_MSGTYPE_NOTOTR | type == OTRL_MSGTYPE_TAGGEDPLAINTEXT ){
msg.replace( "&lt;", "<", false ); msg.tqreplace( "&lt;", "<", false );
} }
return msg; return msg;
} }
QString OtrlChatInterface::getDefaultQuery( QString accountId ){ TQString OtrlChatInterface::getDefaultQuery( TQString accountId ){
char *message; char *message;
message = otrl_proto_default_query_msg( accountId.latin1(), OTRL_POLICY_ALLOW_V2 ); message = otrl_proto_default_query_msg( accountId.latin1(), OTRL_POLICY_ALLOW_V2 );
QString msg( message ); TQString msg( message );
otrl_message_free( message ); otrl_message_free( message );
return msg; return msg;
} }
@ -423,12 +423,12 @@ void OtrlChatInterface::disconnectSession( Kopete::ChatSession *chatSession ){
OTRPlugin::plugin()->emitGoneSecure( chatSession, false ); OTRPlugin::plugin()->emitGoneSecure( chatSession, false );
Kopete::Message msg( chatSession->account()->myself(), chatSession->members().getFirst(), i18n("Terminating OTR session."), Kopete::Message::Internal ); Kopete::Message msg( chatSession->account()->myself(), chatSession->members().getFirst(), i18n("Terminating OTR session."), Kopete::Message::Internal );
// msg.setBody( QString( message ), Kopete::Message::RichText ); // msg.setBody( TQString( message ), Kopete::Message::RichText );
chatSession->appendMessage( msg ); chatSession->appendMessage( msg );
} }
bool OtrlChatInterface::shouldDiscard( QString message ){ bool OtrlChatInterface::shouldDiscard( TQString message ){
if( !message.isEmpty() && !message.isNull() ){ if( !message.isEmpty() && !message.isNull() ){
switch( otrl_proto_message_type( message.latin1() ) ){ switch( otrl_proto_message_type( message.latin1() ) ){
case OTRL_MSGTYPE_TAGGEDPLAINTEXT: case OTRL_MSGTYPE_TAGGEDPLAINTEXT:
@ -470,11 +470,11 @@ int OtrlChatInterface::privState( Kopete::ChatSession *session ){
return 0; return 0;
} }
QString OtrlChatInterface::formatContact(QString contactId){ TQString OtrlChatInterface::formatContact(TQString contactId){
Kopete::MetaContact *metaContact = Kopete::ContactList::self()->findMetaContactByContactId(contactId); Kopete::MetaContact *metaContact = Kopete::ContactList::self()->findMetaContactByContactId(contactId);
if( metaContact ){ if( metaContact ){
QString displayName = metaContact->displayName(); TQString displayName = metaContact->displayName();
if((displayName != contactId) && !displayName.isNull()){ if((displayName != contactId) && !displayName.isNull()){
return displayName + " (" + contactId+")"; return displayName + " (" + contactId+")";
} }
@ -487,7 +487,7 @@ void OtrlChatInterface::verifyFingerprint( Kopete::ChatSession *session ){
context = otrl_context_find( userstate, session->members().getFirst()->contactId().latin1(), session->account()->accountId().latin1(), session->protocol()->displayName().latin1(), 0, NULL, NULL, NULL); context = otrl_context_find( userstate, session->members().getFirst()->contactId().latin1(), session->account()->accountId().latin1(), session->protocol()->displayName().latin1(), 0, NULL, NULL, NULL);
SMPPopup *popup = new SMPPopup( session->view()->mainWidget(), i18n("Enter authentication secret"), Qt::WStyle_Dialog | Qt::WStyle_StaysOnTop, context, session, true ); SMPPopup *popup = new SMPPopup( session->view()->mainWidget(), i18n("Enter authentication secret"), TQt::WStyle_Dialog | TQt::WStyle_StaysOnTop, context, session, true );
popup->show(); popup->show();
@ -504,14 +504,14 @@ void OtrlChatInterface::setTrust( Kopete::ChatSession *session, bool trust ){
otrl_context_set_trust( fingerprint, NULL ); otrl_context_set_trust( fingerprint, NULL );
} }
kdDebug() << "Writing fingerprints" << endl; kdDebug() << "Writing fingerprints" << endl;
otrl_privkey_write_fingerprints( userstate, QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); otrl_privkey_write_fingerprints( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" );
OTRPlugin::plugin()->emitGoneSecure( session, privState( session ) ); OTRPlugin::plugin()->emitGoneSecure( session, privState( session ) );
} else { } else {
kdDebug() << "could not find fingerprint" << endl; kdDebug() << "could not find fingerprint" << endl;
} }
} }
Fingerprint *OtrlChatInterface::findFingerprint( QString account ){ Fingerprint *OtrlChatInterface::findFingerprint( TQString account ){
ConnContext *context; ConnContext *context;
for( context = userstate->context_root; context != NULL; context = context->next ){ for( context = userstate->context_root; context != NULL; context = context->next ){
@ -524,7 +524,7 @@ Fingerprint *OtrlChatInterface::findFingerprint( QString account ){
return NULL; return NULL;
} }
QString OtrlChatInterface::findActiveFingerprint( Kopete::ChatSession *session ){ TQString OtrlChatInterface::findActiveFingerprint( Kopete::ChatSession *session ){
ConnContext *context; ConnContext *context;
char hash[45]; char hash[45];
@ -555,16 +555,16 @@ bool OtrlChatInterface::isVerified( Kopete::ChatSession *session ){
void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){ void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){
// Updating private keys from <=0.3 // Updating private keys from <=0.3
kdDebug() << "updating keys" << endl; kdDebug() << "updating keys" << endl;
QFile keyfile( QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); TQFile keyfile( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" );
QString line; TQString line;
QString file; TQString file;
if( keyfile.open( IO_ReadWrite ) ){ if( keyfile.open( IO_ReadWrite ) ){
kdDebug() << "file open" << endl; kdDebug() << "file open" << endl;
while( keyfile.readLine( line, 200 ) != -1){ while( keyfile.readLine( line, 200 ) != -1){
if( line.find( "protocol" ) != -1 ){ if( line.tqfind( "protocol" ) != -1 ){
if( line.find( account->accountLabel() ) != -1 ){ if( line.tqfind( account->accountLabel() ) != -1 ){
line.replace( account->accountLabel(), account->protocol()->displayName() ); line.tqreplace( account->accountLabel(), account->protocol()->displayName() );
kdDebug() << "Successfully updated keyfile for account " << account->accountId() << endl; kdDebug() << "Successfully updated keyfile for account " << account->accountId() << endl;
} }
} }
@ -576,20 +576,20 @@ void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){
keyfile.writeBlock( file.latin1(), file.length() ); keyfile.writeBlock( file.latin1(), file.length() );
keyfile.close(); keyfile.close();
otrl_privkey_forget_all( userstate ); otrl_privkey_forget_all( userstate );
otrl_privkey_read( userstate, QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); otrl_privkey_read( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" );
file = ""; file = "";
line = ""; line = "";
// Updating fingerprints from <=0.3 // Updating fingerprints from <=0.3
kdDebug() << "updating fingerprints" << endl; kdDebug() << "updating fingerprints" << endl;
QFile fingerprintfile( QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); TQFile fingerprintfile( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" );
if( fingerprintfile.open( IO_ReadWrite ) ){ if( fingerprintfile.open( IO_ReadWrite ) ){
kdDebug() << "file open" << endl; kdDebug() << "file open" << endl;
while( fingerprintfile.readLine( line, 200 ) != -1){ while( fingerprintfile.readLine( line, 200 ) != -1){
int pos = line.findRev( account->accountLabel() ); int pos = line.tqfindRev( account->accountLabel() );
if( pos != -1 ){ if( pos != -1 ){
line.replace( pos, account->accountLabel().length(), account->protocol()->displayName() ); line.tqreplace( pos, account->accountLabel().length(), account->protocol()->displayName() );
kdDebug() << "Successfully updated fingerprint for account " << account->accountId() << endl; kdDebug() << "Successfully updated fingerprint for account " << account->accountId() << endl;
} }
file.append( line ); file.append( line );
@ -600,21 +600,21 @@ void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){
fingerprintfile.writeBlock( file.latin1(), file.length() ); fingerprintfile.writeBlock( file.latin1(), file.length() );
fingerprintfile.close(); fingerprintfile.close();
otrl_context_forget_all( userstate ); otrl_context_forget_all( userstate );
otrl_privkey_read_fingerprints(userstate, QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints", NULL, NULL); otrl_privkey_read_fingerprints(userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints", NULL, NULL);
} }
void OtrlChatInterface::checkFilePermissions( QString file ){ void OtrlChatInterface::checkFilePermissions( TQString file ){
if( QFile::exists( file ) ){ if( TQFile::exists( file ) ){
QFile privkeys( file ); TQFile privkeys( file );
QFileInfo privkeysInfo( privkeys ); TQFileInfo privkeysInfo( privkeys );
if( !privkeysInfo.permission( QFileInfo::ReadOwner | QFileInfo::WriteOwner ) | if( !privkeysInfo.permission( TQFileInfo::ReadOwner | TQFileInfo::WriteOwner ) |
privkeysInfo.permission( QFileInfo::ReadGroup ) | privkeysInfo.permission( TQFileInfo::ReadGroup ) |
privkeysInfo.permission( QFileInfo::WriteGroup ) | privkeysInfo.permission( TQFileInfo::WriteGroup ) |
privkeysInfo.permission( QFileInfo::ExeGroup ) | privkeysInfo.permission( TQFileInfo::ExeGroup ) |
privkeysInfo.permission( QFileInfo::ReadOther ) | privkeysInfo.permission( TQFileInfo::ReadOther ) |
privkeysInfo.permission( QFileInfo::WriteOther ) | privkeysInfo.permission( TQFileInfo::WriteOther ) |
privkeysInfo.permission( QFileInfo::ExeOther ) ){ privkeysInfo.permission( TQFileInfo::ExeOther ) ){
kdDebug() << "Permissions of OTR storage file are wrong! Correcting..." << endl; kdDebug() << "Permissions of OTR storage file are wrong! Correcting..." << endl;
chmod( file, 0600); chmod( file, 0600);
} }
@ -622,13 +622,13 @@ void OtrlChatInterface::checkFilePermissions( QString file ){
} }
/*bool OtrlChatInterface::verifyQuestion( Kopete::ChatSession *session, QString fingerprint ){ /*bool OtrlChatInterface::verifyQuestion( Kopete::ChatSession *session, TQString fingerprint ){
kdDebug() << "searching for Fingerprint" << endl; kdDebug() << "searching for Fingerprint" << endl;
if( fingerprint != NULL ){ if( fingerprint != NULL ){
int doVerify = KMessageBox::questionYesNo( int doVerify = KMessageBox::questionYesNo(
NULL, NULL,
i18n("Please contact %1 via another secure way and verify that the following Fingerprint is correct:").arg( formatContact(session->members().getFirst()->contactId())) + "\n\n" + fingerprint + "\n\n" + i18n("Are you sure you want to trust this fingerprint?"), i18n("Please contact %1 via another secure way and verify that the following Fingerprint is correct:").tqarg( formatContact(session->members().getFirst()->contactId())) + "\n\n" + fingerprint + "\n\n" + i18n("Are you sure you want to trust this fingerprint?"),
i18n("Verify fingerprint") ); i18n("Verify fingerprint") );
if( doVerify == KMessageBox::Yes ){ if( doVerify == KMessageBox::Yes ){
return true; return true;
@ -654,7 +654,7 @@ void OtrlChatInterface::abortSMP( ConnContext *context, Kopete::ChatSession *ses
} }
} }
void OtrlChatInterface::respondSMP( ConnContext *context, Kopete::ChatSession *session, QString secret, bool initiate ){ void OtrlChatInterface::respondSMP( ConnContext *context, Kopete::ChatSession *session, TQString secret, bool initiate ){
if( initiate ){ if( initiate ){
context = otrl_context_find( userstate, session->members().getFirst()->contactId().latin1(), session->account()->accountId().latin1(), session->protocol()->displayName().latin1(), 0, NULL, NULL, NULL); context = otrl_context_find( userstate, session->members().getFirst()->contactId().latin1(), session->account()->accountId().latin1(), session->protocol()->displayName().latin1(), 0, NULL, NULL, NULL);
otrl_message_initiate_smp( userstate, &ui_ops, session, context, (unsigned char*)secret.latin1(), secret.length() ); otrl_message_initiate_smp( userstate, &ui_ops, session, context, (unsigned char*)secret.latin1(), secret.length() );
@ -670,7 +670,7 @@ void OtrlChatInterface::respondSMP( ConnContext *context, Kopete::ChatSession *s
/****************** KeyGenThread *******************/ /****************** KeyGenThread *******************/
KeyGenThread::KeyGenThread( QString accountname, QString protocol ){ KeyGenThread::KeyGenThread( TQString accountname, TQString protocol ){
this->accountname = accountname; this->accountname = accountname;
this->protocol = protocol; this->protocol = protocol;
} }
@ -678,8 +678,8 @@ KeyGenThread::KeyGenThread( QString accountname, QString protocol ){
void KeyGenThread::run() void KeyGenThread::run()
{ {
kdDebug() << "Creating private key... Storing to: " + QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true)) + "privkeys" << endl; kdDebug() << "Creating private key... Storing to: " + TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true)) + "privkeys" << endl;
otrl_privkey_generate(OtrlChatInterface::self()->getUserstate(), QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys", accountname, protocol); otrl_privkey_generate(OtrlChatInterface::self()->getUserstate(), TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys", accountname, protocol);
OtrlChatInterface::self()->checkFilePermissions( QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); OtrlChatInterface::self()->checkFilePermissions( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" );
} }

@ -25,11 +25,11 @@
* @author Michael Zanetti * @author Michael Zanetti
*/ */
#include <qstring.h> #include <tqstring.h>
#include <qptrlist.h> #include <tqptrlist.h>
#include <qvaluelist.h> #include <tqvaluelist.h>
#include <qthread.h> #include <tqthread.h>
#include <qmutex.h> #include <tqmutex.h>
#include <kopetechatsession.h> #include <kopetechatsession.h>
@ -40,47 +40,47 @@ extern "C" {
#include <libotr/userstate.h> #include <libotr/userstate.h>
} }
class OtrlChatInterface: public QObject class OtrlChatInterface: public TQObject
{ {
public: public:
~OtrlChatInterface(); ~OtrlChatInterface();
static OtrlChatInterface *self(); static OtrlChatInterface *self();
int decryptMessage( QString *msg, QString accountId, QString protocol, QString contactId, Kopete::ChatSession *chatSession ); int decryptMessage( TQString *msg, TQString accountId, TQString protocol, TQString contactId, Kopete::ChatSession *chatSession );
QString encryptMessage( QString msg, QString accountId, TQString encryptMessage( TQString msg, TQString accountId,
QString protocol, QString contactId , Kopete::ChatSession *chatSession ); TQString protocol, TQString contactId , Kopete::ChatSession *chatSession );
QString getDefaultQuery( QString accountId ); TQString getDefaultQuery( TQString accountId );
void disconnectSession( Kopete::ChatSession *chatSession ); void disconnectSession( Kopete::ChatSession *chatSession );
void setPolicy( OtrlPolicy policy ); void setPolicy( OtrlPolicy policy );
bool shouldDiscard( QString message ); bool shouldDiscard( TQString message );
OtrlUserState getUserstate(); OtrlUserState getUserstate();
int privState( Kopete::ChatSession *session ); int privState( Kopete::ChatSession *session );
QString formatContact(QString contactId); TQString formatContact(TQString contactId);
bool isVerified( Kopete::ChatSession *session ); bool isVerified( Kopete::ChatSession *session );
void updateKeyfile( Kopete::Account *account ); void updateKeyfile( Kopete::Account *account );
void checkFilePermissions( QString file ); void checkFilePermissions( TQString file );
// bool verifyQuestion( Kopete::ChatSession *session, QString fingerprint ); // bool verifyQuestion( Kopete::ChatSession *session, TQString fingerprint );
QString findActiveFingerprint( Kopete::ChatSession *session ); TQString findActiveFingerprint( Kopete::ChatSession *session );
void verifyFingerprint( Kopete::ChatSession *session ); void verifyFingerprint( Kopete::ChatSession *session );
void abortSMP( ConnContext *context, Kopete::ChatSession *session ); void abortSMP( ConnContext *context, Kopete::ChatSession *session );
void respondSMP( ConnContext *context, Kopete::ChatSession *session, QString secret, bool initiate ); void respondSMP( ConnContext *context, Kopete::ChatSession *session, TQString secret, bool initiate );
void setTrust( Kopete::ChatSession *session, bool trust ); void setTrust( Kopete::ChatSession *session, bool trust );
private: private:
OtrlChatInterface(); OtrlChatInterface();
static OtrlChatInterface *mSelf; static OtrlChatInterface *mSelf;
Fingerprint *findFingerprint( QString username ); Fingerprint *findFingerprint( TQString username );
}; };
class KeyGenThread : public QThread { class KeyGenThread : public TQThread {
private: private:
QString accountname; TQString accountname;
QString protocol; TQString protocol;
public: public:
KeyGenThread( QString accountname, QString protocol ); KeyGenThread( TQString accountname, TQString protocol );
virtual void run(); virtual void run();
}; };

@ -23,8 +23,8 @@
* @author Michael Zanetti * @author Michael Zanetti
*/ */
#include <qapplication.h> #include <tqapplication.h>
#include <qeventloop.h> #include <tqeventloop.h>
#include <kopetechatsession.h> #include <kopetechatsession.h>
#include <kopeteaccount.h> #include <kopeteaccount.h>
@ -45,7 +45,7 @@
/*********************** Konstruktor/Destruktor **********************/ /*********************** Konstruktor/Destruktor **********************/
OtrlConfInterface::OtrlConfInterface( QWidget *preferencesDialog ){ OtrlConfInterface::OtrlConfInterface( TQWidget *preferencesDialog ){
this->preferencesDialog = preferencesDialog; this->preferencesDialog = preferencesDialog;
@ -62,8 +62,8 @@ OtrlConfInterface::~ OtrlConfInterface(){
/*********************** Functions for kcm module ************************/ /*********************** Functions for kcm module ************************/
QString OtrlConfInterface::getPrivFingerprint( QString accountId, QString protocol){ TQString OtrlConfInterface::getPrivFingerprint( TQString accountId, TQString protocol){
// if (otrl_privkey_read(userstate, QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey" ) == 0){ // if (otrl_privkey_read(userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey" ) == 0){
char fingerprint[45]; char fingerprint[45];
if( otrl_privkey_fingerprint( userstate, fingerprint, accountId.latin1(), protocol.latin1()) != 0 ){ if( otrl_privkey_fingerprint( userstate, fingerprint, accountId.latin1(), protocol.latin1()) != 0 ){
return fingerprint; return fingerprint;
@ -73,7 +73,7 @@ QString OtrlConfInterface::getPrivFingerprint( QString accountId, QString protoc
} }
bool OtrlConfInterface::hasPrivFingerprint( QString accountId, QString protocol ){ bool OtrlConfInterface::hasPrivFingerprint( TQString accountId, TQString protocol ){
char fingerprint[45]; char fingerprint[45];
if( otrl_privkey_fingerprint( userstate, fingerprint, accountId.latin1(), protocol.latin1() ) != 0 ){ if( otrl_privkey_fingerprint( userstate, fingerprint, accountId.latin1(), protocol.latin1() ) != 0 ){
return true; return true;
@ -82,8 +82,8 @@ bool OtrlConfInterface::hasPrivFingerprint( QString accountId, QString protocol
} }
void OtrlConfInterface::generateNewPrivKey( QString accountId, QString protocol ){ void OtrlConfInterface::generateNewPrivKey( TQString accountId, TQString protocol ){
PrivKeyPopup *popup = new PrivKeyPopup( preferencesDialog, i18n("Generating private key"), Qt::WStyle_Dialog | Qt::WStyle_StaysOnTop ); PrivKeyPopup *popup = new PrivKeyPopup( preferencesDialog, i18n("Generating private key"), TQt::WStyle_Dialog | TQt::WStyle_StaysOnTop );
KAnimWidget *anim = new KAnimWidget( "kde", 72, popup->animFrame, "kopete" ); KAnimWidget *anim = new KAnimWidget( "kde", 72, popup->animFrame, "kopete" );
anim->start(); anim->start();
anim->show(); anim->show();
@ -93,18 +93,18 @@ void OtrlConfInterface::generateNewPrivKey( QString accountId, QString protocol
KeyGenThread *keyGenThread = new KeyGenThread ( accountId, protocol ); KeyGenThread *keyGenThread = new KeyGenThread ( accountId, protocol );
keyGenThread->start(); keyGenThread->start();
while( !keyGenThread->wait(100) ){ while( !keyGenThread->wait(100) ){
qApp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers, 100); tqApp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers, 100);
} }
popup->setCloseLock( false ); popup->setCloseLock( false );
popup->close(); popup->close();
} }
QValueList<QString[5]> OtrlConfInterface::readAllFingerprints(){ TQValueList<TQString[5]> OtrlConfInterface::readAllFingerprints(){
ConnContext *context; ConnContext *context;
Fingerprint *fingerprint; Fingerprint *fingerprint;
QString entry[5]; TQString entry[5];
char hash[45]; char hash[45];
QValueList<QString[5]> list; TQValueList<TQString[5]> list;
for( context = userstate->context_root; context != NULL; context = context->next ){ for( context = userstate->context_root; context != NULL; context = context->next ){
fingerprint = context->fingerprint_root.next; fingerprint = context->fingerprint_root.next;
@ -137,7 +137,7 @@ QValueList<QString[5]> OtrlConfInterface::readAllFingerprints(){
return list; return list;
} }
void OtrlConfInterface::verifyFingerprint( QString strFingerprint, bool trust ){ void OtrlConfInterface::verifyFingerprint( TQString strFingerprint, bool trust ){
Fingerprint *fingerprint; Fingerprint *fingerprint;
fingerprint = findFingerprint( strFingerprint ); fingerprint = findFingerprint( strFingerprint );
@ -149,13 +149,13 @@ void OtrlConfInterface::verifyFingerprint( QString strFingerprint, bool trust ){
otrl_context_set_trust( fingerprint, NULL ); otrl_context_set_trust( fingerprint, NULL );
} }
kdDebug() << "Writing fingerprints" << endl; kdDebug() << "Writing fingerprints" << endl;
otrl_privkey_write_fingerprints( userstate, QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); otrl_privkey_write_fingerprints( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" );
} else { } else {
kdDebug() << "could not find fingerprint" << endl; kdDebug() << "could not find fingerprint" << endl;
} }
} }
bool OtrlConfInterface::isVerified( QString strFingerprint ){ bool OtrlConfInterface::isVerified( TQString strFingerprint ){
Fingerprint *fingerprint; Fingerprint *fingerprint;
fingerprint = findFingerprint( strFingerprint ); fingerprint = findFingerprint( strFingerprint );
@ -170,15 +170,15 @@ bool OtrlConfInterface::isVerified( QString strFingerprint ){
} }
void OtrlConfInterface::forgetFingerprint( QString strFingerprint ){ void OtrlConfInterface::forgetFingerprint( TQString strFingerprint ){
Fingerprint *fingerprint; Fingerprint *fingerprint;
fingerprint = findFingerprint( strFingerprint ); fingerprint = findFingerprint( strFingerprint );
otrl_context_forget_fingerprint( fingerprint, 1 ); otrl_context_forget_fingerprint( fingerprint, 1 );
otrl_privkey_write_fingerprints( userstate, QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); otrl_privkey_write_fingerprints( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" );
} }
Fingerprint *OtrlConfInterface::findFingerprint( QString strFingerprint ){ Fingerprint *OtrlConfInterface::findFingerprint( TQString strFingerprint ){
// const char *cFingerprint = ; // const char *cFingerprint = ;
// Fingerprint *fingerprintRoot = &userstate->context_root->fingerprint_root; // Fingerprint *fingerprintRoot = &userstate->context_root->fingerprint_root;
ConnContext *context; ConnContext *context;
@ -199,7 +199,7 @@ Fingerprint *OtrlConfInterface::findFingerprint( QString strFingerprint ){
return foundFingerprint; return foundFingerprint;
} }
bool OtrlConfInterface::isEncrypted( QString strFingerprint ){ bool OtrlConfInterface::isEncrypted( TQString strFingerprint ){
Fingerprint *fingerprint; Fingerprint *fingerprint;
Fingerprint *tmpFingerprint; Fingerprint *tmpFingerprint;
Fingerprint *foundFingerprint; Fingerprint *foundFingerprint;

@ -25,10 +25,10 @@
* @author Michael Zanetti * @author Michael Zanetti
*/ */
#include <qstring.h> #include <tqstring.h>
#include <qptrlist.h> #include <tqptrlist.h>
#include <qvaluelist.h> #include <tqvaluelist.h>
#include <qthread.h> #include <tqthread.h>
#include <kopetechatsession.h> #include <kopetechatsession.h>
@ -45,22 +45,22 @@ class OtrlConfInterface
public: public:
~OtrlConfInterface(); ~OtrlConfInterface();
OtrlConfInterface( QWidget *preferencesDialog ); OtrlConfInterface( TQWidget *preferencesDialog );
QString getPrivFingerprint( QString accountId, QString protocol ); TQString getPrivFingerprint( TQString accountId, TQString protocol );
void generateNewPrivKey( QString accountId, QString protocol ); void generateNewPrivKey( TQString accountId, TQString protocol );
QValueList<QString[5]> readAllFingerprints(); TQValueList<TQString[5]> readAllFingerprints();
bool hasPrivFingerprint( QString accountId, QString protocol); bool hasPrivFingerprint( TQString accountId, TQString protocol);
void forgetFingerprint( QString strFingerprint ); void forgetFingerprint( TQString strFingerprint );
void verifyFingerprint( QString strFingerprint, bool trust ); void verifyFingerprint( TQString strFingerprint, bool trust );
bool isVerified( QString strFingerprint ); bool isVerified( TQString strFingerprint );
bool isEncrypted( QString strFingerprint ); bool isEncrypted( TQString strFingerprint );
private: private:
OtrlUserState userstate; OtrlUserState userstate;
QWidget *preferencesDialog; TQWidget *preferencesDialog;
Fingerprint *findFingerprint( QString strFingerprint ); Fingerprint *findFingerprint( TQString strFingerprint );
}; };
#endif #endif

@ -18,11 +18,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qstylesheet.h> #include <tqstylesheet.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qregexp.h> #include <tqregexp.h>
#include <qfile.h> #include <tqfile.h>
#include <qcolor.h> #include <tqcolor.h>
#include <kdebug.h> #include <kdebug.h>
#include <kaction.h> #include <kaction.h>
@ -62,22 +62,22 @@ typedef KGenericFactory<OTRPlugin> OTRPluginFactory;
static const KAboutData aboutdata("kopete_otr", I18N_NOOP("OTR") , "0.7" ); static const KAboutData aboutdata("kopete_otr", I18N_NOOP("OTR") , "0.7" );
K_EXPORT_COMPONENT_FACTORY( kopete_otr, OTRPluginFactory( &aboutdata ) ) K_EXPORT_COMPONENT_FACTORY( kopete_otr, OTRPluginFactory( &aboutdata ) )
OTRPlugin::OTRPlugin( QObject *parent, const char *name, const QStringList & /* args */ ) OTRPlugin::OTRPlugin( TQObject *tqparent, const char *name, const TQStringList & /* args */ )
: Kopete::Plugin( OTRPluginFactory::instance(), parent, name ) : Kopete::Plugin( OTRPluginFactory::instance(), tqparent, name )
{ {
if( !pluginStatic_ ) if( !pluginStatic_ )
pluginStatic_=this; pluginStatic_=this;
m_inboundHandler = new OtrMessageHandlerFactory(this); m_inboundHandler = new OtrMessageHandlerFactory(this);
connect( Kopete::ChatSessionManager::self(), SIGNAL( aboutToSend( Kopete::Message & ) ), connect( Kopete::ChatSessionManager::self(), TQT_SIGNAL( aboutToSend( Kopete::Message & ) ),
SLOT( slotOutgoingMessage( Kopete::Message & ) ) ); TQT_SLOT( slotOutgoingMessage( Kopete::Message & ) ) );
// connect( Kopete::ChatSessionManager::self(), SIGNAL( aboutToDisplay( Kopete::Message & ) ), // connect( Kopete::ChatSessionManager::self(), TQT_SIGNAL( aboutToDisplay( Kopete::Message & ) ),
// this, SLOT( slotIncomingMessage( Kopete::Message & ) ) ); // this, TQT_SLOT( slotIncomingMessage( Kopete::Message & ) ) );
connect( Kopete::ChatSessionManager::self(), SIGNAL( chatSessionCreated( Kopete::ChatSession * ) ), connect( Kopete::ChatSessionManager::self(), TQT_SIGNAL( chatSessionCreated( Kopete::ChatSession * ) ),
this, SLOT( slotNewChatSessionWindow( Kopete::ChatSession * ) ) ); this, TQT_SLOT( slotNewChatSessionWindow( Kopete::ChatSession * ) ) );
QObject::connect( this, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) ); TQObject::connect( this, TQT_SIGNAL( settingsChanged() ), this, TQT_SLOT( slotSettingsChanged() ) );
@ -85,25 +85,25 @@ OTRPlugin::OTRPlugin( QObject *parent, const char *name, const QStringList & /*
otrlChatInterface = OtrlChatInterface::self(); otrlChatInterface = OtrlChatInterface::self();
//update key files when an account is ready to use //update key files when an account is ready to use
if( QFile::exists( QString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkey" ) && if( TQFile::exists( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkey" ) &&
!QFile::exists( QString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkeys" ) ){ !TQFile::exists( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkeys" ) ){
kdDebug() << "Detected old format keyfile. Doing updates!" << endl; kdDebug() << "Detected old format keyfile. Doing updates!" << endl;
kdDebug() << "Reading old keyfile..." << endl; kdDebug() << "Reading old keyfile..." << endl;
QFile fpold( QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey" ); TQFile fpold( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey" );
QString line; TQString line;
QString file; TQString file;
if( fpold.open( IO_ReadWrite ) ){ if( fpold.open( IO_ReadWrite ) ){
while( fpold.readLine( line, 100 ) != -1){ while( fpold.readLine( line, 100 ) != -1){
file.append( line ); file.append( line );
} }
} }
kdDebug() << "Writing new keyfile" << endl; kdDebug() << "Writing new keyfile" << endl;
QFile fpnew( QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); TQFile fpnew( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" );
fpnew.open( IO_ReadWrite ); fpnew.open( IO_ReadWrite );
fpnew.writeBlock( file.latin1(), file.length() ); fpnew.writeBlock( file.latin1(), file.length() );
fpnew.close(); fpnew.close();
kdDebug() << "Writing backup for old keyfile" << endl; kdDebug() << "Writing backup for old keyfile" << endl;
QFile fpbup( QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey.old" ); TQFile fpbup( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey.old" );
fpbup.open( IO_ReadWrite ); fpbup.open( IO_ReadWrite );
fpbup.writeBlock( file.latin1(), file.length() ); fpbup.writeBlock( file.latin1(), file.length() );
fpbup.close(); fpbup.close();
@ -111,7 +111,7 @@ OTRPlugin::OTRPlugin( QObject *parent, const char *name, const QStringList & /*
fpold.remove(); fpold.remove();
kdDebug() << "Reading old fingerprintsfile..." << endl; kdDebug() << "Reading old fingerprintsfile..." << endl;
QFile fpfingerprintsold( QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); TQFile fpfingerprintsold( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" );
line = ""; line = "";
file = ""; file = "";
if( fpfingerprintsold.open( IO_ReadWrite ) ){ if( fpfingerprintsold.open( IO_ReadWrite ) ){
@ -120,35 +120,35 @@ OTRPlugin::OTRPlugin( QObject *parent, const char *name, const QStringList & /*
} }
} }
kdDebug() << "Writing backup for old fingerprintsfile" << endl; kdDebug() << "Writing backup for old fingerprintsfile" << endl;
QFile fpfingerprintsbup( QString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints.old" ); TQFile fpfingerprintsbup( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints.old" );
fpfingerprintsbup.open( IO_ReadWrite ); fpfingerprintsbup.open( IO_ReadWrite );
fpfingerprintsbup.writeBlock( file.latin1(), file.length() ); fpfingerprintsbup.writeBlock( file.latin1(), file.length() );
fpfingerprintsbup.close(); fpfingerprintsbup.close();
kdDebug() << "Waiting for accounts to update keyfile format" << endl; kdDebug() << "Waiting for accounts to update keyfile format" << endl;
connect( Kopete::AccountManager::self(), SIGNAL( accountRegistered( Kopete::Account * ) ), connect( Kopete::AccountManager::self(), TQT_SIGNAL( accountRegistered( Kopete::Account * ) ),
this, SLOT( accountReady( Kopete::Account * ) ) ); this, TQT_SLOT( accountReady( Kopete::Account * ) ) );
} }
// Checking file Permissions // Checking file Permissions
OtrlChatInterface::self()->checkFilePermissions( QString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkeys" ); OtrlChatInterface::self()->checkFilePermissions( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkeys" );
OtrlChatInterface::self()->checkFilePermissions( QString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "fingerprints" ); OtrlChatInterface::self()->checkFilePermissions( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "fingerprints" );
// Check also file permissions for eventuallly old beckup files // Check also file permissions for eventuallly old beckup files
OtrlChatInterface::self()->checkFilePermissions( QString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkey.old" ); OtrlChatInterface::self()->checkFilePermissions( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkey.old" );
OtrlChatInterface::self()->checkFilePermissions( QString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "fingerprints.old" ); OtrlChatInterface::self()->checkFilePermissions( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "fingerprints.old" );
//setting the policy //setting the policy
slotSettingsChanged(); slotSettingsChanged();
//adding menu to contaclists menubar and contacts popup menu //adding menu to contaclists menubar and contacts popup menu
QStringList policies; TQStringList policies;
policies << i18n("&Default") << i18n("Al&ways") << i18n("&Opportunistic") << i18n("&Manual") << i18n("Ne&ver"); policies << i18n("&Default") << i18n("Al&ways") << i18n("&Opportunistic") << i18n("&Manual") << i18n("Ne&ver");
otrPolicyMenu = new KSelectAction( i18n( "&OTR Policy" ), QString::fromLatin1("kopete_otr"), 0, actionCollection(), "otr_policy" ); otrPolicyMenu = new KSelectAction( i18n( "&OTR Policy" ), TQString::tqfromLatin1("kopete_otr"), 0, actionCollection(), "otr_policy" );
otrPolicyMenu->setItems( policies ); otrPolicyMenu->setItems( policies );
otrPolicyMenu->popupMenu()->insertSeparator( 1 ); otrPolicyMenu->popupMenu()->insertSeparator( 1 );
otrPolicyMenu->setEnabled( false ); otrPolicyMenu->setEnabled( false );
connect( otrPolicyMenu, SIGNAL( activated() ), this, SLOT( slotSetPolicy() ) ); connect( otrPolicyMenu, TQT_SIGNAL( activated() ), this, TQT_SLOT( slotSetPolicy() ) );
connect( Kopete::ContactList::self(), SIGNAL( metaContactSelected( bool ) ), this, SLOT( slotSelectionChanged( bool ) ) ); connect( Kopete::ContactList::self(), TQT_SIGNAL( metaContactSelected( bool ) ), this, TQT_SLOT( slotSelectionChanged( bool ) ) );
setXMLFile( "otrui.rc" ); setXMLFile( "otrui.rc" );
@ -157,9 +157,9 @@ OTRPlugin::OTRPlugin( QObject *parent, const char *name, const QStringList & /*
//Add GUI action to all already existing kmm //Add GUI action to all already existing kmm
// (if the plugin is launched when kopete already runing) // (if the plugin is launched when kopete already runing)
QValueList<Kopete::ChatSession*> sessions = TQValueList<Kopete::ChatSession*> sessions =
Kopete::ChatSessionManager::self()->sessions(); Kopete::ChatSessionManager::self()->sessions();
QValueListIterator<Kopete::ChatSession*> it; TQValueListIterator<Kopete::ChatSession*> it;
for (it= sessions.begin(); it!=sessions.end() ; ++it){ for (it= sessions.begin(); it!=sessions.end() ; ++it){
slotNewChatSessionWindow( *it ); slotNewChatSessionWindow( *it );
} }
@ -196,11 +196,11 @@ void OTRPlugin::slotNewChatSessionWindow( Kopete::ChatSession *KMM )
void OTRPlugin::slotOutgoingMessage( Kopete::Message& msg ) void OTRPlugin::slotOutgoingMessage( Kopete::Message& msg )
{ {
if( msg.direction() == Kopete::Message::Outbound ){ if( msg.direction() == Kopete::Message::Outbound ){
QString plainBody = msg.plainBody(); TQString plainBody = msg.plainBody();
QString accountId = msg.manager()->account()->accountId(); TQString accountId = msg.manager()->account()->accountId();
Kopete::Contact *contact = msg.to().first(); Kopete::Contact *contact = msg.to().first();
QString encBody = otrlChatInterface->encryptMessage( plainBody, accountId, msg.manager()->account()->protocol()->displayName(), contact->contactId(), msg.manager() ); TQString encBody = otrlChatInterface->encryptMessage( plainBody, accountId, msg.manager()->account()->protocol()->displayName(), contact->contactId(), msg.manager() );
msg.setBody( encBody, Kopete::Message::Crypted ); msg.setBody( encBody, Kopete::Message::Crypted );
if( !msg.plainBody().isEmpty() ){ if( !msg.plainBody().isEmpty() ){
messageCache.insert( encBody, plainBody ); messageCache.insert( encBody, plainBody );
@ -212,19 +212,19 @@ void OTRPlugin::slotEnableOtr( Kopete::ChatSession *session, bool enable ){
if( enable ){ if( enable ){
QString policy = session->members().getFirst()->metaContact()->pluginData( OTRPlugin::plugin(), "otr_policy" ); TQString policy = session->members().getFirst()->metaContact()->pluginData( OTRPlugin::plugin(), "otr_policy" );
bool noerr; bool noerr;
KopeteOtrKcfg::self()->readConfig(); KopeteOtrKcfg::self()->readConfig();
if( policy.toInt( &noerr, 10 ) == 4 || ( policy.toInt( &noerr, 10 ) == 0 && KopeteOtrKcfg::self()->rbNever() ) ){ if( policy.toInt( &noerr, 10 ) == 4 || ( policy.toInt( &noerr, 10 ) == 0 && KopeteOtrKcfg::self()->rbNever() ) ){
Kopete::Message msg( session->account()->myself(), session->members(), i18n( "Your policy settings do not allow encrypted sessions to this contact." ), Kopete::Message::Internal, Kopete::Message::RichText ); Kopete::Message msg( session->account()->myself(), session->members(), i18n( "Your policy settings do not allow encrypted sessions to this contact." ), Kopete::Message::Internal, Kopete::Message::RichText );
session->appendMessage( msg ); session->appendMessage( msg );
} else { } else {
QString body = otrlChatInterface->getDefaultQuery( session->account()->accountId() ); TQString body = otrlChatInterface->getDefaultQuery( session->account()->accountId() );
Kopete::Message msg1( session->account()->myself(), session->members().getFirst(), QString( body ), Kopete::Message::Outbound ); Kopete::Message msg1( session->account()->myself(), session->members().getFirst(), TQString( body ), Kopete::Message::Outbound );
if( otrlChatInterface->privState( session ) > 0 ){ if( otrlChatInterface->privState( session ) > 0 ){
body = i18n("Attempting to refresh the OTR session with <b>%1</b>...").arg( otrlChatInterface->formatContact( session->members().getFirst()->contactId() ) ); body = i18n("Attempting to refresh the OTR session with <b>%1</b>...").tqarg( otrlChatInterface->formatContact( session->members().getFirst()->contactId() ) );
} else { } else {
body = i18n("Attempting to start a private OTR session with <b>%1</b>...").arg( otrlChatInterface->formatContact( session->members().getFirst()->contactId() ) ); body = i18n("Attempting to start a private OTR session with <b>%1</b>...").tqarg( otrlChatInterface->formatContact( session->members().getFirst()->contactId() ) );
} }
Kopete::Message msg2( session->account()->myself(), session->members().getFirst(), body, Kopete::Message::Internal, Kopete::Message::RichText ); Kopete::Message msg2( session->account()->myself(), session->members().getFirst(), body, Kopete::Message::Internal, Kopete::Message::RichText );
@ -260,20 +260,20 @@ void OTRPlugin::emitGoneSecure( Kopete::ChatSession *session, int status){
emit goneSecure( session, status ); emit goneSecure( session, status );
} }
QMap<QString, QString> OTRPlugin::getMessageCache(){ TQMap<TQString, TQString> OTRPlugin::getMessageCache(){
return messageCache; return messageCache;
} }
void OtrMessageHandler::handleMessage( Kopete::MessageEvent *event ){ void OtrMessageHandler::handleMessage( Kopete::MessageEvent *event ){
Kopete::Message msg = event->message(); Kopete::Message msg = event->message();
Kopete::ChatSession *session = msg.manager(); Kopete::ChatSession *session = msg.manager();
QMap<QString, QString> messageCache = OTRPlugin::plugin()->getMessageCache(); TQMap<TQString, TQString> messageCache = OTRPlugin::plugin()->getMessageCache();
if( msg.direction() == Kopete::Message::Inbound ){ if( msg.direction() == Kopete::Message::Inbound ){
QString body = msg.parsedBody(); TQString body = msg.parsedBody();
kdDebug() << "Received Message: " << msg.parsedBody() << endl; kdDebug() << "Received Message: " << msg.parsedBody() << endl;
QString accountId = msg.manager()->account()->accountId(); TQString accountId = msg.manager()->account()->accountId();
QString contactId = msg.from()->contactId(); TQString contactId = msg.from()->contactId();
int ignoremessage = OtrlChatInterface::self()->decryptMessage( &body, accountId, msg.manager()->account()->protocol()->displayName(), contactId, msg.manager() ); int ignoremessage = OtrlChatInterface::self()->decryptMessage( &body, accountId, msg.manager()->account()->protocol()->displayName(), contactId, msg.manager() );
msg.setBody( body, Kopete::Message::RichText ); msg.setBody( body, Kopete::Message::RichText );
if( ignoremessage | OtrlChatInterface::self()->shouldDiscard( msg.plainBody() ) ){ if( ignoremessage | OtrlChatInterface::self()->shouldDiscard( msg.plainBody() ) ){
@ -281,7 +281,7 @@ kdDebug() << "Received Message: " << msg.parsedBody() << endl;
return; return;
} }
} else if( msg.direction() == Kopete::Message::Outbound ){ } else if( msg.direction() == Kopete::Message::Outbound ){
if( messageCache.contains( msg.plainBody() ) ){ if( messageCache.tqcontains( msg.plainBody() ) ){
msg.setBody( messageCache[msg.plainBody()] ); msg.setBody( messageCache[msg.plainBody()] );
messageCache.remove( messageCache[msg.plainBody()] ); messageCache.remove( messageCache[msg.plainBody()] );
if(messageCache.count() > 5) messageCache.clear(); if(messageCache.count() > 5) messageCache.clear();
@ -314,7 +314,7 @@ void OTRPlugin::slotSelectionChanged( bool single){
Kopete::MetaContact *metaContact = Kopete::ContactList::self()->selectedMetaContacts().first(); Kopete::MetaContact *metaContact = Kopete::ContactList::self()->selectedMetaContacts().first();
QString policy = metaContact->pluginData( this, "otr_policy" ); TQString policy = metaContact->pluginData( this, "otr_policy" );
bool noerr; bool noerr;
if ( !policy.isEmpty() && policy != "null" ) if ( !policy.isEmpty() && policy != "null" )
@ -328,7 +328,7 @@ void OTRPlugin::slotSetPolicy(){
kdDebug() << "Setting contact policy" << endl; kdDebug() << "Setting contact policy" << endl;
Kopete::MetaContact *metaContact = Kopete::ContactList::self()->selectedMetaContacts().first(); Kopete::MetaContact *metaContact = Kopete::ContactList::self()->selectedMetaContacts().first();
if( metaContact ){ if( metaContact ){
metaContact->setPluginData( this, "otr_policy", QString::number( otrPolicyMenu->currentItem() ) ); metaContact->setPluginData( this, "otr_policy", TQString::number( otrPolicyMenu->currentItem() ) );
} }
} }

@ -68,16 +68,17 @@ public:
class OTRPlugin : public Kopete::Plugin class OTRPlugin : public Kopete::Plugin
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
static OTRPlugin *plugin(); static OTRPlugin *plugin();
OTRPlugin( QObject *parent, const char *name, const QStringList &args ); OTRPlugin( TQObject *tqparent, const char *name, const TQStringList &args );
~OTRPlugin(); ~OTRPlugin();
void emitGoneSecure( Kopete::ChatSession *session, int status ); void emitGoneSecure( Kopete::ChatSession *session, int status );
QMap<QString, QString> getMessageCache(); TQMap<TQString, TQString> getMessageCache();
public slots: public slots:
@ -96,7 +97,7 @@ private:
static OTRPlugin* pluginStatic_; static OTRPlugin* pluginStatic_;
OtrMessageHandlerFactory *m_inboundHandler; OtrMessageHandlerFactory *m_inboundHandler;
OtrlChatInterface *otrlChatInterface; OtrlChatInterface *otrlChatInterface;
QMap<QString, QString> messageCache; TQMap<TQString, TQString> messageCache;
KSelectAction* otrPolicyMenu; KSelectAction* otrPolicyMenu;
/* KActionMenu *otrPolicyMenuBar; /* KActionMenu *otrPolicyMenuBar;

@ -18,17 +18,17 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include <qlayout.h> #include <tqlayout.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qmap.h> #include <tqmap.h>
#include <qptrlist.h> #include <tqptrlist.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qtable.h> #include <tqtable.h>
#include <qpaintdevicemetrics.h> #include <tqpaintdevicemetrics.h>
#include <qvbox.h> #include <tqvbox.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
#include <qtabwidget.h> #include <tqtabwidget.h>
#include <kgenericfactory.h> #include <kgenericfactory.h>
#include <kurlrequester.h> #include <kurlrequester.h>
@ -57,10 +57,10 @@
typedef KGenericFactory<OTRPreferences> OTRPreferencesFactory; typedef KGenericFactory<OTRPreferences> OTRPreferencesFactory;
K_EXPORT_COMPONENT_FACTORY( kcm_kopete_otr, OTRPreferencesFactory("kcm_kopete_otr")) K_EXPORT_COMPONENT_FACTORY( kcm_kopete_otr, OTRPreferencesFactory("kcm_kopete_otr"))
OTRPreferences::OTRPreferences(QWidget *parent, const char* /*name*/, const QStringList &args) OTRPreferences::OTRPreferences(TQWidget *tqparent, const char* /*name*/, const TQStringList &args)
: KCModule(OTRPreferencesFactory::instance(), parent, args) : KCModule(OTRPreferencesFactory::instance(), tqparent, args)
{ {
( new QVBoxLayout( this ) )->setAutoAdd( true ); ( new TQVBoxLayout( this ) )->setAutoAdd( true );
preferencesDialog = new OTRPrefsUI(this); preferencesDialog = new OTRPrefsUI(this);
@ -72,18 +72,18 @@ OTRPreferences::OTRPreferences(QWidget *parent, const char* /*name*/, const QStr
otrlConfInterface = new OtrlConfInterface( preferencesDialog ); otrlConfInterface = new OtrlConfInterface( preferencesDialog );
connect( preferencesDialog->btGenFingerprint, SIGNAL(clicked()), SLOT(generateFingerprint())); connect( preferencesDialog->btGenFingerprint, TQT_SIGNAL(clicked()), TQT_SLOT(generateFingerprint()));
connect( preferencesDialog->cbKeys, SIGNAL(activated(int)), SLOT(showPrivFingerprint(int))); connect( preferencesDialog->cbKeys, TQT_SIGNAL(activated(int)), TQT_SLOT(showPrivFingerprint(int)));
connect( preferencesDialog->btVerify, SIGNAL(clicked()), SLOT(verifyFingerprint())); connect( preferencesDialog->btVerify, TQT_SIGNAL(clicked()), TQT_SLOT(verifyFingerprint()));
connect( preferencesDialog->twSettings, SIGNAL(currentChanged(QWidget *)), SLOT(fillFingerprints())); connect( preferencesDialog->twSettings, TQT_SIGNAL(currentChanged(TQWidget *)), TQT_SLOT(fillFingerprints()));
connect( preferencesDialog->tbFingerprints, SIGNAL(currentChanged(int, int)), SLOT(updateButtons(int, int))); connect( preferencesDialog->tbFingerprints, TQT_SIGNAL(currentChanged(int, int)), TQT_SLOT(updateButtons(int, int)));
connect( preferencesDialog->btForget, SIGNAL( clicked() ), SLOT( forgetFingerprint() ) ); connect( preferencesDialog->btForget, TQT_SIGNAL( clicked() ), TQT_SLOT( forgetFingerprint() ) );
int index = 0; int index = 0;
int accountnr = 0; int accountnr = 0;
QPtrList<Kopete::Account> accounts = Kopete::AccountManager::self()->accounts(); TQPtrList<Kopete::Account> accounts = Kopete::AccountManager::self()->accounts();
if( !accounts.isEmpty() ){ if( !accounts.isEmpty() ){
for ( QPtrListIterator<Kopete::Account> it( accounts ); for ( TQPtrListIterator<Kopete::Account> it( accounts );
Kopete::Account *account = it.current(); Kopete::Account *account = it.current();
++it ){ ++it ){
if ( account->protocol()->pluginId() != "IRCProtocol" ){ if ( account->protocol()->pluginId() != "IRCProtocol" ){
@ -108,7 +108,7 @@ OTRPreferences::~OTRPreferences(){
void OTRPreferences::generateFingerprint() void OTRPreferences::generateFingerprint()
{ {
QPtrList<Kopete::Account> accounts = Kopete::AccountManager::self()->accounts(); TQPtrList<Kopete::Account> accounts = Kopete::AccountManager::self()->accounts();
if( (accounts.isEmpty())){ if( (accounts.isEmpty())){
return; return;
@ -125,7 +125,7 @@ void OTRPreferences::generateFingerprint()
void OTRPreferences::showPrivFingerprint( int accountnr ) void OTRPreferences::showPrivFingerprint( int accountnr )
{ {
QPtrList<Kopete::Account> accounts = Kopete::AccountManager::self()->accounts(); TQPtrList<Kopete::Account> accounts = Kopete::AccountManager::self()->accounts();
if( !accounts.isEmpty() ){ if( !accounts.isEmpty() ){
Kopete::Account *account = accounts.at(privKeys[accountnr]); Kopete::Account *account = accounts.at(privKeys[accountnr]);
preferencesDialog->tlFingerprint->setText( otrlConfInterface->getPrivFingerprint( account->accountId(), account->protocol()->displayName() ) ); preferencesDialog->tlFingerprint->setText( otrlConfInterface->getPrivFingerprint( account->accountId(), account->protocol()->displayName() ) );
@ -133,17 +133,17 @@ void OTRPreferences::showPrivFingerprint( int accountnr )
} }
void OTRPreferences::fillFingerprints(){ void OTRPreferences::fillFingerprints(){
QTable *fingerprintsTable = preferencesDialog->tbFingerprints; TQTable *fingerprintsTable = preferencesDialog->tbFingerprints;
preferencesDialog->tbFingerprints->setNumRows(0); preferencesDialog->tbFingerprints->setNumRows(0);
QValueList<QString[5]> list = otrlConfInterface->readAllFingerprints(); TQValueList<TQString[5]> list = otrlConfInterface->readAllFingerprints();
QValueList<QString[5]>::iterator it; TQValueList<TQString[5]>::iterator it;
int j = 0; int j = 0;
for( it = list.begin(); it != list.end(); ++it ){ for( it = list.begin(); it != list.end(); ++it ){
preferencesDialog->tbFingerprints->setNumRows( preferencesDialog->tbFingerprints->numRows() +1 ); preferencesDialog->tbFingerprints->setNumRows( preferencesDialog->tbFingerprints->numRows() +1 );
(*it)[0] = OtrlChatInterface::self()->formatContact((*it)[0]); (*it)[0] = OtrlChatInterface::self()->formatContact((*it)[0]);
for( int i = 0; i < 5; i++ ){ for( int i = 0; i < 5; i++ ){
//preferencesDialog->tbFingerprints->setText(j, i, (*it)[i] ); //preferencesDialog->tbFingerprints->setText(j, i, (*it)[i] );
fingerprintsTable->setItem(j,i, new QAlignTableItem(fingerprintsTable, QTableItem::Never,(*it)[i],Qt::AlignLeft)); fingerprintsTable->setItem(j,i, new TQAlignTableItem(fingerprintsTable, TQTableItem::Never,(*it)[i],TQt::AlignLeft));
} }
j++; j++;
} }
@ -154,7 +154,7 @@ void OTRPreferences::verifyFingerprint(){
int doVerify = KMessageBox::questionYesNo( int doVerify = KMessageBox::questionYesNo(
this, this,
i18n("Please contact %1 via another secure way and verify that the following Fingerprint is correct:").arg(preferencesDialog->tbFingerprints->text( preferencesDialog->tbFingerprints->currentRow(), 0 )) + "\n\n" + preferencesDialog->tbFingerprints->text( preferencesDialog->tbFingerprints->currentRow(), 3 ) + "\n\n" + i18n("Are you sure you want to trust this fingerprint?"), i18n("Verify fingerprint") ); i18n("Please contact %1 via another secure way and verify that the following Fingerprint is correct:").tqarg(preferencesDialog->tbFingerprints->text( preferencesDialog->tbFingerprints->currentRow(), 0 )) + "\n\n" + preferencesDialog->tbFingerprints->text( preferencesDialog->tbFingerprints->currentRow(), 3 ) + "\n\n" + i18n("Are you sure you want to trust this fingerprint?"), i18n("Verify fingerprint") );
if( doVerify == KMessageBox::Yes ){ if( doVerify == KMessageBox::Yes ){
@ -188,9 +188,9 @@ void OTRPreferences::forgetFingerprint(){
} }
} }
QAlignTableItem :: QAlignTableItem( QTable *table, EditType editType, const QString& text, int alignment ) TQAlignTableItem :: TQAlignTableItem( TQTable *table, EditType editType, const TQString& text, int tqalignment )
: QTableItem( table, editType, text ) { : TQTableItem( table, editType, text ) {
align = alignment; align = tqalignment;
} }

@ -31,15 +31,16 @@
class OTRPreferences : public KCModule { class OTRPreferences : public KCModule {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
OTRPreferences(QWidget *parent = 0, const char *name = 0, const QStringList &args = QStringList()); OTRPreferences(TQWidget *tqparent = 0, const char *name = 0, const TQStringList &args = TQStringList());
~OTRPreferences(); ~OTRPreferences();
private: private:
OTRPrefsUI *preferencesDialog; OTRPrefsUI *preferencesDialog;
OtrlConfInterface *otrlConfInterface; OtrlConfInterface *otrlConfInterface;
QMap<int, int> privKeys; TQMap<int, int> privKeys;
private slots: // Public slots private slots: // Public slots
void generateFingerprint(); void generateFingerprint();
@ -52,10 +53,10 @@ private slots: // Public slots
}; };
class QAlignTableItem : public QTableItem { class TQAlignTableItem : public TQTableItem {
public : public :
QAlignTableItem(QTable *table, EditType editType, const QString& text, int alignment); TQAlignTableItem(TQTable *table, EditType editType, const TQString& text, int tqalignment);
private : private :
int align; int align;

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>OTRPrefsUI</class> <class>OTRPrefsUI</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>OTRPrefsUI</cstring> <cstring>OTRPrefsUI</cstring>
</property> </property>
@ -19,11 +19,11 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QTabWidget" row="0" column="0"> <widget class="TQTabWidget" row="0" column="0">
<property name="name"> <property name="name">
<cstring>twSettings</cstring> <cstring>twSettings</cstring>
</property> </property>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>settings</cstring> <cstring>settings</cstring>
</property> </property>
@ -34,7 +34,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QGroupBox" row="0" column="0"> <widget class="TQGroupBox" row="0" column="0">
<property name="name"> <property name="name">
<cstring>groupBox1</cstring> <cstring>groupBox1</cstring>
</property> </property>
@ -45,7 +45,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QPushButton" row="0" column="2"> <widget class="TQPushButton" row="0" column="2">
<property name="name"> <property name="name">
<cstring>btGenFingerprint</cstring> <cstring>btGenFingerprint</cstring>
</property> </property>
@ -56,18 +56,18 @@
<string>Alt+G</string> <string>Alt+G</string>
</property> </property>
</widget> </widget>
<widget class="QComboBox" row="0" column="1"> <widget class="TQComboBox" row="0" column="1">
<property name="name"> <property name="name">
<cstring>cbKeys</cstring> <cstring>cbKeys</cstring>
</property> </property>
<property name="maximumSize"> <property name="tqmaximumSize">
<size> <size>
<width>400</width> <width>400</width>
<height>32767</height> <height>32767</height>
</size> </size>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="0"> <widget class="TQLabel" row="0" column="0">
<property name="name"> <property name="name">
<cstring>textLabel2</cstring> <cstring>textLabel2</cstring>
</property> </property>
@ -93,7 +93,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QButtonGroup" row="1" column="0"> <widget class="TQButtonGroup" row="1" column="0">
<property name="name"> <property name="name">
<cstring>bgPolicy</cstring> <cstring>bgPolicy</cstring>
</property> </property>
@ -104,7 +104,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton" row="1" column="0"> <widget class="TQRadioButton" row="1" column="0">
<property name="name"> <property name="name">
<cstring>kcfg_rbOpportunistic</cstring> <cstring>kcfg_rbOpportunistic</cstring>
</property> </property>
@ -118,7 +118,7 @@
<string>Encrypt messages automatically if the other side supports OTR</string> <string>Encrypt messages automatically if the other side supports OTR</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" row="1" column="1"> <widget class="TQRadioButton" row="1" column="1">
<property name="name"> <property name="name">
<cstring>kcfg_rbNever</cstring> <cstring>kcfg_rbNever</cstring>
</property> </property>
@ -132,7 +132,7 @@
<string>Never encrypt messages</string> <string>Never encrypt messages</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" row="0" column="1"> <widget class="TQRadioButton" row="0" column="1">
<property name="name"> <property name="name">
<cstring>kcfg_rbManual</cstring> <cstring>kcfg_rbManual</cstring>
</property> </property>
@ -149,7 +149,7 @@
<string>Encrypt messages if the other side requests an OTR connection</string> <string>Encrypt messages if the other side requests an OTR connection</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" row="0" column="0"> <widget class="TQRadioButton" row="0" column="0">
<property name="name"> <property name="name">
<cstring>kcfg_rbAlways</cstring> <cstring>kcfg_rbAlways</cstring>
</property> </property>
@ -181,7 +181,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>161</height> <height>161</height>
@ -190,7 +190,7 @@
</spacer> </spacer>
</grid> </grid>
</widget> </widget>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>fingerprints</cstring> <cstring>fingerprints</cstring>
</property> </property>
@ -201,7 +201,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QTable" row="0" column="0" rowspan="1" colspan="2"> <widget class="TQTable" row="0" column="0" rowspan="1" colspan="2">
<column> <column>
<property name="text"> <property name="text">
<string>User</string> <string>User</string>
@ -209,7 +209,7 @@
</column> </column>
<column> <column>
<property name="text"> <property name="text">
<string>Status</string> <string>tqStatus</string>
</property> </property>
</column> </column>
<column> <column>
@ -252,7 +252,7 @@
<enum>FollowStyle</enum> <enum>FollowStyle</enum>
</property> </property>
</widget> </widget>
<widget class="QPushButton" row="1" column="0"> <widget class="TQPushButton" row="1" column="0">
<property name="name"> <property name="name">
<cstring>btVerify</cstring> <cstring>btVerify</cstring>
</property> </property>
@ -266,7 +266,7 @@
<string>Alt+V</string> <string>Alt+V</string>
</property> </property>
</widget> </widget>
<widget class="QPushButton" row="1" column="1"> <widget class="TQPushButton" row="1" column="1">
<property name="name"> <property name="name">
<cstring>btForget</cstring> <cstring>btForget</cstring>
</property> </property>
@ -285,10 +285,10 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<slots> <Q_SLOTS>
<slot access="private">generateFingerprint()</slot> <slot access="private">generateFingerprint()</slot>
</slots> </Q_SLOTS>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
<includehints> <includehints>
<includehint>kactivelabel.h</includehint> <includehint>kactivelabel.h</includehint>
</includehints> </includehints>

@ -25,8 +25,8 @@
#include "privkeypopup.h" #include "privkeypopup.h"
PrivKeyPopup::PrivKeyPopup(QWidget* parent, const char* name, WFlags fl) PrivKeyPopup::PrivKeyPopup(TQWidget* tqparent, const char* name, WFlags fl)
: PrivKeyPopupUI(parent,name,fl) : PrivKeyPopupUI(tqparent,name,fl)
{ {
} }
@ -38,7 +38,7 @@ void PrivKeyPopup::setCloseLock( bool locked ){
closeLock = locked; closeLock = locked;
} }
void PrivKeyPopup::closeEvent( QCloseEvent *e ){ void PrivKeyPopup::closeEvent( TQCloseEvent *e ){
if( closeLock ){ if( closeLock ){
e->ignore(); e->ignore();
} else { } else {

@ -30,9 +30,10 @@
class PrivKeyPopup : public PrivKeyPopupUI class PrivKeyPopup : public PrivKeyPopupUI
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
PrivKeyPopup(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); PrivKeyPopup(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 );
~PrivKeyPopup(); ~PrivKeyPopup();
void setCloseLock( bool locked ); void setCloseLock( bool locked );
/*$PUBLIC_FUNCTIONS$*/ /*$PUBLIC_FUNCTIONS$*/
@ -44,7 +45,7 @@ protected:
/*$PROTECTED_FUNCTIONS$*/ /*$PROTECTED_FUNCTIONS$*/
bool closeLock; bool closeLock;
void closeEvent( QCloseEvent *e ); void closeEvent( TQCloseEvent *e );
protected slots: protected slots:
/*$PROTECTED_SLOTS$*/ /*$PROTECTED_SLOTS$*/

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>PrivKeyPopupUI</class> <class>PrivKeyPopupUI</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>PrivKeyPopupUI</cstring> <cstring>PrivKeyPopupUI</cstring>
</property> </property>
@ -19,7 +19,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel" row="0" column="0"> <widget class="TQLabel" row="0" column="0">
<property name="name"> <property name="name">
<cstring>tlWait</cstring> <cstring>tlWait</cstring>
</property> </property>
@ -33,7 +33,7 @@
<string>Please wait while generating the private key</string> <string>Please wait while generating the private key</string>
</property> </property>
</widget> </widget>
<widget class="QFrame" row="0" column="1"> <widget class="TQFrame" row="0" column="1">
<property name="name"> <property name="name">
<cstring>animFrame</cstring> <cstring>animFrame</cstring>
</property> </property>
@ -45,7 +45,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="tqminimumSize">
<size> <size>
<width>72</width> <width>72</width>
<height>72</height> <height>72</height>
@ -60,5 +60,5 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
</UI> </UI>

@ -18,7 +18,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#include "qlabel.h" #include "tqlabel.h"
#include "kdebug.h" #include "kdebug.h"
#include "klocale.h" #include "klocale.h"
@ -29,13 +29,13 @@
#include "smppopup.h" #include "smppopup.h"
#include "verifypopup.h" #include "verifypopup.h"
SMPPopup::SMPPopup(QWidget* parent, const char* name, WFlags fl, ConnContext *context, Kopete::ChatSession *session, bool initiate ) SMPPopup::SMPPopup(TQWidget* tqparent, const char* name, WFlags fl, ConnContext *context, Kopete::ChatSession *session, bool initiate )
: SMPPopupUI(parent,name,fl) : SMPPopupUI(tqparent,name,fl)
{ {
this->context = context; this->context = context;
this->session = session; this->session = session;
this->initiate = initiate; this->initiate = initiate;
tlText->setText( i18n("Please enter the secret passphrase to authenticate %1:").arg(OtrlChatInterface::self()->formatContact(session->members().getFirst()->contactId()))); tlText->setText( i18n("Please enter the secret passphrase to authenticate %1:").tqarg(OtrlChatInterface::self()->formatContact(session->members().getFirst()->contactId())));
} }
SMPPopup::~SMPPopup() SMPPopup::~SMPPopup()

@ -33,9 +33,10 @@ extern "C"{
class SMPPopup : public SMPPopupUI class SMPPopup : public SMPPopupUI
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
SMPPopup(QWidget* parent = 0, const char* name = 0, WFlags fl = 0, ConnContext *context = 0, Kopete::ChatSession *session = 0, bool initiate = true ); SMPPopup(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0, ConnContext *context = 0, Kopete::ChatSession *session = 0, bool initiate = true );
~SMPPopup(); ~SMPPopup();
/*$PUBLIC_FUNCTIONS$*/ /*$PUBLIC_FUNCTIONS$*/

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>SMPPopupUI</class> <class>SMPPopupUI</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>SMPPopupUI</cstring> <cstring>SMPPopupUI</cstring>
</property> </property>
@ -66,7 +66,7 @@
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>tlText</cstring> <cstring>tlText</cstring>
</property> </property>
@ -81,11 +81,11 @@
<property name="text"> <property name="text">
<string>Please enter the secret passphrase to authenticate this contact.</string> <string>Please enter the secret passphrase to authenticate this contact.</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>WordBreak|AlignVCenter</set> <set>WordBreak|AlignVCenter</set>
</property> </property>
</widget> </widget>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>pLIcon</cstring> <cstring>pLIcon</cstring>
</property> </property>
@ -174,13 +174,13 @@
<slot>manualAuth()</slot> <slot>manualAuth()</slot>
</connection> </connection>
</connections> </connections>
<slots> <Q_SLOTS>
<slot>manualAuth()</slot> <slot>manualAuth()</slot>
<slot>respondSMP()</slot> <slot>respondSMP()</slot>
<slot>openHelp()</slot> <slot>openHelp()</slot>
<slot>cancelSMP()</slot> <slot>cancelSMP()</slot>
</slots> </Q_SLOTS>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
<includehints> <includehints>
<includehint>kpushbutton.h</includehint> <includehint>kpushbutton.h</includehint>
<includehint>kpushbutton.h</includehint> <includehint>kpushbutton.h</includehint>

@ -23,7 +23,7 @@
#include "otrlchatinterface.h" #include "otrlchatinterface.h"
#include "otrplugin.h" #include "otrplugin.h"
#include "qlabel.h" #include "tqlabel.h"
#include "klocale.h" #include "klocale.h"
#include "kactivelabel.h" #include "kactivelabel.h"
@ -32,13 +32,13 @@
#include "kopetechatsession.h" #include "kopetechatsession.h"
#include "kopetecontact.h" #include "kopetecontact.h"
VerifyPopup::VerifyPopup(QWidget* parent, const char* name, Kopete::ChatSession *session, bool modal, WFlags fl) VerifyPopup::VerifyPopup(TQWidget* tqparent, const char* name, Kopete::ChatSession *session, bool modal, WFlags fl)
: VerifyPopupUI(parent,name, modal,fl) : VerifyPopupUI(tqparent,name, modal,fl)
{ {
this->session = session; this->session = session;
alContact->setText(i18n("Verify fingerprint for %1.").arg(OtrlChatInterface::self()->formatContact(session->members().getFirst()->contactId()))); alContact->setText(i18n("Verify fingerprint for %1.").tqarg(OtrlChatInterface::self()->formatContact(session->members().getFirst()->contactId())));
alFingerprint->setText(i18n("The received fingerprint is:\n\n%1\n\nContact %2 via another secure channel and verify that this fingerprint is correct.").arg(OtrlChatInterface::self()->findActiveFingerprint(session)).arg(OtrlChatInterface::self()->formatContact(session->members().getFirst()->contactId()))); alFingerprint->setText(i18n("The received fingerprint is:\n\n%1\n\nContact %2 via another secure channel and verify that this fingerprint is correct.").tqarg(OtrlChatInterface::self()->findActiveFingerprint(session)).tqarg(OtrlChatInterface::self()->formatContact(session->members().getFirst()->contactId())));
alVerified->setText(i18n("verified that this is in fact the correct fingerprint for %1").arg(OtrlChatInterface::self()->formatContact(session->members().getFirst()->contactId()))); alVerified->setText(i18n("verified that this is in fact the correct fingerprint for %1").tqarg(OtrlChatInterface::self()->formatContact(session->members().getFirst()->contactId())));
cbVerify->insertItem(i18n("I have not")); cbVerify->insertItem(i18n("I have not"));
cbVerify->insertItem(i18n("I have")); cbVerify->insertItem(i18n("I have"));
if( OtrlChatInterface::self()->isVerified(session)){ if( OtrlChatInterface::self()->isVerified(session)){

@ -27,9 +27,10 @@
class VerifyPopup : public VerifyPopupUI class VerifyPopup : public VerifyPopupUI
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
VerifyPopup(QWidget* parent = 0, const char* name = 0, Kopete::ChatSession *session = NULL, bool modal = FALSE, WFlags fl = 0 ); VerifyPopup(TQWidget* tqparent = 0, const char* name = 0, Kopete::ChatSession *session = NULL, bool modal = FALSE, WFlags fl = 0 );
~VerifyPopup(); ~VerifyPopup();
/*$PUBLIC_FUNCTIONS$*/ /*$PUBLIC_FUNCTIONS$*/

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>VerifyPopupUI</class> <class>VerifyPopupUI</class>
<widget class="QDialog"> <widget class="TQDialog">
<property name="name"> <property name="name">
<cstring>VerifyPopupUI</cstring> <cstring>VerifyPopupUI</cstring>
</property> </property>
@ -40,7 +40,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>461</width> <width>461</width>
<height>20</height> <height>20</height>
@ -56,7 +56,7 @@
<property name="name"> <property name="name">
<cstring>cbVerify</cstring> <cstring>cbVerify</cstring>
</property> </property>
<property name="maximumSize"> <property name="tqmaximumSize">
<size> <size>
<width>130</width> <width>130</width>
<height>32767</height> <height>32767</height>
@ -73,14 +73,14 @@
</font> </font>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="1" column="0" rowspan="1" colspan="3"> <widget class="TQLabel" row="1" column="0" rowspan="1" colspan="3">
<property name="name"> <property name="name">
<cstring>alFingerprint</cstring> <cstring>alFingerprint</cstring>
</property> </property>
<property name="text"> <property name="text">
<string></string> <string></string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>WordBreak|AlignVCenter</set> <set>WordBreak|AlignVCenter</set>
</property> </property>
</widget> </widget>
@ -100,10 +100,10 @@
<slot>close()</slot> <slot>close()</slot>
</connection> </connection>
</connections> </connections>
<slots> <Q_SLOTS>
<slot>cbChanged()</slot> <slot>cbChanged()</slot>
</slots> </Q_SLOTS>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
<includehints> <includehints>
<includehint>kpushbutton.h</includehint> <includehint>kpushbutton.h</includehint>
<includehint>kactivelabel.h</includehint> <includehint>kactivelabel.h</includehint>

Loading…
Cancel
Save