-
Notifications
You must be signed in to change notification settings - Fork 3
/
mainwindow.h
105 lines (75 loc) · 2.07 KB
/
mainwindow.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QEvent>
#include <QSystemTrayIcon>
#include <QSettings>
#include <QTimer>
#include <QMenu>
#include <QUuid>
#include "pomodoro.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
void tweakUI();
void buildMenu();
void buildTrayIcon();
void buildSounds();
void loadSettings();
void saveSettings();
private slots:
void doTimerStart();
void doTimerStop();
void doTimerPause();
void onBlinkTimerTimeout();
void doShowPrefs();
void doQuit();
void onStateTransition(Pomodoro::PomodoroState oldState, Pomodoro::PomodoroState newState);
void onMenuShow();
void onMenuHide();
void onMenuTimerTick();
// Preferences panel
void on_pomodoroToLongBreakSpinner_valueChanged(int arg1);
void on_longBreakLengthSlider_valueChanged(int value);
void on_shortBreakLengthSlider_valueChanged(int value);
void on_pomodoroLengthSlider_valueChanged(int value);
void on_pomodoroLengthSlider_sliderPressed();
void on_pomodoroLengthSlider_sliderReleased();
void on_shortBreakLengthSlider_sliderPressed();
void on_shortBreakLengthSlider_sliderReleased();
void on_longBreakLengthSlider_sliderPressed();
void on_longBreakLengthSlider_sliderReleased();
void on_playSoundCombo_currentIndexChanged(const QString &item);
void on_playSoundCheck_toggled(bool checked);
void on_displayNotificationsCheck_toggled(bool checked);
void on_blinkIconCheck_toggled(bool checked);
protected:
bool event(QEvent* event);
void customEvent(QEvent* event);
private:
Ui::MainWindow *ui;
QSystemTrayIcon* tray_icon;
QMenu* tray_menu;
QTimer* tray_menu_timer;
QAction* state_action;
QString state_action_text;
QAction* start_action;
QAction* stop_action;
Pomodoro* pomodoro;
bool sound_enabled;
QString sound_name;
bool notifications_enabled;
bool blink_enabled;
QTimer* blink_timer;
int blink_count;
QIcon blink_icon[2];
QSettings* settings;
};
#endif // MAINWINDOW_H