// Update the webengine view from the URL line edit.
connect(urlLineEditPointer, SIGNAL(returnKeyPressed(const QString)), this, SLOT(loadUrlFromTextBox(const QString)));
- // Update the URL line edit form the webengine view.
+ // Update the URL line edit from the webengine view.
connect(webEngineViewPointer, SIGNAL(loadStarted()), this, SLOT(updateInterface()));
connect(webEngineViewPointer, SIGNAL(loadProgress(const int)), this, SLOT(updateInterface()));
connect(webEngineViewPointer, SIGNAL(loadFinished(const bool)), this, SLOT(updateInterface()));
domainSettingsPalette = urlLineEditPointer->palette();
// Modify the domain settings palette.
- domainSettingsPalette.setColor(QPalette::Base, Qt::green);
+ domainSettingsPalette.setColor(QPalette::Base, QColor("#C8E6C9"));
// Instantiate the mouse event pointer.
MouseEventFilter *mouseEventFilterPointer = new MouseEventFilter(webEngineViewPointer);
// Check if the hostname has domain settings.
if (domainQuery.isValid()) // The hostname has domain settings.
{
-
-
// Get the domain record.
QSqlRecord domainRecord = domainQuery.record();
}
}
- // Apply the user agent.
- webEngineProfilePointer->setHttpUserAgent(UserAgentHelper::getUserAgent(Settings::userAgent()));
+ // Set the user agent.
+ webEngineProfilePointer->setHttpUserAgent(UserAgentHelper::getResultingDomainSettingsUserAgent(domainRecord.field(DomainsDatabaseHelper::USER_AGENT).value().toString()));
// Set the zoom factor.
webEngineViewPointer->setZoomFactor(Settings::zoomFactor());
// Set the JavaScript status.
webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScript());
- // Apply the user agent.
- webEngineProfilePointer->setHttpUserAgent(UserAgentHelper::getUserAgent(Settings::userAgent()));
+ // Set the user agent.
+ webEngineProfilePointer->setHttpUserAgent(UserAgentHelper::getUserAgentFromDatabaseName(Settings::userAgent()));
// Set the zoom factor.
webEngineViewPointer->setZoomFactor(Settings::zoomFactor());
}
// Emit the on-the-fly menu update signals.
- emit userAgentUpdated(Settings::userAgent());
+ emit userAgentUpdated(webEngineProfilePointer->httpUserAgent());
emit zoomFactorUpdated(Settings::zoomFactor());
// Reload the website if requested.
userAgentName.remove('&');
// Apply the user agent.
- webEngineProfilePointer->setHttpUserAgent(UserAgentHelper::getUserAgent(userAgentName));
+ webEngineProfilePointer->setHttpUserAgent(UserAgentHelper::getUserAgentFromTranslatedName(userAgentName));
// Reload the website.
webEngineViewPointer->reload();
// Set the dialog window title.
domainSettingsDialogPointer->setWindowTitle(i18nc("The domain settings dialog title", "Domain Settings"));
- // Resize the dialog window.
- domainSettingsDialogPointer->resize(1500, 1000);
-
// Set the modality.
domainSettingsDialogPointer->setWindowModality(Qt::WindowModality::WindowModal);;
// Show the dialog.
domainSettingsDialogPointer->show();
+
+ // Reload the tabs when domain settings are updated.
+ connect(domainSettingsDialogPointer, SIGNAL(domainSettingsUpdated()), this, SLOT(applyDomainSettingsAndReload()));
}
void BrowserView::pageLinkHovered(const QString &linkUrl) const