28 #ifndef dooble_settings_h
29 #define dooble_settings_h
32 #include <QFutureWatcher>
33 #include <QMainWindow>
35 #include <QProgressDialog>
36 #include <QReadWriteLock>
37 #include <QSqlDatabase>
39 #include <QWebEnginePage>
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 setting(
const QString &k,
64 const QVariant &default_value = QVariant(
""));
65 static bool has_dooble_credentials(
void);
66 static bool has_dooble_credentials_temporary(
void);
67 static bool set_setting(
const QString &key,
const QVariant &value);
68 static bool site_has_javascript_block_popup_exception(
const QUrl &url);
69 static int site_feature_permission(
const QUrl &url,
70 QWebEnginePage::Feature feature);
71 static void remove_setting(
const QString &key);
72 void restore(
bool read_database);
73 void set_site_feature_permission(
const QUrl &url,
74 QWebEnginePage::Feature feature,
76 void show_panel(dooble_settings::Panels panel);
80 void showNormal(
void);
83 void closeEvent(QCloseEvent *event);
84 void keyPressEvent(QKeyEvent *event);
85 void resizeEvent(QResizeEvent *event);
88 QFuture<QList<QByteArray> > m_pbkdf2_future;
89 QFutureWatcher<QList<QByteArray> > m_pbkdf2_future_watcher;
90 QPointer<QProgressDialog> m_pbkdf2_dialog;
91 Ui_dooble_settings m_ui;
92 static QHash<QUrl, char> s_javascript_block_popup_exceptions;
93 static QMap<QString, QVariant> s_settings;
94 static QMultiMap<QUrl, QPair<int, bool> > s_site_features_permissions;
95 static QReadWriteLock s_settings_mutex;
96 static QString s_http_user_agent;
97 static void create_tables(QSqlDatabase &db);
98 void new_javascript_block_popup_exception(
const QUrl &url);
99 void prepare_fonts(
void);
100 void prepare_icons(
void);
101 void prepare_proxy(
bool save);
102 void prepare_table_statistics(
void);
103 void purge_database_data(
void);
104 void purge_features_permissions(
void);
105 void purge_javascript_block_popup_exceptions(
void);
106 void save_fonts(
void);
107 void save_javascript_block_popup_exception(
const QUrl &url,
bool state);
108 void save_settings(
void);
111 void slot_apply(
void);
112 void slot_clear_cache(
void);
113 void slot_features_permissions_item_changed(QTableWidgetItem *item);
114 void slot_javascript_block_popups_exceptions_item_changed
115 (QTableWidgetItem *item);
116 void slot_new_javascript_block_popup_exception(
const QUrl &url);
117 void slot_new_javascript_block_popup_exception(
void);
118 void slot_page_button_clicked(
void);
119 void slot_pbkdf2_future_finished(
void);
120 void slot_populate(
void);
121 void slot_proxy_type_changed(
int index);
122 void slot_remove_all_features_permissions(
void);
123 void slot_remove_all_javascript_block_popup_exceptions(
void);
124 void slot_remove_selected_features_permissions(
void);
125 void slot_remove_selected_javascript_block_popup_exceptions(
void);
126 void slot_reset(
void);
127 void slot_reset_credentials(
void);
128 void slot_reset_user_agent(
void);
129 void slot_save_credentials(
void);
133 void dooble_credentials_authenticated(
bool state);
134 void dooble_credentials_created(
void);
135 void populated(
void);