diff options
Diffstat (limited to 'kopete/kopete/systemtray.cpp')
-rw-r--r-- | kopete/kopete/systemtray.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/kopete/kopete/systemtray.cpp b/kopete/kopete/systemtray.cpp index 5ed018c5..d71b3816 100644 --- a/kopete/kopete/systemtray.cpp +++ b/kopete/kopete/systemtray.cpp @@ -19,9 +19,9 @@ #include "systemtray.h" -#include <qtimer.h> -#include <qtooltip.h> -#include <qregexp.h> +#include <tqtimer.h> +#include <tqtooltip.h> +#include <tqregexp.h> #include <kwin.h> #include <kaboutdata.h> @@ -41,7 +41,7 @@ KopeteSystemTray* KopeteSystemTray::s_systemTray = 0L; -KopeteSystemTray* KopeteSystemTray::systemTray( QWidget *parent, const char* name ) +KopeteSystemTray* KopeteSystemTray::systemTray( TQWidget *parent, const char* name ) { if( !s_systemTray ) s_systemTray = new KopeteSystemTray( parent, name ); @@ -49,27 +49,27 @@ KopeteSystemTray* KopeteSystemTray::systemTray( QWidget *parent, const char* nam return s_systemTray; } -KopeteSystemTray::KopeteSystemTray(QWidget* parent, const char* name) +KopeteSystemTray::KopeteSystemTray(TQWidget* parent, const char* name) : KSystemTray(parent,name) { // kdDebug(14010) << "Creating KopeteSystemTray" << endl; - QToolTip::add( this, kapp->aboutData()->shortDescription() ); + TQToolTip::add( this, kapp->aboutData()->shortDescription() ); mIsBlinkIcon = false; mIsBlinking = false; - mBlinkTimer = new QTimer(this, "mBlinkTimer"); + mBlinkTimer = new TQTimer(this, "mBlinkTimer"); mKopeteIcon = loadIcon("kopete"); - connect(mBlinkTimer, SIGNAL(timeout()), this, SLOT(slotBlink())); - connect(Kopete::ChatSessionManager::self() , SIGNAL(newEvent(Kopete::MessageEvent*)), - this, SLOT(slotNewEvent(Kopete::MessageEvent*))); - connect(KopetePrefs::prefs(), SIGNAL(saved()), this, SLOT(slotConfigChanged())); + connect(mBlinkTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotBlink())); + connect(Kopete::ChatSessionManager::self() , TQT_SIGNAL(newEvent(Kopete::MessageEvent*)), + this, TQT_SLOT(slotNewEvent(Kopete::MessageEvent*))); + connect(KopetePrefs::prefs(), TQT_SIGNAL(saved()), this, TQT_SLOT(slotConfigChanged())); connect(Kopete::AccountManager::self(), - SIGNAL(accountOnlineStatusChanged(Kopete::Account *, + TQT_SIGNAL(accountOnlineStatusChanged(Kopete::Account *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus &)), - this, SLOT(slotReevaluateAccountStates())); + this, TQT_SLOT(slotReevaluateAccountStates())); // the slot called by default by the quit action, KSystemTray::maybeQuit(), // just closes the parent window, which is hard to distinguish in that window's closeEvent() @@ -81,7 +81,7 @@ KopeteSystemTray::KopeteSystemTray(QWidget* parent, const char* name) KAction *quit = actionCollection()->action( "file_quit" ); quit->disconnect(); KopeteWindow *myParent = static_cast<KopeteWindow *>( parent ); - connect( quit, SIGNAL( activated() ), myParent, SLOT( slotQuit() ) ); + connect( quit, TQT_SIGNAL( activated() ), myParent, TQT_SLOT( slotQuit() ) ); //setPixmap(mKopeteIcon); slotReevaluateAccountStates(); @@ -97,11 +97,11 @@ KopeteSystemTray::~KopeteSystemTray() Kopete::UI::Global::setSysTrayWId( 0 ); } -void KopeteSystemTray::mousePressEvent( QMouseEvent *me ) +void KopeteSystemTray::mousePressEvent( TQMouseEvent *me ) { if ( - (me->button() == QEvent::MidButton || - (me->button() == QEvent::LeftButton && KopetePrefs::prefs()->trayflashNotifyLeftClickOpensMessage())) && + (me->button() == TQEvent::MidButton || + (me->button() == TQEvent::LeftButton && KopetePrefs::prefs()->trayflashNotifyLeftClickOpensMessage())) && mIsBlinking ) { mouseDoubleClickEvent( me ); @@ -111,7 +111,7 @@ void KopeteSystemTray::mousePressEvent( QMouseEvent *me ) KSystemTray::mousePressEvent( me ); } -void KopeteSystemTray::mouseDoubleClickEvent( QMouseEvent *me ) +void KopeteSystemTray::mouseDoubleClickEvent( TQMouseEvent *me ) { if ( !mIsBlinking ) { @@ -130,12 +130,12 @@ void KopeteSystemTray::contextMenuAboutToShow( KPopupMenu *me ) emit aboutToShowMenu( me ); } -void KopeteSystemTray::startBlink( const QString &icon ) +void KopeteSystemTray::startBlink( const TQString &icon ) { startBlink( KGlobal::iconLoader()->loadIcon( icon , KIcon::Panel ) ); } -void KopeteSystemTray::startBlink( const QPixmap &icon ) +void KopeteSystemTray::startBlink( const TQPixmap &icon ) { mBlinkIcon = icon; if ( mBlinkTimer->isActive() == false ) @@ -153,10 +153,10 @@ void KopeteSystemTray::startBlink( const QPixmap &icon ) } } -void KopeteSystemTray::startBlink( const QMovie &movie ) +void KopeteSystemTray::startBlink( const TQMovie &movie ) { //kdDebug( 14010 ) << k_funcinfo << "starting movie." << endl; - const_cast<QMovie &>( movie ).unpause(); + const_cast<TQMovie &>( movie ).unpause(); setMovie( movie ); mIsBlinking = true; } @@ -164,7 +164,7 @@ void KopeteSystemTray::startBlink( const QMovie &movie ) void KopeteSystemTray::startBlink() { if ( mMovie.isNull() ) - mMovie = KGlobal::iconLoader()->loadMovie( QString::fromLatin1( "newmessage" ), KIcon::Panel ); + mMovie = KGlobal::iconLoader()->loadMovie( TQString::fromLatin1( "newmessage" ), KIcon::Panel ); startBlink( mMovie ); } @@ -205,8 +205,8 @@ void KopeteSystemTray::slotNewEvent( Kopete::MessageEvent *event ) mBalloonEventList.append( event ); } - connect(event, SIGNAL(done(Kopete::MessageEvent*)), - this, SLOT(slotEventDone(Kopete::MessageEvent*))); + connect(event, TQT_SIGNAL(done(Kopete::MessageEvent*)), + this, TQT_SLOT(slotEventDone(Kopete::MessageEvent*))); if( event->message().manager() != 0 ) { @@ -262,7 +262,7 @@ void KopeteSystemTray::removeBalloonEvent(Kopete::MessageEvent *event) { //delay the addBalloon to let the time to event be deleted //in case a contact has been deleted cf Bug 100196 - QTimer::singleShot(0, this, SLOT(addBalloon())); + TQTimer::singleShot(0, this, TQT_SLOT(addBalloon())); } else { @@ -291,10 +291,10 @@ void KopeteSystemTray::addBalloon() if ( msg.from() ) { - QString msgText = squashMessage( msg ); + TQString msgText = squashMessage( msg ); kdDebug(14010) << k_funcinfo << "msg text=" << msgText << endl; - QString msgFrom; + TQString msgFrom; if( msg.from()->metaContact() ) msgFrom = msg.from()->metaContact()->displayName(); else @@ -302,11 +302,11 @@ void KopeteSystemTray::addBalloon() m_balloon = new KopeteBalloon( i18n( "<qt><nobr><b>New Message from %1:</b></nobr><br><nobr>\"%2\"</nobr></qt>" ) - .arg( QStyleSheet::escape( msgFrom ), msgText ), QString::null ); - connect(m_balloon, SIGNAL(signalBalloonClicked()), mBalloonEventList.first() , SLOT(apply())); - connect(m_balloon, SIGNAL(signalButtonClicked()), mBalloonEventList.first() , SLOT(apply())); - connect(m_balloon, SIGNAL(signalIgnoreButtonClicked()), mBalloonEventList.first() , SLOT(ignore())); - connect(m_balloon, SIGNAL(signalTimeout()), this , SLOT(slotRemoveBalloon())); + .arg( TQStyleSheet::escape( msgFrom ), msgText ), TQString::null ); + connect(m_balloon, TQT_SIGNAL(signalBalloonClicked()), mBalloonEventList.first() , TQT_SLOT(apply())); + connect(m_balloon, TQT_SIGNAL(signalButtonClicked()), mBalloonEventList.first() , TQT_SLOT(apply())); + connect(m_balloon, TQT_SIGNAL(signalIgnoreButtonClicked()), mBalloonEventList.first() , TQT_SLOT(ignore())); + connect(m_balloon, TQT_SIGNAL(signalTimeout()), this , TQT_SLOT(slotRemoveBalloon())); m_balloon->setAnchor(mapToGlobal(pos())); m_balloon->show(); KWin::setOnAllDesktops(m_balloon->winId(), true); @@ -337,7 +337,7 @@ void KopeteSystemTray::slotReevaluateAccountStates() bool bOffline = false; Kopete::Contact *c = 0; - for (QPtrListIterator<Kopete::Account> it(Kopete::AccountManager::self()->accounts()); it.current(); ++it) + for (TQPtrListIterator<Kopete::Account> it(Kopete::AccountManager::self()->accounts()); it.current(); ++it) { c = it.current()->myself(); if (!c) @@ -383,11 +383,11 @@ void KopeteSystemTray::slotReevaluateAccountStates() } -QString KopeteSystemTray::squashMessage( const Kopete::Message& msg ) +TQString KopeteSystemTray::squashMessage( const Kopete::Message& msg ) { - QString msgText = msg.parsedBody(); + TQString msgText = msg.parsedBody(); - QRegExp rx( "(<a.*>((http://)?(.+))</a>)" ); + TQRegExp rx( "(<a.*>((http://)?(.+))</a>)" ); rx.setMinimal( true ); if ( rx.search( msgText ) == -1 ) { @@ -397,31 +397,31 @@ QString KopeteSystemTray::squashMessage( const Kopete::Message& msg ) // Escape it after snipping it to not snip entities msgText =msg.plainBody() ; if( msgText.length() > 30 ) - msgText = msgText.left( 30 ) + QString::fromLatin1( " ..." ); + msgText = msgText.left( 30 ) + TQString::fromLatin1( " ..." ); msgText=Kopete::Message::escape(msgText); } else { - QString plainText = msg.plainBody(); + TQString plainText = msg.plainBody(); if ( plainText.length() > 30 ) { - QString fullUrl = rx.cap( 2 ); - QString shorterUrl; + TQString fullUrl = rx.cap( 2 ); + TQString shorterUrl; if ( fullUrl.length() > 30 ) { - QString urlWithoutProtocol = rx.cap( 4 ); + TQString urlWithoutProtocol = rx.cap( 4 ); shorterUrl = urlWithoutProtocol.left( 27 ) - + QString::fromLatin1( "... " ); + + TQString::fromLatin1( "... " ); } else { shorterUrl = fullUrl.left( 27 ) - + QString::fromLatin1( "... " ); + + TQString::fromLatin1( "... " ); } // remove message text - msgText = QString::fromLatin1( "... " ) + + msgText = TQString::fromLatin1( "... " ) + rx.cap( 1 ) + - QString::fromLatin1( " ..." ); + TQString::fromLatin1( " ..." ); // find last occurrence of URL (the one inside the <a> tag) int revUrlOffset = msgText.findRev( fullUrl ); msgText.replace( revUrlOffset, |