28 #ifndef dooble_settings_h
29 #define dooble_settings_h
32 #include <QFutureWatcher>
34 #include <QProgressDialog>
35 #include <QReadWriteLock>
36 #include <QSqlDatabase>
38 #include <QWebEnginePage>
40 #include "dooble_main_window.h"
41 #include "ui_dooble_settings.h"
59 static QString cookie_policy_string(
int index);
60 static QString use_material_icons(
void);
61 static QString zoom_frame_location_string(
int index);
62 static QStringList s_spell_checker_dictionaries;
63 static QVariant getenv(
const QString &n);
64 static QVariant setting(
const QString &k,
65 const QVariant &default_value = QVariant(
""));
66 static bool has_dooble_credentials(
void);
67 static bool has_dooble_credentials_temporary(
void);
68 static bool set_setting(
const QString &key,
const QVariant &value);
69 static bool site_has_javascript_block_popup_exception(
const QUrl &url);
70 static int site_feature_permission(
const QUrl &url,
71 QWebEnginePage::Feature feature);
72 static void prepare_web_engine_environment_variables(
void);
73 static void remove_setting(
const QString &key);
74 void restore(
bool read_database);
75 void set_settings_path(
const QString &path);
76 void set_site_feature_permission(
const QUrl &url,
77 QWebEnginePage::Feature feature,
79 void show_normal(QWidget *parent);
80 void show_panel(dooble_settings::Panels panel);
86 void closeEvent(QCloseEvent *event);
87 void keyPressEvent(QKeyEvent *event);
88 void resizeEvent(QResizeEvent *event);
91 QFuture<QList<QByteArray> > m_pbkdf2_future;
92 QFutureWatcher<QList<QByteArray> > m_pbkdf2_future_watcher;
93 QPointer<QProgressDialog> m_pbkdf2_dialog;
94 Ui_dooble_settings m_ui;
95 static QHash<QString, QString> s_web_engine_settings_environment;
96 static QHash<QUrl, char> s_javascript_block_popup_exceptions;
97 static QMap<QString, QVariant> s_getenv;
98 static QMap<QString, QVariant> s_settings;
99 static QMultiMap<QUrl, QPair<int, bool> > s_site_features_permissions;
100 static QReadWriteLock s_getenv_mutex;
101 static QReadWriteLock s_settings_mutex;
102 static QString s_http_user_agent;
103 static void create_tables(QSqlDatabase &db);
104 void new_javascript_block_popup_exception(
const QUrl &url);
105 void prepare_fonts(
void);
106 void prepare_icons(
void);
107 void prepare_proxy(
bool save);
108 void prepare_table_statistics(
void);
109 void prepare_web_engine_settings(
void);
110 void purge_database_data(
void);
111 void purge_features_permissions(
void);
112 void purge_javascript_block_popup_exceptions(
void);
113 void save_fonts(
void);
114 void save_javascript_block_popup_exception(
const QUrl &url,
bool state);
115 void save_settings(
void);
118 void slot_apply(
void);
119 void slot_clear_cache(
void);
120 void slot_features_permissions_item_changed(QTableWidgetItem *item);
121 void slot_javascript_block_popups_exceptions_item_changed
122 (QTableWidgetItem *item);
123 void slot_new_javascript_block_popup_exception(
const QUrl &url);
124 void slot_new_javascript_block_popup_exception(
void);
125 void slot_page_button_clicked(
void);
126 void slot_password_changed(
void);
127 void slot_pbkdf2_future_finished(
void);
128 void slot_populate(
void);
129 void slot_proxy_type_changed(
int index);
130 void slot_remove_all_features_permissions(
void);
131 void slot_remove_all_javascript_block_popup_exceptions(
void);
132 void slot_remove_selected_features_permissions(
void);
133 void slot_remove_selected_javascript_block_popup_exceptions(
void);
134 void slot_reset(
void);
135 void slot_reset_credentials(
void);
136 void slot_reset_user_agent(
void);
137 void slot_save_credentials(
void);
138 void slot_web_engine_settings_item_changed(QTableWidgetItem *item);
142 void dooble_credentials_authenticated(
bool state);
143 void dooble_credentials_created(
void);
144 void populated(
void);
Definition: dooble_main_window.h:35
Definition: dooble_settings.h:44