aboutsummaryrefslogtreecommitdiff
path: root/src/settingswidget.h
blob: c9931a26f39fc542722d78e8e7123d4d0f8c3803 (plain) (blame)
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
#ifndef SETTINGSWIDGET_H
#define SETTINGSWIDGET_H

#include "permissiondialog.h"
#include "utils.h"

#include <QSettings>
#include <QWidget>

namespace Ui {
class SettingsWidget;
}

class SettingsWidget : public QWidget {
  Q_OBJECT

signals:
  void updateWindowTheme();
  void updatePageTheme();
  void muteToggled(const bool checked);
  void autoPlayMediaToggled(const bool checked);
  void userAgentChanged(QString userAgentStr);
  void init_lock();
  void change_lock_password();
  void dictChanged(QString dict);
  void spellCheckChanged(bool checked);
  void notificationPopupTimeOutChanged();
  void notify(QString message);
  void zoomChanged();
  void zoomMaximizedChanged();

public:
  explicit SettingsWidget(QWidget *parent = nullptr,
                          QString engineCachePath = "",
                          QString enginePersistentStoragePath = "");
  ~SettingsWidget();

public slots:
  void refresh();
  void updateDefaultUAButton(const QString engineUA);
  void appLockSetChecked(bool checked);
  void setCurrentPasswordText(QString str);
  void loadDictionaries(QStringList dictionaries);

  void clearAllData();
protected slots:
  bool eventFilter(QObject *obj, QEvent *event);
  void closeEvent(QCloseEvent *event);

private slots:
  QString cachePath();
  QString persistentStoragePath();
  bool isChildOf(QObject *Of, QObject *self);
  void applyThemeQuirks();
  void on_appAutoLockcheckBox_toggled(bool checked);
  void on_applock_checkbox_toggled(bool checked);
  void on_autoLockDurationSpinbox_valueChanged(int arg1);
  void on_autoPlayMediaCheckBox_toggled(bool checked);
  void on_automaticThemeCheckBox_toggled(bool checked);
  void on_changeDefaultDownloadLocationPb_clicked();
  void on_chnageCurrentPasswordPushButton_clicked();
  void on_closeButtonActionComboBox_currentIndexChanged(int index);
  void on_defaultUserAgentButton_clicked();
  void on_deleteCache_clicked();
  void on_deletePersistentData_clicked();
  void on_dictComboBox_currentIndexChanged(const QString &arg1);
  void on_enableSpellCheck_toggled(bool checked);
  void on_minimizeOnTrayIconClick_toggled(bool checked);
  void on_muteAudioCheckBox_toggled(bool checked);
  void on_notificationCheckBox_toggled(bool checked);
  void on_notificationCombo_currentIndexChanged(int index);
  void on_notificationTimeOutspinBox_valueChanged(int arg1);
  void on_resetAppAutoLockPushButton_clicked();
  void on_setUserAgent_clicked();
  void on_showPermissionsButton_clicked();
  void on_showShortcutsButton_clicked();
  void on_startMinimized_toggled(bool checked);
  void on_styleComboBox_currentTextChanged(const QString &arg1);
  void on_themeComboBox_currentTextChanged(const QString &arg1);
  void on_tryNotification_clicked();
  void on_useNativeFileDialog_toggled(bool checked);
  void on_userAgentLineEdit_editingFinished();
  void on_userAgentLineEdit_textChanged(const QString &arg1);
  void on_viewPassword_clicked();
  void on_zoomMinusMaximized_clicked();
  void on_zoomMinus_clicked();
  void on_zoomPlusMaximized_clicked();
  void on_zoomPlus_clicked();
  void on_zoomResetMaximized_clicked();
  void on_zoomReset_clicked();
  void showSetApplockPasswordDialog();
  void themeSwitchTimerTimeout();
  void updateAutomaticTheme();

private:
  Ui::SettingsWidget *ui;
  QString engineCachePath, enginePersistentStoragePath;
  QSettings settings;
  QTimer *themeSwitchTimer;
};

#endif // SETTINGSWIDGET_H