summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-14 23:32:05 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-14 23:32:05 +0000
commit6d83f2c4e31c985122f6de9dab69d9f1d727b48a (patch)
treeeeccd1e9d41b24faee3933e7de9e90237c810e21
parent9850ee57acacfaf0546fc5bb6ae62cccf638feac (diff)
downloadtdepim-6d83f2c4e31c985122f6de9dab69d9f1d727b48a.tar.gz
tdepim-6d83f2c4e31c985122f6de9dab69d9f1d727b48a.zip
Fixed quit from kmail system tray
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1163733 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--kmail/kmsystemtray.cpp12
-rw-r--r--kmail/kmsystemtray.h1
2 files changed, 10 insertions, 3 deletions
diff --git a/kmail/kmsystemtray.cpp b/kmail/kmsystemtray.cpp
index 4e6463c15..e4d3a9879 100644
--- a/kmail/kmsystemtray.cpp
+++ b/kmail/kmsystemtray.cpp
@@ -102,6 +102,8 @@ KMSystemTray::KMSystemTray(TQWidget *parent, const char *name)
connect( kmkernel->acctMgr(), TQT_SIGNAL( checkedMail( bool, bool, const TQMap<TQString, int> & ) ),
TQT_SLOT( updateNewMessages() ) );
+
+ connect( this, TQT_SIGNAL( quitSelected() ), TQT_SLOT( tray_quit() ) );
}
void KMSystemTray::buildPopupMenu()
@@ -133,9 +135,13 @@ void KMSystemTray::buildPopupMenu()
mPopupMenu->insertSeparator();
KMainWindow *mainWin = ::qt_cast<KMainWindow*>(kmkernel->getKMMainWidget()->topLevelWidget());
- if(mainWin)
- if ( ( action=mainWin->actionCollection()->action("file_quit") ) )
- action->plug( mPopupMenu );
+ mPopupMenu->insertItem( SmallIcon("exit"), i18n("&Quit"), this, TQT_SLOT(maybeQuit()) );
+}
+
+void KMSystemTray::tray_quit()
+{
+ // Quit all of KMail
+ kapp->quit();
}
KMSystemTray::~KMSystemTray()
diff --git a/kmail/kmsystemtray.h b/kmail/kmsystemtray.h
index 21f631814..ab80f362a 100644
--- a/kmail/kmsystemtray.h
+++ b/kmail/kmsystemtray.h
@@ -57,6 +57,7 @@ private slots:
void foldersChanged();
void selectedAccount(int);
void updateNewMessages();
+ void tray_quit();
protected:
void mousePressEvent(TQMouseEvent *);