QtPass  1.2.1
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 
22 signals:
23 
24 public slots:
25  void showHideParent();
26  void iconActivated(QSystemTrayIcon::ActivationReason reason);
27 
28 private:
29  void createActions();
30  void createTrayIcon();
31 
32  QAction *showAction;
33  QAction *hideAction;
34  QAction *minimizeAction;
35  QAction *maximizeAction;
36  QAction *restoreAction;
37  QAction *quitAction;
38 
39  QSystemTrayIcon *sysTrayIcon;
40  QMenu *trayIconMenu;
41  QMainWindow *parentwin;
42 };
43 
44 #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:32
TrayIcon(QMainWindow *parent)
TrayIcon::TrayIcon use a (system) tray icon with a nice QtPass logo on it (currently) only Quits...
Definition: trayicon.cpp:12
void showMessage(QString title, QString msg, int time)
TrayIcon::showMessage show a systray message for notification.
Definition: trayicon.cpp:111
void iconActivated(QSystemTrayIcon::ActivationReason reason)
TrayIcon::iconActivated you clicked on the trayicon.
Definition: trayicon.cpp:92
void showHideParent()
TrayIcon::showHideParent toggle app visibility.
Definition: trayicon.cpp:81