diff options
Diffstat (limited to 'kopete/kopete/chatwindow/kopeteemailwindow.cpp')
-rw-r--r-- | kopete/kopete/chatwindow/kopeteemailwindow.cpp | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/kopete/kopete/chatwindow/kopeteemailwindow.cpp b/kopete/kopete/chatwindow/kopeteemailwindow.cpp index 84b71b16..89f99eb9 100644 --- a/kopete/kopete/chatwindow/kopeteemailwindow.cpp +++ b/kopete/kopete/chatwindow/kopeteemailwindow.cpp @@ -54,15 +54,15 @@ #include <kwin.h> #include <kgenericfactory.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qvbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqvbox.h> typedef KGenericFactory<EmailWindowPlugin> EmailWindowPluginFactory; K_EXPORT_COMPONENT_FACTORY( kopete_emailwindow, EmailWindowPluginFactory( "kopete_emailwindow" ) ) -EmailWindowPlugin::EmailWindowPlugin(QObject *parent, const char *name, const QStringList &) : +EmailWindowPlugin::EmailWindowPlugin(TQObject *parent, const char *name, const TQStringList &) : Kopete::ViewPlugin( EmailWindowPluginFactory::instance(), parent, name ) {} @@ -75,7 +75,7 @@ KopeteView* EmailWindowPlugin::createView( Kopete::ChatSession *manager ) class KopeteEmailWindow::Private { public: - QValueList<Kopete::Message> messageQueue; + TQValueList<Kopete::Message> messageQueue; bool showingMessage; bool sendInProgress; bool visible; @@ -83,14 +83,14 @@ public: KPushButton *btnReplySend; KPushButton *btnReadNext; KPushButton *btnReadPrev; - QSplitter *split; + TQSplitter *split; ChatMessagePart *messagePart; KopeteEmailWindow::WindowMode mode; KAction *chatSend; - QLabel *anim; - QMovie animIcon; - QPixmap normalIcon; - QString unreadMessageFrom; + TQLabel *anim; + TQMovie animIcon; + TQPixmap normalIcon; + TQString unreadMessageFrom; ChatTextEditPart *editPart; KActionMenu *actionActionMenu; @@ -100,27 +100,27 @@ public: KopeteEmailWindow::KopeteEmailWindow( Kopete::ChatSession *manager, EmailWindowPlugin *parent, bool foreignMessage ) : KParts::MainWindow( ), KopeteView( manager, parent ), d( new Private ) { - QVBox *v = new QVBox( this ); + TQVBox *v = new TQVBox( this ); setCentralWidget( v ); - setMinimumSize( QSize( 75, 20 ) ); + setMinimumSize( TQSize( 75, 20 ) ); - d->split = new QSplitter( v ); - d->split->setOrientation( QSplitter::Vertical ); + d->split = new TQSplitter( v ); + d->split->setOrientation( TQSplitter::Vertical ); d->messagePart = new ChatMessagePart( manager, d->split, "messagePart" ); // FIXME: should this be in ChatView too? maybe move to ChatMessagePart? d->messagePart->view()->setMarginWidth( 4 ); d->messagePart->view()->setMarginHeight( 4 ); - d->messagePart->view()->setMinimumSize( QSize( 75, 20 ) ); + d->messagePart->view()->setMinimumSize( TQSize( 75, 20 ) ); d->editPart = new ChatTextEditPart( manager, d->split, "editPart" ); /* FIXME: dude, wtf? - QDomDocument doc = d->editPart->domDocument(); - QDomNode menu = doc.documentElement().firstChild(); + TQDomDocument doc = d->editPart->domDocument(); + TQDomNode menu = doc.documentElement().firstChild(); menu.removeChild( menu.firstChild() ); // Remove File menu.removeChild( menu.firstChild() ); // Remove Edit menu.removeChild( menu.firstChild() ); // Remove View @@ -129,40 +129,40 @@ KopeteEmailWindow::KopeteEmailWindow( Kopete::ChatSession *manager, EmailWindowP doc.documentElement().removeChild( doc.documentElement().childNodes().item(1) ); //Remove MainToolbar doc.documentElement().removeChild( doc.documentElement().lastChild() ); // Remove Edit popup */ - connect( d->editPart, SIGNAL( messageSent( Kopete::Message & ) ), - this, SIGNAL( messageSent( Kopete::Message & ) ) ); - connect( d->editPart, SIGNAL( canSendChanged( bool ) ), - this, SLOT( slotUpdateReplySend() ) ); - connect( d->editPart, SIGNAL( typing(bool) ), - manager, SIGNAL( typing(bool) ) ); + connect( d->editPart, TQT_SIGNAL( messageSent( Kopete::Message & ) ), + this, TQT_SIGNAL( messageSent( Kopete::Message & ) ) ); + connect( d->editPart, TQT_SIGNAL( canSendChanged( bool ) ), + this, TQT_SLOT( slotUpdateReplySend() ) ); + connect( d->editPart, TQT_SIGNAL( typing(bool) ), + manager, TQT_SIGNAL( typing(bool) ) ); //Connections to the manager and the ViewManager that every view should have - connect( this, SIGNAL( closing( KopeteView * ) ), - KopeteViewManager::viewManager(), SLOT( slotViewDestroyed( KopeteView * ) ) ); - connect( this, SIGNAL( activated( KopeteView * ) ), - KopeteViewManager::viewManager(), SLOT( slotViewActivated( KopeteView * ) ) ); - connect( this, SIGNAL( messageSent(Kopete::Message &) ), - manager, SLOT( sendMessage(Kopete::Message &) ) ); - connect( manager, SIGNAL( messageSuccess() ), - this, SLOT( messageSentSuccessfully() )); - - QWidget *containerWidget = new QWidget( v ); - containerWidget->setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum) ); - - QHBoxLayout *h = new QHBoxLayout( containerWidget, 4, 4 ); + connect( this, TQT_SIGNAL( closing( KopeteView * ) ), + KopeteViewManager::viewManager(), TQT_SLOT( slotViewDestroyed( KopeteView * ) ) ); + connect( this, TQT_SIGNAL( activated( KopeteView * ) ), + KopeteViewManager::viewManager(), TQT_SLOT( slotViewActivated( KopeteView * ) ) ); + connect( this, TQT_SIGNAL( messageSent(Kopete::Message &) ), + manager, TQT_SLOT( sendMessage(Kopete::Message &) ) ); + connect( manager, TQT_SIGNAL( messageSuccess() ), + this, TQT_SLOT( messageSentSuccessfully() )); + + TQWidget *containerWidget = new TQWidget( v ); + containerWidget->setSizePolicy( TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum) ); + + TQHBoxLayout *h = new TQHBoxLayout( containerWidget, 4, 4 ); h->addStretch(); d->btnReadPrev = new KPushButton( i18n( "<< Prev" ), containerWidget ); - connect( d->btnReadPrev, SIGNAL( pressed() ), this, SLOT( slotReadPrev() ) ); + connect( d->btnReadPrev, TQT_SIGNAL( pressed() ), this, TQT_SLOT( slotReadPrev() ) ); h->addWidget( d->btnReadPrev, 0, Qt::AlignRight | Qt::AlignVCenter ); d->btnReadPrev->setEnabled( false ); d->btnReadNext = new KPushButton( i18n( "(0) Next >>" ), containerWidget ); - connect( d->btnReadNext, SIGNAL( pressed() ), this, SLOT( slotReadNext() ) ); + connect( d->btnReadNext, TQT_SIGNAL( pressed() ), this, TQT_SLOT( slotReadNext() ) ); h->addWidget( d->btnReadNext, 0, Qt::AlignRight | Qt::AlignVCenter ); d->btnReplySend = new KPushButton( containerWidget ); - connect( d->btnReplySend, SIGNAL( pressed() ), this, SLOT( slotReplySend() ) ); + connect( d->btnReplySend, TQT_SIGNAL( pressed() ), this, TQT_SLOT( slotReplySend() ) ); h->addWidget( d->btnReplySend, 0, Qt::AlignRight | Qt::AlignVCenter ); initActions(); @@ -176,7 +176,7 @@ KopeteEmailWindow::KopeteEmailWindow( Kopete::ChatSession *manager, EmailWindowP toggleMode( Send ); KConfig *config = KGlobal::config(); - applyMainWindowSettings( config, QString::fromLatin1( "KopeteEmailWindow" ) ); + applyMainWindowSettings( config, TQString::fromLatin1( "KopeteEmailWindow" ) ); d->sendInProgress = false; @@ -196,7 +196,7 @@ KopeteEmailWindow::~KopeteEmailWindow() // saves menubar, toolbar and statusbar setting KConfig *config = KGlobal::config(); - saveMainWindowSettings( config, QString::fromLatin1( "KopeteEmailWindow" ) ); + saveMainWindowSettings( config, TQString::fromLatin1( "KopeteEmailWindow" ) ); config->sync(); delete d; @@ -206,54 +206,54 @@ void KopeteEmailWindow::initActions(void) { KActionCollection *coll = actionCollection(); - d->chatSend = new KAction( i18n( "&Send Message" ), QString::fromLatin1( "mail_send" ), 0, - this, SLOT( slotReplySend() ), coll, "chat_send" ); + d->chatSend = new KAction( i18n( "&Send Message" ), TQString::fromLatin1( "mail_send" ), 0, + this, TQT_SLOT( slotReplySend() ), coll, "chat_send" ); //Default to 'Return' for sending messages - d->chatSend->setShortcut( QKeySequence( Key_Return ) ); + d->chatSend->setShortcut( TQKeySequence( Key_Return ) ); - KStdAction::quit ( this, SLOT( slotCloseView() ), coll ); + KStdAction::quit ( this, TQT_SLOT( slotCloseView() ), coll ); - KStdAction::cut( d->editPart->widget(), SLOT( cut() ), coll ); - KStdAction::copy( this, SLOT(slotCopy()), coll); - KStdAction::paste( d->editPart->widget(), SLOT( paste() ), coll ); + KStdAction::cut( d->editPart->widget(), TQT_SLOT( cut() ), coll ); + KStdAction::copy( this, TQT_SLOT(slotCopy()), coll); + KStdAction::paste( d->editPart->widget(), TQT_SLOT( paste() ), coll ); - new KAction( i18n( "&Set Font..." ), QString::fromLatin1( "charset" ), 0, - d->editPart, SLOT( setFont() ), coll, "format_font" ); - new KAction( i18n( "Set Text &Color..." ), QString::fromLatin1( "pencil" ), 0, - d->editPart, SLOT( setFgColor() ), coll, "format_color" ); - new KAction( i18n( "Set &Background Color..." ), QString::fromLatin1( "fill" ), 0, - d->editPart, SLOT( setBgColor() ), coll, "format_bgcolor" ); + new KAction( i18n( "&Set Font..." ), TQString::fromLatin1( "charset" ), 0, + d->editPart, TQT_SLOT( setFont() ), coll, "format_font" ); + new KAction( i18n( "Set Text &Color..." ), TQString::fromLatin1( "pencil" ), 0, + d->editPart, TQT_SLOT( setFgColor() ), coll, "format_color" ); + new KAction( i18n( "Set &Background Color..." ), TQString::fromLatin1( "fill" ), 0, + d->editPart, TQT_SLOT( setBgColor() ), coll, "format_bgcolor" ); - KStdAction::showMenubar( this, SLOT( slotViewMenuBar() ), coll ); + KStdAction::showMenubar( this, TQT_SLOT( slotViewMenuBar() ), coll ); setStandardToolBarMenuEnabled( true ); d->actionSmileyMenu = new KopeteEmoticonAction( coll, "format_smiley" ); d->actionSmileyMenu->setDelayed( false ); - connect(d->actionSmileyMenu, SIGNAL(activated(const QString &)), this, SLOT(slotSmileyActivated(const QString &))); + connect(d->actionSmileyMenu, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(slotSmileyActivated(const TQString &))); // add configure key bindings menu item - KStdAction::keyBindings( guiFactory(), SLOT( configureShortcuts() ), coll ); - KStdAction::configureToolbars(this, SLOT( slotConfToolbar() ), coll); + KStdAction::keyBindings( guiFactory(), TQT_SLOT( configureShortcuts() ), coll ); + KStdAction::configureToolbars(this, TQT_SLOT( slotConfToolbar() ), coll); //FIXME: no longer works? KopeteStdAction::preferences( coll , "settings_prefs" ); // The animated toolbarbutton - d->normalIcon = QPixmap( BarIcon( QString::fromLatin1( "kopete" ) ) ); - d->animIcon = KGlobal::iconLoader()->loadMovie( QString::fromLatin1( "newmessage" ), KIcon::Toolbar); + d->normalIcon = TQPixmap( BarIcon( TQString::fromLatin1( "kopete" ) ) ); + d->animIcon = KGlobal::iconLoader()->loadMovie( TQString::fromLatin1( "newmessage" ), KIcon::Toolbar); d->animIcon.pause(); - d->anim = new QLabel( this, "kde toolbar widget" ); + d->anim = new TQLabel( this, "kde toolbar widget" ); d->anim->setMargin( 5 ); d->anim->setPixmap( d->normalIcon ); new KWidgetAction( d->anim, i18n("Toolbar Animation"), 0, 0, 0, coll, "toolbar_animation" ); - setXMLFile( QString::fromLatin1( "kopeteemailwindow.rc" ) ); + setXMLFile( TQString::fromLatin1( "kopeteemailwindow.rc" ) ); createGUI( d->editPart ); - //createGUI( QString::fromLatin1( "kopeteemailwindow.rc" ) ); + //createGUI( TQString::fromLatin1( "kopeteemailwindow.rc" ) ); guiFactory()->addClient(m_manager); } -void KopeteEmailWindow::closeEvent( QCloseEvent *e ) +void KopeteEmailWindow::closeEvent( TQCloseEvent *e ) { // DO NOT call base class's closeEvent - see comment in KopeteApplication constructor for reason @@ -272,7 +272,7 @@ void KopeteEmailWindow::slotViewMenuBar() menuBar()->show(); } -void KopeteEmailWindow::slotSmileyActivated(const QString &sm ) +void KopeteEmailWindow::slotSmileyActivated(const TQString &sm ) { if ( !sm.isNull() ) d->editPart->addText( sm ); @@ -280,12 +280,12 @@ void KopeteEmailWindow::slotSmileyActivated(const QString &sm ) void KopeteEmailWindow::slotConfToolbar() { - saveMainWindowSettings(KGlobal::config(), QString::fromLatin1( "KopeteEmailWindow" )); - KEditToolbar *dlg = new KEditToolbar(actionCollection(), QString::fromLatin1("kopeteemailwindow.rc") ); + saveMainWindowSettings(KGlobal::config(), TQString::fromLatin1( "KopeteEmailWindow" )); + KEditToolbar *dlg = new KEditToolbar(actionCollection(), TQString::fromLatin1("kopeteemailwindow.rc") ); if (dlg->exec()) { createGUI( d->editPart ); - applyMainWindowSettings(KGlobal::config(), QString::fromLatin1( "KopeteEmailWindow" )); + applyMainWindowSettings(KGlobal::config(), TQString::fromLatin1( "KopeteEmailWindow" )); } delete dlg; } @@ -313,19 +313,19 @@ void KopeteEmailWindow::appendMessage(Kopete::Message &message) slotReadNext(); else { - d->btnReadNext->setPaletteForegroundColor( QColor("red") ); + d->btnReadNext->setPaletteForegroundColor( TQColor("red") ); updateNextButton(); } d->unreadMessageFrom = message.from()->metaContact() ? message.from()->metaContact()->displayName() : message.from()->contactId(); - QTimer::singleShot( 1000, this, SLOT(slotMarkMessageRead()) ); + TQTimer::singleShot( 1000, this, TQT_SLOT(slotMarkMessageRead()) ); } } void KopeteEmailWindow::slotMarkMessageRead() { - d->unreadMessageFrom = QString::null; + d->unreadMessageFrom = TQString::null; } void KopeteEmailWindow::updateNextButton() @@ -418,27 +418,27 @@ bool KopeteEmailWindow::closeView( bool force ) { if( m_manager->members().count() > 1 ) { - QString shortCaption = caption(); + TQString shortCaption = caption(); if( shortCaption.length() > 40 ) - shortCaption = shortCaption.left( 40 ) + QString::fromLatin1("..."); + shortCaption = shortCaption.left( 40 ) + TQString::fromLatin1("..."); response = KMessageBox::warningContinueCancel(this, i18n("<qt>You are about to leave the group chat session <b>%1</b>.<br>" "You will not receive future messages from this conversation.</qt>").arg(shortCaption), i18n("Closing Group Chat"), - i18n("Cl&ose Chat"), QString::fromLatin1("AskCloseGroupChat")); + i18n("Cl&ose Chat"), TQString::fromLatin1("AskCloseGroupChat")); } if( !d->unreadMessageFrom.isNull() && ( response == KMessageBox::Continue ) ) { response = KMessageBox::warningContinueCancel(this, i18n("<qt>You have received a message from <b>%1</b> in the last " "second. Are you sure you want to close this chat?</qt>").arg(d->unreadMessageFrom), i18n("Unread Message"), - i18n("Cl&ose Chat"), QString::fromLatin1("AskCloseChatRecentMessage")); + i18n("Cl&ose Chat"), TQString::fromLatin1("AskCloseChatRecentMessage")); } if( d->sendInProgress && ( response == KMessageBox::Continue ) ) { response = KMessageBox::warningContinueCancel(this, i18n("You have a message send in progress, which will be " "aborted if this chat is closed. Are you sure you want to close this chat?"), i18n("Message in Transit"), - i18n("Cl&ose Chat"), QString::fromLatin1("AskCloseChatMessageInProgress") ); + i18n("Cl&ose Chat"), TQString::fromLatin1("AskCloseChatMessageInProgress") ); } } @@ -477,7 +477,7 @@ void KopeteEmailWindow::toggleMode( WindowMode newMode ) d->btnReadPrev->show(); break; case Reply: - QValueList<int> splitPercent; + TQValueList<int> splitPercent; // FIXME: should be saved and restored splitPercent.append(50); splitPercent.append(50); |