X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fwindows%2FBrowserWindow.cpp;h=4edb35ac4613bdfd771cc876aaa0c574d63fa2f1;hp=15b683e77f114e7342e11e5c7ea926631384f1ce;hb=823acbeb2cc27030857f249ab7157d8562e7b7fe;hpb=730c65f4a8c48df65ed0fcd8ddfbbc9bcfda0c1f diff --git a/src/windows/BrowserWindow.cpp b/src/windows/BrowserWindow.cpp index 15b683e..4edb35a 100644 --- a/src/windows/BrowserWindow.cpp +++ b/src/windows/BrowserWindow.cpp @@ -175,9 +175,9 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow() domStorageActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("view-web-browser-dom-tree"))); // Update the on-the-fly menus. - connect(browserViewPointer, SIGNAL(updateUserAgentActions(QString)), this, SLOT(updateUserAgentActions(QString))); + connect(browserViewPointer, SIGNAL(updateUserAgentActions(QString, bool)), this, SLOT(updateUserAgentActions(QString, bool))); connect(browserViewPointer, SIGNAL(updateZoomFactorAction(double)), this, SLOT(updateZoomFactorAction(double))); - connect(browserViewPointer, SIGNAL(updateSearchEngineActions(QString)), this, SLOT(updateSearchEngineActions(QString))); + connect(browserViewPointer, SIGNAL(updateSearchEngineActions(QString, bool)), this, SLOT(updateSearchEngineActions(QString, bool))); // Apply the on-the-fly settings when selected. connect(userAgentActionGroupPointer, SIGNAL(triggered(QAction*)), browserViewPointer, SLOT(applyOnTheFlyUserAgent(QAction*))); @@ -620,7 +620,7 @@ void BrowserWindow::updateLocalStorageAction(const bool &isEnabled) domStorageActionPointer->setEnabled(localStorageEnabled & javaScriptEnabled); } -void BrowserWindow::updateSearchEngineActions(const QString &searchEngine) const +void BrowserWindow::updateSearchEngineActions(const QString &searchEngine, const bool &updateCustomSearchEngineStatus) { // Initialize the custom search engine flag. bool customSearchEngine = false; @@ -681,18 +681,22 @@ void BrowserWindow::updateSearchEngineActions(const QString &searchEngine) const // Update the search engine menu action text. searchEngineMenuActionPointer->setText(i18nc("The main search engine menu action", "Search Engine - Custom")); + // Set the custom search engine text. + searchEngineCustomActionPointer->setText(searchEngine); + // Set the custom search engine flag. customSearchEngine = true; } + // Update the custom search engine enabled boolean. + if (updateCustomSearchEngineStatus) + customSearchEngineEnabled = customSearchEngine; + // Format the custom search engine. - if (customSearchEngine) + if (customSearchEngineEnabled) { // Enable the custom search engine. searchEngineCustomActionPointer->setEnabled(true); - - // Set the custom search engine text. - searchEngineCustomActionPointer->setText(searchEngine); } else { @@ -704,7 +708,7 @@ void BrowserWindow::updateSearchEngineActions(const QString &searchEngine) const } } -void BrowserWindow::updateUserAgentActions(const QString &userAgent) const +void BrowserWindow::updateUserAgentActions(const QString &userAgent, const bool &updateCustomUserAgentStatus) { // Initialize the custom user agent flag. bool customUserAgent = false; @@ -782,19 +786,23 @@ void BrowserWindow::updateUserAgentActions(const QString &userAgent) const // Update the user agent menu action text. userAgentMenuActionPointer->setText(i18nc("The main user agent menu action", "User Agent - Custom")); + // Set the custom user agent text. + userAgentCustomActionPointer->setText(userAgent); + // Set the custom user agent flag. customUserAgent = true; } + // Update the custom user agent enabled boolean. + if (updateCustomUserAgentStatus) + customUserAgentEnabled = customUserAgent; + // Format the custom user agent. - if (customUserAgent) + if (customUserAgentEnabled) { // Enable the custom user agent. userAgentCustomActionPointer->setEnabled(true); - - // Set the custom user agent text. - userAgentCustomActionPointer->setText(userAgent); } else {