X-Git-Url: https://gitweb.stoutner.com/?a=blobdiff_plain;f=src%2Fwidgets%2FTabWidget.cpp;h=ff8563c96a9b5d8b311aca160f51b3098e5ab41c;hb=refs%2Fheads%2Fmaster;hp=f65c79ea2177b404eef157f441245dab7175ed73;hpb=ce90749b5fc2c4a3fcee6daee60c0d6e2aa0e1d6;p=PrivacyBrowserPC.git diff --git a/src/widgets/TabWidget.cpp b/src/widgets/TabWidget.cpp index f65c79e..0728ecc 100644 --- a/src/widgets/TabWidget.cpp +++ b/src/widgets/TabWidget.cpp @@ -1,7 +1,7 @@ /* * Copyright 2022-2024 Soren Stoutner . * - * This file is part of Privacy Browser PC . + * This file is part of Privacy Browser PC . * * Privacy Browser PC is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -452,12 +452,20 @@ PrivacyWebEngineView* TabWidget::addTab(const bool removeUrlLineEditFocus, const // Plugins must be enabled for the PDF viewer to work. webEngineSettingsPointer->setAttribute(QWebEngineSettings::PluginsEnabled, true); + // Update the blocked requests action. + connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::requestBlocked, [this, privacyWebEngineViewPointer] (const int blockedRequests) + { + // Update the blocked requests action if the specified privacy WebEngine view is the current privacy WebEngine view. + if (privacyWebEngineViewPointer == currentPrivacyWebEngineViewPointer) + emit blockedRequestsUpdated(blockedRequests); + }); + // Update the cookies action. - connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::updateCookiesAction, [this, privacyWebEngineViewPointer] (const int numberOfCookies) + connect(privacyWebEngineViewPointer, &PrivacyWebEngineView::numberOfCookiesChanged, [this, privacyWebEngineViewPointer] (const int numberOfCookies) { // Update the cookie action if the specified privacy WebEngine view is the current privacy WebEngine view. if (privacyWebEngineViewPointer == currentPrivacyWebEngineViewPointer) - emit updateCookiesAction(numberOfCookies); + emit cookiesChanged(numberOfCookies); }); // Process cookie changes. @@ -1264,9 +1272,10 @@ void TabWidget::updateUiWithTabSettings() DevToolsWebEngineView *devToolsWebEngineViewPointer = qTabWidgetPointer->currentWidget()->findChild(); // Update the actions. + emit blockedRequestsUpdated(currentPrivacyWebEngineViewPointer->blockedRequests); + emit cookiesChanged(currentPrivacyWebEngineViewPointer->cookieListPointer->size()); emit updateDefaultZoomFactor(currentPrivacyWebEngineViewPointer->defaultZoomFactor); emit updateBackAction(currentWebEngineHistoryPointer->canGoBack()); - emit updateCookiesAction(currentPrivacyWebEngineViewPointer->cookieListPointer->size()); emit updateDeveloperToolsAction(devToolsWebEngineViewPointer->isVisible()); emit updateDomStorageAction(currentWebEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled)); emit updateForwardAction(currentWebEngineHistoryPointer->canGoForward());