Add a WebEngine Default user agent.
[PrivacyBrowserPC.git] / src / windows / BrowserWindow.cpp
index 44614194b78b1e75621316ed4afc52ff5d541781..a29b5037c83af5ae69dcfd9f146228fc96f0e251 100644 (file)
@@ -56,6 +56,7 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
 
     // Add the custom actions.
     userAgentPrivacyBrowserActionPointer = actionCollectionPointer->addAction(QStringLiteral("user_agent_privacy_browser"));
+    userAgentWebEngineDefaultActionPointer = actionCollectionPointer->addAction(QStringLiteral("user_agent_webengine_default"));
     userAgentFirefoxLinuxActionPointer = actionCollectionPointer->addAction(QStringLiteral("user_agent_firefox_linux"));
     userAgentChromiumLinuxActionPointer = actionCollectionPointer->addAction(QStringLiteral("user_agent_chromium_linux"));
     userAgentFirefoxWindowsActionPointer = actionCollectionPointer->addAction(QStringLiteral("user_agent_firefox_windows"));
@@ -81,6 +82,7 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
 
     // Add the actions to the groups.
     userAgentActionGroupPointer->addAction(userAgentPrivacyBrowserActionPointer);
+    userAgentActionGroupPointer->addAction(userAgentWebEngineDefaultActionPointer);
     userAgentActionGroupPointer->addAction(userAgentFirefoxLinuxActionPointer);
     userAgentActionGroupPointer->addAction(userAgentChromiumLinuxActionPointer);
     userAgentActionGroupPointer->addAction(userAgentFirefoxWindowsActionPointer);
@@ -98,6 +100,7 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
 
     // Set some actions to be checkable.
     userAgentPrivacyBrowserActionPointer->setCheckable(true);
+    userAgentWebEngineDefaultActionPointer->setCheckable(true);
     userAgentFirefoxLinuxActionPointer->setCheckable(true);
     userAgentChromiumLinuxActionPointer->setCheckable(true);
     userAgentFirefoxWindowsActionPointer->setCheckable(true);
@@ -115,6 +118,7 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
 
     // Set the non-mutable action text.
     userAgentPrivacyBrowserActionPointer->setText(UserAgentHelper::PRIVACY_BROWSER_TRANSLATED);
+    userAgentWebEngineDefaultActionPointer->setText(UserAgentHelper::WEB_ENGINE_DEFAULT_TRANSLATED);
     userAgentFirefoxLinuxActionPointer->setText(UserAgentHelper::FIREFOX_LINUX_TRANSLATED);
     userAgentChromiumLinuxActionPointer->setText(UserAgentHelper::CHROMIUM_LINUX_TRANSLATED);
     userAgentFirefoxWindowsActionPointer->setText(UserAgentHelper::FIREFOX_WINDOWS_TRANSLATED);
@@ -133,6 +137,7 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
 
     // Set the action icons.
     userAgentPrivacyBrowserActionPointer->setIcon(QIcon(":/icons/privacy-mode"));
+    userAgentWebEngineDefaultActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("user-group-properties")));
     userAgentFirefoxLinuxActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("firefox-esr")));
     userAgentChromiumLinuxActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("chromium")));
     userAgentFirefoxWindowsActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("firefox-esr")));
@@ -552,6 +557,7 @@ void BrowserWindow::updateUserAgentActions(const QString &userAgent) const
 
     // Check the indicated on-the-fly user agent.
     if (userAgent == UserAgentHelper::PRIVACY_BROWSER_USER_AGENT) userAgentPrivacyBrowserActionPointer->setChecked(true);  // Privacy Browser.
+    else if (userAgent == BrowserView::webEngineDefaultUserAgent) userAgentWebEngineDefaultActionPointer->setChecked(true);  // WebEngine default.
     else if (userAgent == UserAgentHelper::FIREFOX_LINUX_USER_AGENT) userAgentFirefoxLinuxActionPointer->setChecked(true);  // Firefox Linux.
     else if (userAgent == UserAgentHelper::CHROMIUM_LINUX_USER_AGENT) userAgentChromiumLinuxActionPointer->setChecked(true);  // Chromium Linux.
     else if (userAgent == UserAgentHelper::FIREFOX_WINDOWS_USER_AGENT) userAgentFirefoxWindowsActionPointer->setChecked(true);  // Firefox Windows.