diff options
author | 2023-09-19 02:01:41 +0600 | |
---|---|---|
committer | 2023-09-19 02:01:41 +0600 | |
commit | 36d10b4b6359b5cf3ff0e37f2330dfaf91cbf530 (patch) | |
tree | cad68505e3dcff4e8d37c5a6a052240d8a935efb /src/mainwindow.h | |
parent | 35d85d38d02d97e1c63729bb3301f46bb6f96728 (diff) | |
parent | 906ca7eb436dc9944d43f5b7f6ae7b44afc2a3e7 (diff) | |
download | whatsie-36d10b4b6359b5cf3ff0e37f2330dfaf91cbf530.tar.gz whatsie-36d10b4b6359b5cf3ff0e37f2330dfaf91cbf530.zip |
Update upstream source from tag 'upstream/4.14.1'
Update to upstream version '4.14.1'
with Debian dir 267b96a979689ac47077c72b576cf79da29f8ff2
Diffstat (limited to 'src/mainwindow.h')
-rw-r--r-- | src/mainwindow.h | 105 |
1 files changed, 51 insertions, 54 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h index 4ca25d5..c5e2821 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -11,8 +11,6 @@ #include <QMessageBox> #include <QProgressBar> #include <QRadioButton> -#include <QRegExp> -#include <QSettings> #include <QStatusBar> #include <QStyle> #include <QStyleFactory> @@ -33,6 +31,7 @@ #include "rateapp.h" #include "requestinterceptor.h" #include "settingswidget.h" +#include "theme.h" #include "webenginepage.h" #include "webview.h" @@ -42,23 +41,25 @@ public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); + void loadSchemaUrl(const QString &arg); + void alreadyRunning(bool notify = false); + void runMinimized(); + void notify(QString title, QString message); + void doReload(bool byPassCache = false, bool isAskedByCLI = false, + bool byLoadingQuirk = false); + public slots: void updateWindowTheme(); void updatePageTheme(); - void handleWebViewTitleChanged(QString title); + void handleWebViewTitleChanged(const QString &title); void handleLoadFinished(bool loaded); void handleDownloadRequested(QWebEngineDownloadItem *download); - void loadSchemaUrl(const QString &arg); void showSettings(bool isAskedByCLI = false); void showAbout(); void lockApp(); - void runMinimized(); - void alreadyRunning(bool notify = false); - void notify(QString title, QString message); void toggleTheme(); - void doReload(bool byPassCache = false, bool isAskedByCLI = false, - bool byLoadingQuirk = false); void newChat(); + protected slots: void closeEvent(QCloseEvent *event) override; void resizeEvent(QResizeEvent *event) override; @@ -66,71 +67,67 @@ protected slots: private: const QIcon getTrayIcon(const int ¬ificationCount) const; - QPalette lightPalette, darkPalette; void createActions(); void createTrayIcon(); void createWebEngine(); - - QSettings settings; - QRegExp notificationsTitleRegExp; - QIcon trayIconNormal; - QRegExp unreadMessageCountRegExp; - - QAction *reloadAction; - QAction *minimizeAction; - QAction *restoreAction; - QAction *aboutAction; - QAction *settingsAction; - QAction *toggleThemeAction; - QAction *quitAction; - QAction *lockAction; - QAction *fullscreenAction; - QAction *openUrlAction; - - QMenu *trayIconMenu; - QSystemTrayIcon *trayIcon; - QWebEngineView *webEngine; - SettingsWidget *settingsWidget = nullptr; - DownloadManagerWidget downloadManagerWidget; - QScopedPointer<QWebEngineProfile> otrProfile; - Lock *lockWidget = nullptr; - int correctlyLoaderRetries = 4; - QStringList dictionaries; - AutoLockEventFilter *autoLockEventFilter = nullptr; - -private slots: - - QString getPageTheme(); - void iconActivated(QSystemTrayIcon::ActivationReason reason); - void messageClicked(); + QString getPageTheme() const; void handleCookieAdded(const QNetworkCookie &cookie); - void toggleMute(const bool &checked); void doAppReload(); void askToReloadPage(); void updateSettingsUserAgentWidget(); - void fullScreenRequested(QWebEngineFullScreenRequest request); void createWebPage(bool offTheRecord = false); void initSettingWidget(); void initGlobalWebProfile(); - void checkWindowState(); - void initLock(); void tryLock(); void checkLoadedCorrectly(); - void loadingQuirk(QString test); + void loadingQuirk(const QString &test); void setNotificationPresenter(QWebEngineProfile *profile); - void quitApp(); void initRateWidget(); - void initThemes(); void handleZoomOnWindowStateChange(const QWindowStateChangeEvent *ev); void handleZoom(); - void changeLockPassword(); void forceLogOut(); - void tryLogOut(); bool isLoggedIn(); + void tryLogOut(); void initAutoLock(); - void appAutoLockChanged(); - void triggerNewChat(QString phone, QString text); + void triggerNewChat(const QString &phone, const QString &text); void restoreMainWindow(); + + QIcon m_trayIconNormal; + QRegularExpression m_notificationsTitleRegExp; + QRegularExpression m_unreadMessageCountRegExp; + DownloadManagerWidget m_downloadManagerWidget; + QScopedPointer<QWebEngineProfile> m_otrProfile; + int m_correctlyLoadedRetries = 4; + QStringList m_dictionaries; + + QAction *m_reloadAction = nullptr; + QAction *m_minimizeAction = nullptr; + QAction *m_restoreAction = nullptr; + QAction *m_aboutAction = nullptr; + QAction *m_settingsAction = nullptr; + QAction *m_toggleThemeAction = nullptr; + QAction *m_quitAction = nullptr; + QAction *m_lockAction = nullptr; + QAction *m_fullscreenAction = nullptr; + QAction *m_openUrlAction = nullptr; + + QMenu *m_trayIconMenu = nullptr; + QSystemTrayIcon *m_systemTrayIcon = nullptr; + QWebEngineView *m_webEngine = nullptr; + SettingsWidget *m_settingsWidget = nullptr; + Lock *m_lockWidget = nullptr; + AutoLockEventFilter *m_autoLockEventFilter = nullptr; + +private slots: + void iconActivated(QSystemTrayIcon::ActivationReason reason); + void messageClicked(); + void toggleMute(const bool &checked); + void fullScreenRequested(QWebEngineFullScreenRequest request); + void checkWindowState(); + void initLock(); + void quitApp(); + void changeLockPassword(); + void appAutoLockChanged(); }; #endif // MAINWINDOW_H |