-
Notifications
You must be signed in to change notification settings - Fork 1
/
settingsdialog.h
80 lines (63 loc) · 1.96 KB
/
settingsdialog.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
#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H
#include <QDialog>
#include <QString>
class QLabel;
class QLineEdit;
class QSpinBox;
class QPushButton;
class ExecutableValidator;
class SettingsDialog : public QDialog
{
// NOLINTBEGIN
Q_OBJECT
// NOLINTEND
public:
[[nodiscard]] static auto anyNonDefault() -> bool;
explicit SettingsDialog(QWidget *parent = nullptr);
void closeEvent(QCloseEvent *event) override;
void reject() override;
[[nodiscard]] auto allAcceptable() const -> bool;
[[nodiscard]] auto anyChanged() const -> bool;
signals:
void tmutilPathChanged(const QString& path);
void sudoPathChanged(const QString& path);
void tmutilStatusIntervalChanged(int newMsecs);
void tmutilDestinationsIntervalChanged(int newMsecs);
void pathInfoIntervalChanged(int newMsecs);
void allReset();
private:
void openTmutilPathDialog();
void openSudoPathDialog();
void handleTmutilPathFinished();
void handleSudoPathFinished();
void handleTmutilPathChanged(const QString& value);
void handleSudoPathChanged(const QString& value);
void handleStatTimeChanged(int value);
void handleDestTimeChanged(int value);
void handlePathInfoTimeChanged(int value);
void save();
void reset();
QPushButton *saveButton{};
QPushButton *resetButton{};
QPushButton *closeButton{};
QString tmutilPathStyle;
QLabel *tmutilPathLbl{};
QLineEdit *tmutilPathEdit{};
QPushButton *tmutilPathBtn{};
QString origStatTimeStyle;
QLabel *tmutilStatTimeLbl{};
QSpinBox *tmutilStatTimeEdit{};
QString origDestTimeStyle;
QLabel *tmutilDestTimeLbl{};
QSpinBox *tmutilDestTimeEdit{};
QString sudoPathStyle;
QLabel *sudoPathLbl{};
QLineEdit *sudoPathEdit{};
QPushButton *sudoPathBtn{};
QString origPathInfoTimeStyle;
QLabel *pathInfoTimeLbl{};
QSpinBox *pathInfoTimeEdit{};
ExecutableValidator *exePathValidator{};
};
#endif // SETTINGSDIALOG_H