QtPass  1.2.0-pre
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 <QAction>
5 #include <QApplication>
6 #include <QMainWindow>
7 #include <QMenu>
8 #include <QSystemTrayIcon>
9 #include <QWidget>
10 
15 class TrayIcon : public QWidget {
16  Q_OBJECT
17 
18 public:
19  explicit TrayIcon(QMainWindow *parent);
20  void showMessage(QString title, QString msg, int time);
21  void setVisible(bool visible);
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 
45 #endif // TRAYICON_H_
Handles the systemtray icon and menu.
Definition: trayicon.h:15
void setVisible(bool visible)
TrayIcon::setVisible show or hide the icon.
Definition: trayicon.cpp:27
TrayIcon(QMainWindow *parent)
TrayIcon::TrayIcon use a (system) tray icon with a nice QtPass logo on it (currently) only Quits...
Definition: trayicon.cpp:8
void showMessage(QString title, QString msg, int time)
TrayIcon::showMessage show a systray message for notification.
Definition: trayicon.cpp:106
void iconActivated(QSystemTrayIcon::ActivationReason reason)
TrayIcon::iconActivated you clicked on the trayicon.
Definition: trayicon.cpp:87
void showHideParent()
TrayIcon::showHideParent toggle app visibility.
Definition: trayicon.cpp:76