]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/mainview.cpp
Add a homepage setting.
[PrivacyBrowserPC.git] / src / mainview.cpp
index b1adcbf2dc49f66c6796fb18a5e8a520c159e572..5c596624d3a130192f6aae13eea3363d07ac2c07 100644 (file)
@@ -60,12 +60,15 @@ MainView::MainView(QWidget *parent) : QWidget(parent)
     // Set the focus on the WebEngine view.
     webEngineViewPointer->setFocus();
 
-    // Load a website.
-    webEngineViewPointer->setUrl(QUrl(QStringLiteral("https://www.stoutner.com/")));
+    // Load the homepage.  TODO.  Consider sanitizing the homepage input and adding things like protocols if they are missing.
+    webEngineViewPointer->setUrl(Settings::homepage());
 }
 
 void MainView::loadUrl(const QString &urlFromUser)
 {
+    // Remove the focus from the URL line edit.
+    urlLineEditPointer->clearFocus();
+
     // Load the URL, adding standard protocol sections if needed.  TODO.  Replace this with logic that prefers HTTPS.
     webEngineViewPointer->setUrl(QUrl::fromUserInput(urlFromUser));
 }