-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathObsSettingsDialog.hpp
104 lines (82 loc) · 2.31 KB
/
ObsSettingsDialog.hpp
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
#ifndef OBSSETTINGSDIALOG_H
#define OBSSETTINGSDIALOG_H
#include <QSystemTrayIcon>
#ifndef QT_NO_SYSTEMTRAYICON
#include <QAction>
#include <QDialog>
#include <QGroupBox>
#include <QKeySequenceEdit>
#include <QHash>
#include <QLabel>
#include <QLineEdit>
#include <QListWidget>
#include <QListWidgetItem>
#include <QMenu>
#include <QPushButton>
#include <QSettings>
#include <QSpinBox>
#include <QString>
#include "ObsAutoRecord.hpp"
#include "ObsAutoRecordState.hpp"
#include "ObsUtils.hpp"
class ObsSettingsDialog : public QDialog
{
Q_OBJECT
public:
ObsSettingsDialog();
void setVisible(bool visible) override;
QKeySequence getPauseHotkey();
protected:
void closeEvent(QCloseEvent *event) override;
signals:
void onPauseHotkeyUpdated(QKeySequence pauseHotkey);
public slots:
void togglePaused();
private slots:
void iconActivated(QSystemTrayIcon::ActivationReason reason);
void intervalChanged();
void addressChanged();
void folderChanged();
void selectFolder();
void selectApp();
void removeApp();
void appsToWatchChanged();
void appSelected();
void updateState(ObsAutoRecordState state);
void toggleWindow();
void appEdit(QListWidgetItem* app);
void pauseHotkeyChanged();
private:
void createGeneralGroupBox();
void createActions();
void createTrayIcon();
QSettings settings;
ObsAutoRecord *oar;
QGroupBox *generalGroupBox;
QLabel *intervalLabel;
QLabel *addressLabel;
QLabel *folderLabel;
QLabel *pauseHotkeyLabel;
QSpinBox *intervalSpinBox;
QLineEdit *addressEdit;
QLineEdit *folderEdit;
QPushButton *folderSelectButton;
QKeySequenceEdit *pauseHotkeyEdit;
QListWidget *appList;
QPushButton *appSelectButton;
QPushButton *appRemoveButton;
QAction *showHideAction;
QAction *pauseResumeAction;
QAction *quitAction;
QSystemTrayIcon *trayIcon;
QMenu *trayIconMenu;
QHash<ObsAutoRecordState, QIcon> trayIcons;
QHash<ObsAutoRecordState, QString> trayToolTips;
QHash<QString, QString> appsToWatch;
const int DEFAULT_INTERVAL = 15;
const QString DEFAULT_ADDRESS = "ws://localhost:4444";
const QSize ICON_SIZE = QSize(32, 32);
const QString DEFAULT_PAUSE_HOTKEY = "Ctrl+Alt+End";
};
#endif // QT_NO_SYSTEMTRAYICON
#endif // OBSSETTINGSDIALOG_H