summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-08-28 16:53:45 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-08-28 16:53:45 (GMT)
commit18c39e032395ee49796d330905caea4e28ef5608 (patch)
treed5da261d27feff987ea0cdd37992dd0a9d9b6ad2 /Swift/QtUI/QtSystemTray.cpp
parentabc4579164fa06b6f8a7d9d27d6e36c100cbcc4f (diff)
downloadswift-contrib-18c39e032395ee49796d330905caea4e28ef5608.zip
swift-contrib-18c39e032395ee49796d330905caea4e28ef5608.tar.bz2
Show the hidden roster on system tray click.
Diffstat (limited to 'Swift/QtUI/QtSystemTray.cpp')
-rw-r--r--Swift/QtUI/QtSystemTray.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Swift/QtUI/QtSystemTray.cpp b/Swift/QtUI/QtSystemTray.cpp
index f1c8e27..e85f13f 100644
--- a/Swift/QtUI/QtSystemTray.cpp
+++ b/Swift/QtUI/QtSystemTray.cpp
@@ -5,8 +5,9 @@
#include <QResource>
namespace Swift {
-QtSystemTray::QtSystemTray() : standardIcon_(":icons/tray-standard.png"), newMessageIcon_(":icons/new-chat.png") {
+QtSystemTray::QtSystemTray() : QObject(), standardIcon_(":icons/tray-standard.png"), newMessageIcon_(":icons/new-chat.png") {
trayIcon_ = new QSystemTrayIcon(standardIcon_);
+ connect(trayIcon_, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(handleIconActivated(QSystemTrayIcon::ActivationReason)));
trayIcon_->show();
}
@@ -18,4 +19,9 @@ void QtSystemTray::setUnreadMessages(bool some) {
trayIcon_->setIcon(some ? newMessageIcon_ : standardIcon_);
}
+void QtSystemTray::handleIconActivated(QSystemTrayIcon::ActivationReason reason) {
+ if (reason == QSystemTrayIcon::Trigger) {
+ emit clicked();
+ }
+}
}