aboutsummaryrefslogtreecommitdiff
path: root/dev-tools/systray-tester/Trayapp.h
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-09-10 13:31:20 -0400
committerKen Moore <moorekou@gmail.com>2015-09-10 13:31:20 -0400
commitdf5886d5ee692631d5bfdbcc75178bf14965e679 (patch)
tree0159ed73a74c768c63b1a6d9e6ee2775907c644c /dev-tools/systray-tester/Trayapp.h
parentAdd the new systemstart panel plugin to lumin-config. (diff)
downloadlumina-df5886d5ee692631d5bfdbcc75178bf14965e679.tar.gz
lumina-df5886d5ee692631d5bfdbcc75178bf14965e679.tar.bz2
lumina-df5886d5ee692631d5bfdbcc75178bf14965e679.zip
Add a quick app for testing system tray events - this is in the new "dev-tools" directory and is *not* indended to be used/packaged/distributed by anyone (just a simple app to run to perform some basic tests for system tray icons).
Diffstat (limited to 'dev-tools/systray-tester/Trayapp.h')
-rw-r--r--dev-tools/systray-tester/Trayapp.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/dev-tools/systray-tester/Trayapp.h b/dev-tools/systray-tester/Trayapp.h
new file mode 100644
index 00000000..54fa8a6b
--- /dev/null
+++ b/dev-tools/systray-tester/Trayapp.h
@@ -0,0 +1,49 @@
+// QT Includes
+#include <QApplication>
+#include <QSystemTrayIcon>
+#include <QMenu>
+#include <QTimer>
+
+#include <LuminaXDG.h>
+
+class TrayApp : public QSystemTrayIcon {
+ Q_OBJECT
+
+private:
+ QTimer *timer;
+ int iconnum;
+
+private slots:
+ void ChangeIcon(){
+ this->setToolTip("Icon Number:"+QString::number(iconnum));
+ QString ico;
+ //Rotate the icon every time
+ if(iconnum <=0){ ico = "arrow-left"; iconnum=1; }
+ else if(iconnum==1){ ico = "arrow-up"; iconnum=2; }
+ else if(iconnum==2){ ico = "arrow-right"; iconnum=3; }
+ else{ico = "arrow-down"; iconnum=0; }
+ this->setIcon( LXDG::findIcon(ico,"") );
+ }
+
+ void StopTest(){
+ QApplication::exit(0);
+ }
+
+public:
+ TrayApp() : QSystemTrayIcon(){
+ iconnum = 0;
+ this->setContextMenu(new QMenu());
+ this->contextMenu()->addAction("Stop Test", this, SLOT(StopTest()) );
+ timer = new QTimer(this);
+ timer->setInterval(3000); //change every 3 seconds
+ connect(timer, SIGNAL(timeout()), this, SLOT(ChangeIcon()) );
+ ChangeIcon(); //get it updated now
+ timer->start();
+ }
+ virtual ~TrayApp(){}
+
+
+
+
+
+};
bgstack15