X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=src%2Fwidgets%2FTabWidget.cpp;h=e19244e59568a5df0d4089d5e7f3a7e9f117aab7;hb=c8dd222118f460f3cbcd15678597c3a3f4f986b2;hp=0a7b3ca1d458ae6d0b97d735545f1fd5bfdcc28c;hpb=831ccbba28b7bae2abfe964428d126f44ae43f1b;p=PrivacyBrowserPC.git diff --git a/src/widgets/TabWidget.cpp b/src/widgets/TabWidget.cpp index 0a7b3ca..e19244e 100644 --- a/src/widgets/TabWidget.cpp +++ b/src/widgets/TabWidget.cpp @@ -487,8 +487,17 @@ void TabWidget::applyApplicationSettings() void TabWidget::applyDomainSettingsAndReload() { - // Apply the domain settings. `true` reloads the website. - currentPrivacyWebEngineViewPointer->applyDomainSettings(currentPrivacyWebEngineViewPointer->url().host(), true); + // Get the number of tabs. + int numberOfTabs = qTabWidgetPointer->count(); + + // Apply the domain settings to each WebEngine. + for (int i = 0; i < numberOfTabs; ++i) { + // Get the WebEngine view pointer. + PrivacyWebEngineView *privacyWebEngineViewPointer = qobject_cast(qTabWidgetPointer->widget(i)); + + // Apply the spatial navigation settings to each page. + privacyWebEngineViewPointer->applyDomainSettings(privacyWebEngineViewPointer->url().host(), true); + } } void TabWidget::applyOnTheFlySearchEngine(QAction *searchEngineActionPointer) @@ -828,6 +837,13 @@ void TabWidget::refresh() const currentPrivacyWebEngineViewPointer->reload(); } +void TabWidget::reloadAndBypassCache() const +{ + // Reload the website, bypassing the cache. + currentWebEnginePagePointer->triggerAction(QWebEnginePage::ReloadAndBypassCache); +} + + void TabWidget::setTabBarVisible(const bool visible) const { // Set the tab bar visibility. @@ -887,15 +903,15 @@ void TabWidget::showSaveDialog(QWebEngineDownloadItem *webEngineDownloadItemPoin // Set the notification text. fileDownloadNotificationPointer->setText(i18nc("Downloading notification text", "Downloading %1", saveFileName)); + // Get the download icon from the theme. + QIcon downloadIcon = QIcon::fromTheme(QLatin1String("download"), QIcon::fromTheme(QLatin1String("document-save"))); + // Set the notification icon. - fileDownloadNotificationPointer->setIconName(QLatin1String("download")); + fileDownloadNotificationPointer->setIconName(downloadIcon.name()); // Set the action list cancel button. fileDownloadNotificationPointer->setActions(QStringList({i18nc("Download notification action","Cancel")})); - // Set the notification to display indefinitely. - fileDownloadNotificationPointer->setFlags(KNotification::Persistent); - // Prevent the notification from being autodeleted if it is closed. Otherwise, the updates to the notification below cause a crash. fileDownloadNotificationPointer->setAutoDelete(false);