+void DomainSettingsDialog::updateDomStorageStatus() const
+{
+ // Instantiate tracking variables.
+ bool javaScriptEnabled;
+ bool localStorageEnabled;
+
+ // Populate the JavaScript tracker.
+ switch (javaScriptComboBoxPointer->currentIndex())
+ {
+ case (DomainsDatabase::SYSTEM_DEFAULT):
+ {
+ // Update the tracker according to the system default.
+ if (Settings::javaScriptEnabled())
+ javaScriptEnabled = true;
+ else
+ javaScriptEnabled = false;
+
+ break;
+ }
+
+ case (DomainsDatabase::ENABLED):
+ {
+ // Update the tracker.
+ javaScriptEnabled = true;
+
+ break;
+ }
+
+ case (DomainsDatabase::DISABLED):
+ {
+ // Update the tracker.
+ javaScriptEnabled = false;
+
+ break;
+ }
+ }
+
+ // Populate the local storage tracker.
+ switch (localStorageComboBoxPointer->currentIndex())
+ {
+ case (DomainsDatabase::SYSTEM_DEFAULT):
+ {
+ // Update the tracker according to the system default.
+ if (Settings::localStorageEnabled())
+ localStorageEnabled = true;
+ else
+ localStorageEnabled = false;
+
+ break;
+ }
+
+ case (DomainsDatabase::ENABLED):
+ {
+ // Update the tracker.
+ localStorageEnabled = true;
+
+ break;
+ }
+
+ case (DomainsDatabase::DISABLED):
+ {
+ // Update the tracker.
+ localStorageEnabled = false;
+
+ break;
+ }
+ }
+
+ // Only enable DOM storage if both JavaScript and local storage are enabled.
+ domStorageComboBoxPointer->setEnabled(javaScriptEnabled && localStorageEnabled);
+}
+