]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/windows/BrowserWindow.cpp
Populate the UI when the initial URL is a local file. https://redmine.stoutner.com...
[PrivacyBrowserPC.git] / src / windows / BrowserWindow.cpp
index 716f2e0c58f57dea8d676a00c660ebf697ac58c1..6df64f3ee95c558882c20d54f33dd1848712ae3b 100644 (file)
@@ -351,6 +351,14 @@ BrowserWindow::BrowserWindow(bool firstWindow) : KXmlGuiWindow()
     connect(f11ShortcutPointer, SIGNAL(activated()), fullScreenActionPointer, SLOT(trigger()));
     connect(escapeShortcutPointer, SIGNAL(activated()), this, SLOT(escape()));
 
+    // Populate the UI.
+    // This must be done here, because otherwise, if a URL is loaded, like a local file, that does not trigger a call to TabWidget::applyDomainSettings, the UI will not be fully populated.
+    updateJavaScriptAction(Settings::javaScriptEnabled());
+    updateLocalStorageAction(Settings::localStorageEnabled());
+    updateDomStorageAction(Settings::domStorageEnabled());
+    updateUserAgentActions(UserAgentHelper::getUserAgentFromDatabaseName(Settings::userAgent()), true);
+    updateZoomFactorAction(Settings::zoomFactor());
+
     // Load the initial website if this is the first window.
     if (firstWindow)
         tabWidgetPointer->loadInitialWebsite();
@@ -1018,6 +1026,7 @@ void BrowserWindow::updateUserAgentActions(const QString &userAgent, const bool
     }
 
     // Update the custom user agent enabled boolean.
+    // This is not done when the current user agent is a custom one but it is temporarially being changed via on-the-fly settings so that the user can switch back to the custom user agent.
     if (updateCustomUserAgentStatus)
         customUserAgentEnabled = customUserAgent;