+void DomainSettingsDialog::populateJavaScriptLabel() const
+{
+ // Populate the label according to the currently selected index.
+ switch (javaScriptComboBoxPointer->currentIndex())
+ {
+ case (DomainsDatabaseHelper::SYSTEM_DEFAULT):
+ {
+ // Set the text according to the system default.
+ if (Settings::javaScript()) javaScriptLabelPointer->setText(i18nc("Domains settings label", "JavaScript enabled"));
+ else javaScriptLabelPointer->setText(i18nc("Domain settings label", "JavaScript disabled"));
+
+ break;
+ }
+
+ case (DomainsDatabaseHelper::DISABLED):
+ {
+ // Set the label text in bold.
+ javaScriptLabelPointer->setText(i18nc("Domain settings label. The <strong> tags should be retained.", "<strong>JavaScript disabled</strong>"));
+
+ break;
+ }
+
+ case (DomainsDatabaseHelper::ENABLED):
+ {
+ // Set the label text in bold.
+ javaScriptLabelPointer->setText(i18nc("Domains settings label. The <strong> tags should be retained.", "<strong>JavaScript enabled</strong>"));
+
+ break;
+ }
+ }
+}
+
+void DomainSettingsDialog::populateLocalStorageLabel() const
+{
+ // Populate the label according to the currently selected index.
+ switch (localStorageComboBoxPointer->currentIndex())
+ {
+ case (DomainsDatabaseHelper::SYSTEM_DEFAULT):
+ {
+ // Set the text according to the system default.
+ if (Settings::localStorage()) localStorageLabelPointer->setText(i18nc("Local storage label", "Local storage enabled"));
+ else localStorageLabelPointer->setText(i18nc("Local storage label", "Local storage disabled"));
+
+ break;
+ }
+
+ case (DomainsDatabaseHelper::DISABLED):
+ {
+ // Set the label text in bold.
+ localStorageLabelPointer->setText(i18nc("Local storage label. The <string> tags should be retained.", "<strong>Local storage disabled</strong>"));
+
+ break;
+ }
+
+ case (DomainsDatabaseHelper::ENABLED):
+ {
+ // Set the label text in bold.
+ localStorageLabelPointer->setText(i18nc("Local storage label. The <strong> tags should be retained.", "<strong>Local storage enabled</strong>"));
+
+ break;
+ }
+ }
+}
+
+void DomainSettingsDialog::populateUserAgentLabel(const QString &userAgentName) const
+{
+ // Populate the label according to the type.
+ if (userAgentName == UserAgentHelper::SYSTEM_DEFAULT_TRANSLATED)
+ {
+ // Display the system default user agent name.
+ userAgentLabelPointer->setText(UserAgentHelper::getTranslatedUserAgentNameFromDatabaseName(Settings::userAgent()));
+ }
+ else
+ {
+ // Display the user agent name in bold.
+ userAgentLabelPointer->setText("<strong>" + userAgentName + "</strong>");
+ }
+}
+