QtPass  1.2.3
Multi-platform GUI for pass, the standard unix password manager.
trayicon.h
Go to the documentation of this file.
1 #ifndef TRAYICON_H_
2 #define TRAYICON_H_
3 
4 #include <QSystemTrayIcon>
5 #include <QWidget>
6 
11 class QAction;
12 class QMainWindow;
13 class QMenu;
14 class TrayIcon : public QWidget {
15  Q_OBJECT
16 
17 public:
18  explicit TrayIcon(QMainWindow *parent);
19  void showMessage(QString title, QString msg, int time);
20  void setVisible(bool visible);
21  bool getIsAllocated();
22 
23 signals:
24 
25 public slots:
26  void showHideParent();
27  void iconActivated(QSystemTrayIcon::ActivationReason reason);
28 
29 private:
30  void createActions();
31  void createTrayIcon();
32 
33  QAction *showAction;
34  QAction *hideAction;
35  QAction *minimizeAction;
36  QAction *maximizeAction;
37  QAction *restoreAction;
38  QAction *quitAction;
39 
40  QSystemTrayIcon *sysTrayIcon;
41  QMenu *trayIconMenu;
42  QMainWindow *parentwin;
43 
44  bool isAllocated;
45 };
46 
47 #endif // TRAYICON_H_
Handles the systemtray icon and menu.
Definition: trayicon.h:14
void setVisible(bool visible)
TrayIcon::setVisible show or hide the icon.
Definition: trayicon.cpp:50
TrayIcon(QMainWindow *parent)
TrayIcon::TrayIcon use a (system) tray icon with a nice QtPass logo on it (currently) only Quits...
Definition: trayicon.cpp:13
void showMessage(QString title, QString msg, int time)
TrayIcon::showMessage show a systray message for notification.
Definition: trayicon.cpp:134
void iconActivated(QSystemTrayIcon::ActivationReason reason)
TrayIcon::iconActivated you clicked on the trayicon.
Definition: trayicon.cpp:115
void showHideParent()
TrayIcon::showHideParent toggle app visibility.
Definition: trayicon.cpp:104
bool getIsAllocated()
TrayIcon::getIsAllocated return if TrayIcon is allocated.
Definition: trayicon.cpp:60