summaryrefslogtreecommitdiffstats
path: root/kmail/kmsystemtray.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /kmail/kmsystemtray.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmsystemtray.cpp')
-rw-r--r--kmail/kmsystemtray.cpp104
1 files changed, 52 insertions, 52 deletions
diff --git a/kmail/kmsystemtray.cpp b/kmail/kmsystemtray.cpp
index c8595a88f..4e6463c15 100644
--- a/kmail/kmsystemtray.cpp
+++ b/kmail/kmsystemtray.cpp
@@ -37,11 +37,11 @@ using KMail::AccountManager;
#include <kdebug.h>
#include <kpopupmenu.h>
-#include <qpainter.h>
-#include <qbitmap.h>
-#include <qtooltip.h>
-#include <qwidgetlist.h>
-#include <qobjectlist.h>
+#include <tqpainter.h>
+#include <tqbitmap.h>
+#include <tqtooltip.h>
+#include <tqwidgetlist.h>
+#include <tqobjectlist.h>
#include <math.h>
#include <assert.h>
@@ -57,7 +57,7 @@ using KMail::AccountManager;
* with its count of unread messages, allowing the user to jump
* to the first unread message in each folder.
*/
-KMSystemTray::KMSystemTray(QWidget *parent, const char *name)
+KMSystemTray::KMSystemTray(TQWidget *parent, const char *name)
: KSystemTray( parent, name ),
mParentVisible( true ),
mPosOfMainWin( 0, 0 ),
@@ -71,8 +71,8 @@ KMSystemTray::KMSystemTray(QWidget *parent, const char *name)
kdDebug(5006) << "Initting systray" << endl;
mLastUpdate = time( 0 );
- mUpdateTimer = new QTimer( this, "systraytimer" );
- connect( mUpdateTimer, SIGNAL( timeout() ), SLOT( updateNewMessages() ) );
+ mUpdateTimer = new TQTimer( this, "systraytimer" );
+ connect( mUpdateTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( updateNewMessages() ) );
mDefaultIcon = loadIcon( "kmail" );
mLightIconImage = loadIcon( "kmaillight" ).convertToImage();
@@ -81,7 +81,7 @@ KMSystemTray::KMSystemTray(QWidget *parent, const char *name)
KMMainWidget * mainWidget = kmkernel->getKMMainWidget();
if ( mainWidget ) {
- QWidget * mainWin = mainWidget->topLevelWidget();
+ TQWidget * mainWin = mainWidget->topLevelWidget();
if ( mainWin ) {
mDesktopOfMainWin = KWin::windowInfo( mainWin->winId(),
NET::WMDesktop ).desktop();
@@ -95,13 +95,13 @@ KMSystemTray::KMSystemTray(QWidget *parent, const char *name)
/** Initiate connections between folders and this object */
foldersChanged();
- connect( kmkernel->folderMgr(), SIGNAL(changed()), SLOT(foldersChanged()));
- connect( kmkernel->imapFolderMgr(), SIGNAL(changed()), SLOT(foldersChanged()));
- connect( kmkernel->dimapFolderMgr(), SIGNAL(changed()), SLOT(foldersChanged()));
- connect( kmkernel->searchFolderMgr(), SIGNAL(changed()), SLOT(foldersChanged()));
+ connect( kmkernel->folderMgr(), TQT_SIGNAL(changed()), TQT_SLOT(foldersChanged()));
+ connect( kmkernel->imapFolderMgr(), TQT_SIGNAL(changed()), TQT_SLOT(foldersChanged()));
+ connect( kmkernel->dimapFolderMgr(), TQT_SIGNAL(changed()), TQT_SLOT(foldersChanged()));
+ connect( kmkernel->searchFolderMgr(), TQT_SIGNAL(changed()), TQT_SLOT(foldersChanged()));
- connect( kmkernel->acctMgr(), SIGNAL( checkedMail( bool, bool, const QMap<QString, int> & ) ),
- SLOT( updateNewMessages() ) );
+ connect( kmkernel->acctMgr(), TQT_SIGNAL( checkedMail( bool, bool, const TQMap<TQString, int> & ) ),
+ TQT_SLOT( updateNewMessages() ) );
}
void KMSystemTray::buildPopupMenu()
@@ -187,14 +187,14 @@ void KMSystemTray::updateCount()
int oldPixmapWidth = pixmap()->size().width();
int oldPixmapHeight = pixmap()->size().height();
- QString countString = QString::number( mCount );
- QFont countFont = KGlobalSettings::generalFont();
+ TQString countString = TQString::number( mCount );
+ TQFont countFont = KGlobalSettings::generalFont();
countFont.setBold(true);
// decrease the size of the font for the number of unread messages if the
// number doesn't fit into the available space
float countFontSize = countFont.pointSizeFloat();
- QFontMetrics qfm( countFont );
+ TQFontMetrics qfm( countFont );
int width = qfm.width( countString );
if( width > oldPixmapWidth )
{
@@ -208,31 +208,31 @@ void KMSystemTray::updateCount()
// reason text that is drawn on a transparent pixmap is invisible
// (apparently the alpha channel isn't changed when the text is drawn).
// Therefore I have to draw the text on a solid background and then remove
- // the background by making it transparent with QPixmap::setMask. This
+ // the background by making it transparent with TQPixmap::setMask. This
// involves the slow createHeuristicMask() function (from the API docs:
- // "This function is slow because it involves transformation to a QImage,
- // non-trivial computations and a transformation back to a QBitmap."). Then
- // I have to convert the resulting QPixmap to a QImage in order to overlay
+ // "This function is slow because it involves transformation to a TQImage,
+ // non-trivial computations and a transformation back to a TQBitmap."). Then
+ // I have to convert the resulting TQPixmap to a TQImage in order to overlay
// the light KMail icon with the number (because KIconEffect::overlay only
- // works with QImage). Finally the resulting QImage has to be converted
- // back to a QPixmap.
+ // works with TQImage). Finally the resulting TQImage has to be converted
+ // back to a TQPixmap.
// That's a lot of work for overlaying the KMail icon with the number of
// unread messages, but every other approach I tried failed miserably.
// IK, 2003-09-22
- QPixmap numberPixmap( oldPixmapWidth, oldPixmapHeight );
+ TQPixmap numberPixmap( oldPixmapWidth, oldPixmapHeight );
numberPixmap.fill( Qt::white );
- QPainter p( &numberPixmap );
+ TQPainter p( &numberPixmap );
p.setFont( countFont );
p.setPen( Qt::blue );
p.drawText( numberPixmap.rect(), Qt::AlignCenter, countString );
numberPixmap.setMask( numberPixmap.createHeuristicMask() );
- QImage numberImage = numberPixmap.convertToImage();
+ TQImage numberImage = numberPixmap.convertToImage();
// Overlay the light KMail icon with the number image
- QImage iconWithNumberImage = mLightIconImage.copy();
+ TQImage iconWithNumberImage = mLightIconImage.copy();
KIconEffect::overlay( iconWithNumberImage, numberImage );
- QPixmap iconWithNumber;
+ TQPixmap iconWithNumber;
iconWithNumber.convertFromImage( iconWithNumberImage );
setPixmap( iconWithNumber );
} else
@@ -259,30 +259,30 @@ void KMSystemTray::foldersChanged()
}
/** Disconnect all previous connections */
- disconnect(this, SLOT(updateNewMessageNotification(KMFolder *)));
+ disconnect(this, TQT_SLOT(updateNewMessageNotification(KMFolder *)));
- QStringList folderNames;
- QValueList<QGuardedPtr<KMFolder> > folderList;
+ TQStringList folderNames;
+ TQValueList<TQGuardedPtr<KMFolder> > folderList;
kmkernel->folderMgr()->createFolderList(&folderNames, &folderList);
kmkernel->imapFolderMgr()->createFolderList(&folderNames, &folderList);
kmkernel->dimapFolderMgr()->createFolderList(&folderNames, &folderList);
kmkernel->searchFolderMgr()->createFolderList(&folderNames, &folderList);
- QStringList::iterator strIt = folderNames.begin();
+ TQStringList::iterator strIt = folderNames.begin();
- for(QValueList<QGuardedPtr<KMFolder> >::iterator it = folderList.begin();
+ for(TQValueList<TQGuardedPtr<KMFolder> >::iterator it = folderList.begin();
it != folderList.end() && strIt != folderNames.end(); ++it, ++strIt)
{
KMFolder * currentFolder = *it;
- QString currentName = *strIt;
+ TQString currentName = *strIt;
if ( ((!currentFolder->isSystemFolder() || (currentFolder->name().lower() == "inbox")) ||
(currentFolder->folderType() == KMFolderTypeImap)) &&
!currentFolder->ignoreNewMail() )
{
/** If this is a new folder, start listening for messages */
- connect(currentFolder, SIGNAL(numUnreadMsgsChanged(KMFolder *)),
- this, SLOT(updateNewMessageNotification(KMFolder *)));
+ connect(currentFolder, TQT_SIGNAL(numUnreadMsgsChanged(KMFolder *)),
+ this, TQT_SLOT(updateNewMessageNotification(KMFolder *)));
/** Check all new folders to see if we started with any new messages */
updateNewMessageNotification(currentFolder);
@@ -294,7 +294,7 @@ void KMSystemTray::foldersChanged()
* On left mouse click, switch focus to the first KMMainWidget. On right
* click, bring up a list of all folders with a count of unread messages.
*/
-void KMSystemTray::mousePressEvent(QMouseEvent *e)
+void KMSystemTray::mousePressEvent(TQMouseEvent *e)
{
// switch to kmail on left mouse button
if( e->button() == LeftButton )
@@ -324,13 +324,13 @@ void KMSystemTray::mousePressEvent(QMouseEvent *e)
{
KPopupMenu *newMessagesPopup = new KPopupMenu();
- QMap<QGuardedPtr<KMFolder>, int>::Iterator it = mFoldersWithUnread.begin();
+ TQMap<TQGuardedPtr<KMFolder>, int>::Iterator it = mFoldersWithUnread.begin();
for(uint i=0; it != mFoldersWithUnread.end(); ++i)
{
kdDebug(5006) << "Adding folder" << endl;
mPopupFolders.append( it.key() );
- QString item = prettyName(it.key()) + " (" + QString::number(it.data()) + ")";
- newMessagesPopup->insertItem(item, this, SLOT(selectedAccount(int)), 0, i);
+ TQString item = prettyName(it.key()) + " (" + TQString::number(it.data()) + ")";
+ newMessagesPopup->insertItem(item, this, TQT_SLOT(selectedAccount(int)), 0, i);
++it;
}
@@ -349,9 +349,9 @@ void KMSystemTray::mousePressEvent(QMouseEvent *e)
* Return the name of the folder in which the mail is deposited, prepended
* with the account name if the folder is IMAP.
*/
-QString KMSystemTray::prettyName(KMFolder * fldr)
+TQString KMSystemTray::prettyName(KMFolder * fldr)
{
- QString rvalue = fldr->label();
+ TQString rvalue = fldr->label();
if(fldr->folderType() == KMFolderTypeImap)
{
KMFolderImap * imap = dynamic_cast<KMFolderImap*> (fldr->storage());
@@ -377,7 +377,7 @@ bool KMSystemTray::mainWindowIsOnCurrentDesktop()
if ( !mainWidget )
return false;
- QWidget *mainWin = kmkernel->getKMMainWidget()->topLevelWidget();
+ TQWidget *mainWin = kmkernel->getKMMainWidget()->topLevelWidget();
if ( !mainWin )
return false;
@@ -393,7 +393,7 @@ void KMSystemTray::showKMail()
{
if (!kmkernel->getKMMainWidget())
return;
- QWidget *mainWin = kmkernel->getKMMainWidget()->topLevelWidget();
+ TQWidget *mainWin = kmkernel->getKMMainWidget()->topLevelWidget();
assert(mainWin);
if(mainWin)
{
@@ -421,7 +421,7 @@ void KMSystemTray::hideKMail()
{
if (!kmkernel->getKMMainWidget())
return;
- QWidget *mainWin = kmkernel->getKMMainWidget()->topLevelWidget();
+ TQWidget *mainWin = kmkernel->getKMMainWidget()->topLevelWidget();
assert(mainWin);
if(mainWin)
{
@@ -464,7 +464,7 @@ void KMSystemTray::updateNewMessageNotification(KMFolder * fldr)
void KMSystemTray::updateNewMessages()
{
- for ( QMap<QGuardedPtr<KMFolder>, bool>::Iterator it = mPendingUpdates.begin();
+ for ( TQMap<TQGuardedPtr<KMFolder>, bool>::Iterator it = mPendingUpdates.begin();
it != mPendingUpdates.end(); ++it)
{
KMFolder *fldr = it.key();
@@ -474,7 +474,7 @@ void KMSystemTray::updateNewMessages()
/** The number of unread messages in that folder */
int unread = fldr->countUnread();
- QMap<QGuardedPtr<KMFolder>, int>::Iterator it =
+ TQMap<TQGuardedPtr<KMFolder>, int>::Iterator it =
mFoldersWithUnread.find(fldr);
bool unmapped = (it == mFoldersWithUnread.end());
@@ -526,7 +526,7 @@ void KMSystemTray::updateNewMessages()
if(mFoldersWithUnread.count() == 0)
{
mPopupFolders.clear();
- disconnect(this, SLOT(selectedAccount(int)));
+ disconnect(this, TQT_SLOT(selectedAccount(int)));
mCount = 0;
@@ -542,8 +542,8 @@ void KMSystemTray::updateNewMessages()
updateCount();
/** Update tooltip to reflect count of unread messages */
- QToolTip::remove(this);
- QToolTip::add(this, mCount == 0 ?
+ TQToolTip::remove(this);
+ TQToolTip::add(this, mCount == 0 ?
i18n("There are no unread messages")
: i18n("There is 1 unread message.",
"There are %n unread messages.",
@@ -575,7 +575,7 @@ void KMSystemTray::selectedAccount(int id)
if(!fldr) return;
KMFolderTree * ft = mainWidget->folderTree();
if(!ft) return;
- QListViewItem * fldrIdx = ft->indexOfFolder(fldr);
+ TQListViewItem * fldrIdx = ft->indexOfFolder(fldr);
if(!fldrIdx) return;
ft->setCurrentItem(fldrIdx);