1 //=========================================== 2 // Lumina-DE source code 3 // Copyright (c) 2015, Ken Moore 4 // Available under the 3-clause BSD license 5 // See the LICENSE file for full details 6 //=========================================== 7 #ifndef _LUMINA_DESKTOP_UTILITIES_TERMINAL_TRAY_ICON_H 8 #define _LUMINA_DESKTOP_UTILITIES_TERMINAL_TRAY_ICON_H 9 // QT Includes 10 #include <QApplication> 11 #include <QSystemTrayIcon> 12 #include <QMenu> 13 #include <QTimer> 14 #include <QSettings> 15 16 #include <LuminaXDG.h> 17 18 #include "TermWindow.h" 19 20 class TrayIcon : public QSystemTrayIcon { 21 Q_OBJECT 22 23 public: 24 TrayIcon(); 25 ~TrayIcon(); 26 27 //First run 28 void parseInputs(QStringList); //Note that this is only run on the primary process - otherwise it gets sent to the singleInstance slot below 29 30 public slots: 31 void slotSingleInstance(QStringList inputs = QStringList()); 32 void updateIcons(); 33 34 private: 35 bool termVisible; 36 TermWindow *TERM; 37 QMenu *ScreenMenu; 38 QStringList adjustInputs(QStringList); 39 QSettings *settings; 40 private slots: 41 //Action Buttons 42 void startCleanup(); 43 void stopApplication(); 44 void ChangeTopBottom(bool ontop); 45 void ChangeScreen(QAction*); 46 47 //Tray Updates 48 void setupContextMenu(); 49 void updateScreenMenu(); 50 void TrayActivated(QSystemTrayIcon::ActivationReason); 51 52 //Slots for the window visibility 53 void ToggleVisibility(); 54 void TermHidden(); 55 void TermVisible(); 56 57 }; 58 59 #endif 60