X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=src%2Fwidgets%2FTabWidget.cpp;h=84cd3aca089de34bcd188e3e5baa006508254595;hb=e715eca23297fb10dcf70e4c8bb2712413d16e3d;hp=2b14018ca6b419a8eb5dec608e66ca83024f43eb;hpb=c76e7c8baa9761d771e5891ee699ea6ddc78c23a;p=PrivacyBrowserPC.git diff --git a/src/widgets/TabWidget.cpp b/src/widgets/TabWidget.cpp index 2b14018..84cd3ac 100644 --- a/src/widgets/TabWidget.cpp +++ b/src/widgets/TabWidget.cpp @@ -344,12 +344,12 @@ PrivacyWebEngineView* TabWidget::addTab(const bool removeUrlLineEditFocus, const } }); - // Update the zoom factor when changed by CTRL-Scrolling. This can be modified when is fixed. + // Update the zoom actions when changed by CTRL-Scrolling. This can be modified when is fixed. connect(webEnginePagePointer, &QWebEnginePage::contentsSizeChanged, [webEnginePagePointer, this] () { - // Only update the zoom factor action text if this is the current tab. + // Only update the zoom actions if this is the current tab. if (webEnginePagePointer == currentWebEnginePagePointer) - emit updateZoomFactorAction(webEnginePagePointer->zoomFactor()); + emit updateZoomActions(webEnginePagePointer->zoomFactor()); }); // Display find text results. @@ -673,6 +673,24 @@ std::list* TabWidget::getCookieList() const return currentPrivacyWebEngineViewPointer->cookieListPointer; } +QIcon TabWidget::getCurrentTabFavoritIcon() const +{ + // Return the current Privacy WebEngine favorite icon. + return currentPrivacyWebEngineViewPointer->favoriteIcon; +} + +QString TabWidget::getCurrentTabTitle() const +{ + // Return the current Privacy WebEngine title. + return currentPrivacyWebEngineViewPointer->title(); +} + +QString TabWidget::getCurrentTabUrl() const +{ + // Return the current Privacy WebEngine URL as a string. + return currentPrivacyWebEngineViewPointer->url().toString(); +} + QString& TabWidget::getDomainSettingsName() const { // Return the domain settings name. @@ -918,9 +936,6 @@ void TabWidget::showSaveDialog(QWebEngineDownloadItem *webEngineDownloadItemPoin // Prevent the notification from being autodeleted if it is closed. Otherwise, the updates to the notification below cause a crash. fileDownloadNotificationPointer->setAutoDelete(false); - // Display the notification. - fileDownloadNotificationPointer->sendEvent(); - // Handle clicks on the cancel button. connect(fileDownloadNotificationPointer, &KNotification::action1Activated, [webEngineDownloadItemPointer, saveFileName] () { @@ -985,6 +1000,9 @@ void TabWidget::showSaveDialog(QWebEngineDownloadItem *webEngineDownloadItemPoin fileDownloadNotificationPointer->update(); }); + // Display the notification. + fileDownloadNotificationPointer->sendEvent(); + // Start the download. webEngineDownloadItemPointer->accept(); } @@ -1071,12 +1089,13 @@ void TabWidget::updateUiFromWebEngineView(const PrivacyWebEngineView *privacyWeb if (privacyWebEngineViewPointer == currentPrivacyWebEngineViewPointer) { // Update the UI. + emit updateDefaultZoomFactor(currentPrivacyWebEngineViewPointer->defaultZoomFactor); emit updateDomainSettingsIndicator(currentPrivacyWebEngineViewPointer->domainSettingsName != QLatin1String("")); emit updateJavaScriptAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::JavascriptEnabled)); emit updateLocalStorageAction(currentPrivacyWebEngineViewPointer->localStorageEnabled); emit updateDomStorageAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled)); emit updateUserAgentActions(currentWebEngineProfilePointer->httpUserAgent(), true); - emit updateZoomFactorAction(currentPrivacyWebEngineViewPointer->zoomFactor()); + emit updateZoomActions(currentPrivacyWebEngineViewPointer->zoomFactor()); } } @@ -1094,6 +1113,7 @@ void TabWidget::updateUiWithTabSettings() emit clearUrlLineEditFocus(); // Update the actions. + emit updateDefaultZoomFactor(currentPrivacyWebEngineViewPointer->defaultZoomFactor); emit updateBackAction(currentWebEngineHistoryPointer->canGoBack()); emit updateCookiesAction(currentPrivacyWebEngineViewPointer->cookieListPointer->size()); emit updateDomStorageAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled)); @@ -1101,7 +1121,7 @@ void TabWidget::updateUiWithTabSettings() emit updateJavaScriptAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::JavascriptEnabled)); emit updateLocalStorageAction(currentPrivacyWebEngineViewPointer->localStorageEnabled); emit updateUserAgentActions(currentWebEngineProfilePointer->httpUserAgent(), true); - emit updateZoomFactorAction(currentPrivacyWebEngineViewPointer->zoomFactor()); + emit updateZoomActions(currentPrivacyWebEngineViewPointer->zoomFactor()); // Update the URL. emit updateWindowTitle(currentPrivacyWebEngineViewPointer->title());