From 5452b388e3fcfc1c86a234f8354edab04354aa3a Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Sat, 29 Jan 2022 21:13:42 -0700 Subject: [PATCH] Add a homepage setting. --- src/mainview.cpp | 7 +++++-- src/settings.kcfg | 5 +++++ src/settings.ui | 39 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/mainview.cpp b/src/mainview.cpp index b1adcbf..5c59662 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -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)); } diff --git a/src/settings.kcfg b/src/settings.kcfg index 7ef17aa..d4c5ffd 100644 --- a/src/settings.kcfg +++ b/src/settings.kcfg @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with Privacy Browser PC. If not, see . --> + + + https://www.mojeek.com/ + + 1.00 diff --git a/src/settings.ui b/src/settings.ui index 35d51b8..a6c876f 100644 --- a/src/settings.ui +++ b/src/settings.ui @@ -33,14 +33,51 @@ + + + Homepage + + + + Set the hompage. + + + + Set the homepage. The default is https://www.mojeek.com/. + + + + + + + + Set the hompage. + + + + Set the homepage. The default is https://www.mojeek.com/. + + + + + + Zoom factor + + + Set the zoom factor between 0.25 and 5.00. + + + + Set the zoom factor between 0.25 and 5.00. The default is 1.00. + - + Set the zoom factor between 0.25 and 5.00. -- 2.43.0