+void DomainSettingsDialog::populateDomStorageLabel() const
+{
+ // Populate the label according to the currently selected index.
+ switch (domStorageComboBoxPointer->currentIndex())
+ {
+ // Set the text according to the system default.
+ case (DomainsDatabase::SYSTEM_DEFAULT):
+ {
+ if (Settings::domStorageEnabled())
+ domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label.", "DOM storage enabled"));
+ else
+ domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label.", "DOM storage disabled"));
+
+ break;
+ }
+
+ // Set the disabled text in bold.
+ case (DomainsDatabase::DISABLED):
+ {
+ domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label. The <b> tags should be retained.", "<b>DOM storage disabled</b>"));
+
+ break;
+ }
+
+ // Set the enabled text in bold.
+ case (DomainsDatabase::ENABLED):
+ {
+ domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label. The <b> tags should be retained.", "<b>DOM storage enabled</b>"));
+
+ break;
+ }
+ }
+}
+
+void DomainSettingsDialog::populateJavaScriptLabel() const
+{
+ // Populate the label according to the currently selected index.
+ switch (javaScriptComboBoxPointer->currentIndex())
+ {
+ // Set the text according to the system default.
+ case (DomainsDatabase::SYSTEM_DEFAULT):
+ {
+ if (Settings::javaScriptEnabled())
+ javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label.", "JavaScript enabled"));
+ else
+ javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label.", "JavaScript disabled"));
+
+ break;
+ }
+
+ // Set the disabled text in bold.
+ case (DomainsDatabase::DISABLED):
+ {
+ javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label. The <b> tags should be retained.", "<b>JavaScript disabled</b>"));
+
+ break;
+ }
+
+ // Set the enabled text in bold.
+ case (DomainsDatabase::ENABLED):
+ {
+ javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label. The <b> tags should be retained.", "<b>JavaScript enabled</b>"));
+
+ break;
+ }
+ }
+}
+
+void DomainSettingsDialog::populateLocalStorageLabel() const
+{
+ // Populate the label according to the currently selected index.
+ switch (localStorageComboBoxPointer->currentIndex())
+ {
+ // Set the text according to the system default.
+ case (DomainsDatabase::SYSTEM_DEFAULT):
+ {
+ if (Settings::localStorageEnabled())
+ localStorageLabelPointer->setText(i18nc("Domain settings local storage label.", "Local storage enabled"));
+ else
+ localStorageLabelPointer->setText(i18nc("Domain settings local storage label.", "Local storage disabled"));
+
+ break;
+ }
+
+ // Set the disabled text in bold.
+ case (DomainsDatabase::DISABLED):
+ {
+ localStorageLabelPointer->setText(i18nc("Domain settings local storage label. The <b> tags should be retained.", "<b>Local storage disabled</b>"));
+
+ break;
+ }
+
+ // Set the enabled text in bold.
+ case (DomainsDatabase::ENABLED):
+ {
+ localStorageLabelPointer->setText(i18nc("Domain settings local storage label. The <b> tabs should be retained.", "<b>Local storage enabled</b>"));
+
+ 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>");
+ }
+}
+