summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-04-24 17:40:18 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-04-24 19:01:45 (GMT)
commitf45aa5ce9ee21679abbe263ec2df7f0254331f4b (patch)
tree1b67cf3e7f19ff74ae65204f20574537894c6304 /Slimber/Qt/QtMenulet.h
parent9bff72701b1541180b92bfef8bac7a6921d19576 (diff)
downloadswift-f45aa5ce9ee21679abbe263ec2df7f0254331f4b.zip
swift-f45aa5ce9ee21679abbe263ec2df7f0254331f4b.tar.bz2
Add About dialog to Slimber/Qt.
Diffstat (limited to 'Slimber/Qt/QtMenulet.h')
-rw-r--r--Slimber/Qt/QtMenulet.h13
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;
};