]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/widgets/TabWidget.h
Fix crash when closing second window with loading tab. https://redmine.stoutner...
[PrivacyBrowserPC.git] / src / widgets / TabWidget.h
index 6130fc3ee75fc27b987c26c1e726a4933e159b7d..ea9efe52048ecb63f6e6be8e35c90b54f0166bf9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2022-2023 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
  *
@@ -28,6 +28,7 @@
 #include <KLineEdit>
 
 // Qt toolkit headers.
+#include <QMovie>
 #include <QPushButton>
 #include <QTabWidget>
 #include <QWebEngineCookieStore>
@@ -44,13 +45,14 @@ class TabWidget : public QWidget
 
 public:
     // The primary contructor.
-    explicit TabWidget(QWidget *parent);
+    explicit TabWidget(QWidget *windowPointer);
 
     // The destructor.
     ~TabWidget();
 
     // The public functions.
-    void applyOnTheFlyZoomFactor(const double &zoomFactor);
+    void applyOnTheFlyZoomFactor(const double &zoomFactor) const;
+    void applySpellCheckLanguages() const;
     PrivacyWebEngineView* loadBlankInitialWebsite();
     void loadInitialWebsite();
     void findPrevious(const QString &text) const;
@@ -95,7 +97,6 @@ public Q_SLOTS:
     PrivacyWebEngineView* addTab(const bool removeUrlLineEditFocus=false, const bool backgroundTab=false);
     void applyApplicationSettings();
     void applyDomainSettingsAndReload();
-    void applyDomainSettingsWithoutReloading(const QString &hostname);
     void applyOnTheFlySearchEngine(QAction *searchEngineActionPointer);
     void applyOnTheFlyUserAgent(QAction *userAgentActionPointer) const;
     void back() const;
@@ -120,25 +121,25 @@ private Q_SLOTS:
     void pageLinkHovered(const QString &linkUrl) const;
     void printWebpage(QPrinter *printerPointer) const;
     void showSaveDialog(QWebEngineDownloadItem *downloadItemPointer);
+    void stopLoadingFavoriteIconMovie() const;
+    void updateUiFromWebEngineView(const PrivacyWebEngineView *privacyWebEngineViewPointer) const;
     void updateUiWithTabSettings();
-    void useNativeDownloader(QUrl &downloadUrl, QString &suggestedFileName);
+    void useNativeKdeDownloader(QUrl &downloadUrl, QString &suggestedFileName);
 
 private:
     // The private variables.
-    double currentZoomFactor;  // This can be removed once <https://redmine.stoutner.com/issues/799> has been resolved.
     PrivacyWebEngineView *currentPrivacyWebEngineViewPointer;
     QWebEngineCookieStore *currentWebEngineCookieStorePointer;
     QWebEngineHistory *currentWebEngineHistoryPointer;
     QWebEnginePage *currentWebEnginePagePointer;
     QWebEngineProfile *currentWebEngineProfilePointer;
     QWebEngineSettings *currentWebEngineSettingsPointer;
-    QIcon defaultTabIcon = QIcon::fromTheme(QStringLiteral("globe"));
+    QIcon defaultFavoriteIcon = QIcon::fromTheme(QStringLiteral("globe"));
+    bool isRunningKde = false;
+    QMovie *loadingFavoriteIconMoviePointer;
     QString searchEngineUrl;
-    QTabWidget *tabWidgetPointer;
+    QTabWidget *qTabWidgetPointer;
     UserAgentHelper *userAgentHelperPointer;
     bool wipingCurrentFindTextSelection = false;
-
-    // The private functions.
-    void applyDomainSettings(const QString &hostname, const bool reloadWebsite);
 };
 #endif