diff options
author | 2022-02-28 18:08:28 +0530 | |
---|---|---|
committer | 2022-02-28 18:08:28 +0530 | |
commit | 9867a6b6279229d53fe59854a511c9eea9888427 (patch) | |
tree | cefdf3aa78e35741100a554f0fc25d75c4ef3065 /src/mainwindow.h | |
parent | 020ac6daeac226da90bc0c884a9b22a7da9baa99 (diff) | |
download | whatsie-9867a6b6279229d53fe59854a511c9eea9888427.tar.gz whatsie-9867a6b6279229d53fe59854a511c9eea9888427.zip |
build: migrate to qt 5.15
Diffstat (limited to 'src/mainwindow.h')
-rw-r--r-- | src/mainwindow.h | 147 |
1 files changed, 70 insertions, 77 deletions
diff --git a/src/mainwindow.h b/src/mainwindow.h index 98da302..dbc59e7 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -19,116 +19,109 @@ #include <QWebEngineCookieStore> #include <QWebEngineFullScreenRequest> #include <QWebEngineProfile> -#include <QWebEngineView> #include <QWebEngineSettings> +#include <QWebEngineView> #include <QRadioButton> #include <QWebEngineContextMenuData> +#include "lock.h" #include "notificationpopup.h" #include "requestinterceptor.h" #include "settingswidget.h" #include "webenginepage.h" -#include "lock.h" -#include "downloadmanagerwidget.h" #include "about.h" #include "dictionaries.h" -#include "webview.h" +#include "downloadmanagerwidget.h" #include "rateapp.h" +#include "webview.h" - -class MainWindow : public QMainWindow -{ - Q_OBJECT +class MainWindow : public QMainWindow { + Q_OBJECT public: - explicit MainWindow(QWidget *parent = nullptr); + explicit MainWindow(QWidget *parent = nullptr); public slots: - void updateWindowTheme(); - void updatePageTheme(); - - void handleWebViewTitleChanged(QString title); - void handleLoadFinished(bool loaded); - void handleDownloadRequested(QWebEngineDownloadItem *download); - void loadAppWithArgument(const QString &arg); + void updateWindowTheme(); + void updatePageTheme(); + void handleWebViewTitleChanged(QString title); + void handleLoadFinished(bool loaded); + void handleDownloadRequested(QWebEngineDownloadItem *download); + void loadAppWithArgument(const QString &arg); protected slots: - void closeEvent(QCloseEvent *event) override; - void resizeEvent(QResizeEvent *event); -private: - QPalette lightPalette; - void createActions(); - void createTrayIcon(); - void createWebEngine(); - - QSettings settings; + void closeEvent(QCloseEvent *event) override; + void resizeEvent(QResizeEvent *event) override; - QRegExp notificationsTitleRegExp; - QIcon trayIconRead; - QIcon trayIconUnread; +private: + QPalette lightPalette; + void createActions(); + void createTrayIcon(); + void createWebEngine(); - QAction *reloadAction; - QAction *minimizeAction; - QAction *restoreAction; - QAction *aboutAction; - QAction *settingsAction; - QAction *quitAction; - QAction *lockAction; - QAction *fullscreenAction; - QAction *openUrlAction; + QSettings settings; - QMenu *trayIconMenu; - QSystemTrayIcon *trayIcon; + QRegExp notificationsTitleRegExp; + QIcon trayIconRead; + QIcon trayIconUnread; - QWebEngineView *webEngine; - //QStatusBar *statusBar; + QAction *reloadAction; + QAction *minimizeAction; + QAction *restoreAction; + QAction *aboutAction; + QAction *settingsAction; + QAction *quitAction; + QAction *lockAction; + QAction *fullscreenAction; + QAction *openUrlAction; + QMenu *trayIconMenu; + QSystemTrayIcon *trayIcon; - SettingsWidget * settingsWidget = nullptr; + QWebEngineView *webEngine; - //void reload(); + SettingsWidget *settingsWidget = nullptr; - DownloadManagerWidget m_downloadManagerWidget; - QScopedPointer<QWebEngineProfile> m_otrProfile; + DownloadManagerWidget m_downloadManagerWidget; + QScopedPointer<QWebEngineProfile> m_otrProfile; - Lock *lockWidget = nullptr; + Lock *lockWidget = nullptr; - int correctlyLoaderRetries = 4; + int correctlyLoaderRetries = 4; - QStringList m_dictionaries; + QStringList m_dictionaries; private slots: - void iconActivated(QSystemTrayIcon::ActivationReason reason); - void messageClicked(); - void doReload(); - void showAbout(); - void notify(QString title, QString message); - void showSettings(); - void handleCookieAdded(const QNetworkCookie &cookie); - - QString getPageTheme(); - void toggleMute(const bool &checked); - void doAppReload(); - void askToReloadPage(); - void updateSettingsUserAgentWidget(); - void fullScreenRequested(QWebEngineFullScreenRequest request); - - void createWebPage(bool offTheRecord =false); - void init_settingWidget(); - void init_globalWebProfile(); - void check_window_state(); - void init_lock(); - void lockApp(); - - - void checkLoadedCorrectly(); - void loadingQuirk(QString test); - void setNotificationPresenter(QWebEngineProfile *profile); - void newChat(); - bool isPhoneNumber(const QString &phoneNumber); - void quitApp(); + void iconActivated(QSystemTrayIcon::ActivationReason reason); + void messageClicked(); + void doReload(); + void showAbout(); + void notify(QString title, QString message); + void showSettings(); + void handleCookieAdded(const QNetworkCookie &cookie); + + QString getPageTheme(); + void toggleMute(const bool &checked); + void doAppReload(); + void askToReloadPage(); + void updateSettingsUserAgentWidget(); + void fullScreenRequested(QWebEngineFullScreenRequest request); + + void createWebPage(bool offTheRecord = false); + void init_settingWidget(); + void init_globalWebProfile(); + void check_window_state(); + void init_lock(); + void lockApp(); + + void checkLoadedCorrectly(); + void loadingQuirk(QString test); + void setNotificationPresenter(QWebEngineProfile *profile); + void newChat(); + bool isPhoneNumber(const QString &phoneNumber); + void quitApp(); }; #endif // MAINWINDOW_H |