-
Notifications
You must be signed in to change notification settings - Fork 0
/
traylet.h
76 lines (62 loc) · 1.45 KB
/
traylet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef TRAYLET_H
#define TRAYLET_H
#include <QSystemTrayIcon>
#ifndef QT_NO_SYSTEMTRAYICON
#include <QString>
#include <QVector>
#include <QWidgetAction> // Inherits QAction
#include <QTextStream>
#include <QIcon>
#include <QMenu> // Context menu
#include <QMessageBox> // About dialog
#include <QApplication> // qApp and QCoreApplication
#include <QTimer> // Timer stuff
#include <QDebug> // QDebug
#include <QFile>
#include <QRegularExpression>
#include <QStringList>
class Traylet : public QSystemTrayIcon {
Q_OBJECT
public:
enum state {
GOOD,
BAD,
MISSING,
INIT
};
Traylet();
private slots:
void scan();
void setIcon();
void showAbout();
void notify();
void setNotifToggle();
private:
state currState;
bool blinkState;
bool notifToggle;
QString processedInput;
QString aboutContent;
QString notifyTitle;
QString notifyMessage;
QMessageBox * aboutDialog;
QMenu * trayMenu;
QIcon * goodIcon;
QIcon * badIcon_lit;
QIcon * badIcon_dim;
QIcon * missingIcon;
QTimer * scanTimer;
QTimer * iconBlinkTimer;
QTimer * notifyTimer;
QAction * notifToggleAction;
QAction * aboutButtonAction;
QAction * quitButtonAction;
void createAbout();
void createNotification();
void createTrayMenu();
QString getInput();
void cleanInput(QString &);
void setState();
};
#endif // QT_NO_SYSTEMTRAYICON
#endif // TRAYLET_H