searchEngineCustomActionPointer->setCheckable(true);
// Set the non-mutable action text.
- userAgentPrivacyBrowserActionPointer->setText(i18nc("@action", "Privacy Browser"));
- userAgentFirefoxLinuxActionPointer->setText(i18nc("@action", "Firefox Linux"));
- userAgentChromiumLinuxActionPointer->setText(i18nc("@action", "Chromium Linux"));
- userAgentFirefoxWindowsActionPointer->setText(i18nc("@action", "Firefox Windows"));
- userAgentChromeWindowsActionPointer->setText(i18nc("@action", "Chrome Windows"));
- userAgentEdgeWindowsActionPointer->setText(i18nc("@action", "Edge Windows"));
- userAgentSafariMacosActionPointer->setText(i18nc("@action", "Safari macOS"));
+ userAgentPrivacyBrowserActionPointer->setText(UserAgentHelper::PRIVACY_BROWSER_TRANSLATED);
+ userAgentFirefoxLinuxActionPointer->setText(UserAgentHelper::FIREFOX_LINUX_TRANSLATED);
+ userAgentChromiumLinuxActionPointer->setText(UserAgentHelper::CHROMIUM_LINUX_TRANSLATED);
+ userAgentFirefoxWindowsActionPointer->setText(UserAgentHelper::FIREFOX_WINDOWS_TRANSLATED);
+ userAgentChromeWindowsActionPointer->setText(UserAgentHelper::CHROME_WINDOWS_TRANSLATED);
+ userAgentEdgeWindowsActionPointer->setText(UserAgentHelper::EDGE_WINDOWS_TRANSLATED);
+ userAgentSafariMacosActionPointer->setText(UserAgentHelper::SAFARI_MACOS_TRANSLATED);
searchEngineMojeekActionPointer->setText(i18nc("@action", "Mojeek"));
searchEngineMonoclesActionPointer->setText(i18nc("@action", "Monocles"));
searchEngineMetagerActionPointer->setText(i18nc("@action", "MetaGer"));
bool okClicked;
// Display a dialog to get the new zoom factor from the user. Format the double to display two decimals and have a 0.25 step.
- double newZoomFactor = QInputDialog::getDouble(this, i18nc("The tile of the on-the-fly zoom factor dialog", "On-The-Fly Zoom Factor"),
+ double newZoomFactor = QInputDialog::getDouble(this, i18nc("The on-the-fly zoom factor dialog title", "On-The-Fly Zoom Factor"),
i18nc("The instruction text of the on-the-fly zoom factor dialog", "Enter a zoom factor between 0.25 and 5.00"),
currentZoomFactor, .025, 5.00, 2, &okClicked, Qt::WindowFlags(), 0.25);
+ // Update the zoom factor if the user clicked OK.
if (okClicked)
{
// Update the current zoom factor.
// Make it so.
configDialogPointer->show();
+ // TODO. KConfigDialog does not respect expanding size policies.
+ configDialogPointer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ privacySettingsWidgetPointer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ generalSettingsWidgetPointer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ configDialogPointer->adjustSize();
+
// Expand the config dialog.
configDialogPointer->resize(1000, 500);
bool customUserAgent = false;
// Check the indicated on-the-fly user agent.
- if (userAgent == "Privacy Browser") // Privacy Browser.
- {
- userAgentPrivacyBrowserActionPointer->setChecked(true);
- }
- else if (userAgent == "Firefox Linux") // Firefox Linux.
- {
- userAgentFirefoxLinuxActionPointer->setChecked(true);
- }
- else if (userAgent == "Chromium Linux") // Chromium Linux.
- {
- userAgentChromiumLinuxActionPointer->setChecked(true);
- }
- else if (userAgent == "Firefox Windows") // Firefox Windows.
- {
- userAgentFirefoxWindowsActionPointer->setChecked(true);
- }
- else if (userAgent == "Chrome Windows") // Chrome Windows.
- {
- userAgentChromeWindowsActionPointer->setChecked(true);
- }
- else if (userAgent == "Edge Windows") // Edge Windows.
- {
- userAgentEdgeWindowsActionPointer->setChecked(true);
- }
- else if (userAgent == "Safari macOS") // Safari macOS.
- {
- userAgentSafariMacosActionPointer->setChecked(true);
- }
+ if (userAgent == UserAgentHelper::PRIVACY_BROWSER_USER_AGENT) userAgentPrivacyBrowserActionPointer->setChecked(true); // Privacy Browser.
+ 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.
+ else if (userAgent == UserAgentHelper::CHROME_WINDOWS_USER_AGENT) userAgentChromeWindowsActionPointer->setChecked(true); // Chrome Windows.
+ else if (userAgent == UserAgentHelper::EDGE_WINDOWS_USER_AGENT) userAgentEdgeWindowsActionPointer->setChecked(true); // Edge Windows.
+ else if (userAgent == UserAgentHelper::SAFARI_MACOS_USER_AGENT) userAgentSafariMacosActionPointer->setChecked(true); // Safara macOS.
else // Custom user agent.
{
// Check the user agent.
statusBar()->showMessage(statusBarMessage);
}
-void BrowserWindow::updateUserAgentLabel(const QString &userAgentName) const
+void BrowserWindow::updateUserAgentLabel(const QString &userAgentDatabaseName) const
{
// Update the user agent label.
- userAgentLabelPointer->setText(UserAgentHelper::getUserAgent(userAgentName));
+ userAgentLabelPointer->setText(UserAgentHelper::getUserAgentFromDatabaseName(userAgentDatabaseName));
}