diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-04-24 17:40:18 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-04-24 19:01:45 (GMT) |
commit | f45aa5ce9ee21679abbe263ec2df7f0254331f4b (patch) | |
tree | 1b67cf3e7f19ff74ae65204f20574537894c6304 /Slimber/Qt/QtMenulet.h | |
parent | 9bff72701b1541180b92bfef8bac7a6921d19576 (diff) | |
download | swift-contrib-f45aa5ce9ee21679abbe263ec2df7f0254331f4b.zip swift-contrib-f45aa5ce9ee21679abbe263ec2df7f0254331f4b.tar.bz2 |
Add About dialog to Slimber/Qt.
Diffstat (limited to 'Slimber/Qt/QtMenulet.h')
-rw-r--r-- | Slimber/Qt/QtMenulet.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Slimber/Qt/QtMenulet.h b/Slimber/Qt/QtMenulet.h index 19458b3..08bae0c 100644 --- a/Slimber/Qt/QtMenulet.h +++ b/Slimber/Qt/QtMenulet.h @@ -12,8 +12,10 @@ #include <QSystemTrayIcon> #include <QObject> #include <QPixmap> +#include <QPointer> #include "Slimber/Menulet.h" +#include "Slimber/Qt/QtAboutDialog.h" class QtMenulet : public QObject, public Menulet { Q_OBJECT @@ -33,7 +35,7 @@ class QtMenulet : public QObject, public Menulet { } void addAboutItem() { - menu.addAction("About"); + menu.addAction("About", this, SLOT(showAboutDialog())); } void addRestartItem() { @@ -59,6 +61,14 @@ class QtMenulet : public QObject, public Menulet { private slots: void showAboutDialog() { + if (aboutDialog) { + aboutDialog->raise(); + aboutDialog->activateWindow(); + } + else { + aboutDialog = new QtAboutDialog(); + aboutDialog->show(); + } } void restart() { @@ -68,4 +78,5 @@ class QtMenulet : public QObject, public Menulet { private: QMenu menu; QSystemTrayIcon trayIcon; + QPointer<QtAboutDialog> aboutDialog; }; |