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