]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/mainview.cpp
Add a web engine view.
[PrivacyBrowserPC.git] / src / mainview.cpp
index c437c2c4ac130b31739961ddb65898c99c23e7f5..844f930971428834cd1bd747df6d028a5624b204 100644 (file)
@@ -1,45 +1,37 @@
 /*
-    SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}>
-
-    SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
-*/
-
-// application headers
+ * Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+ *
+ * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
+ *
+ * Privacy Browser PC is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Privacy Browser PC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Application headers
 #include "mainview.h"
-
 #include "settings.h"
-#include "privacybrowserdebug.h"
-
-
-MainView::MainView(QWidget *parent)
-    : QWidget(parent)
-{
-    m_ui.setupUi(this);
-    handleSettingsChanged();
-}
 
-MainView::~MainView()
-{
-}
+// Qt framework headers.
+#include <QWebEngineView>
 
-void MainView::switchColors()
+MainView::MainView(QWidget *parent) : QWidget(parent)
 {
-    // switch the foreground/background colors of the label
-    QColor color = Settings::colorBackground();
-    Settings::setColorBackground(Settings::colorForeground());
-    Settings::setColorForeground(color);
+    // Setup the UI.
+    mainViewUi.setupUi(this);
 
-    handleSettingsChanged();
-}
-
-void MainView::handleSettingsChanged()
-{
-    qCDebug(PRIVACYBROWSER) << "MainView::handleSettingsChanged()";
-    QPalette palette = m_ui.templateLabel->palette();
-    palette.setColor(QPalette::Window, Settings::colorBackground());
-    palette.setColor(QPalette::WindowText, Settings::colorForeground());
-    m_ui.templateLabel->setPalette(palette);
+    // Get a handle for the web engine view.
+    QWebEngineView *webEngineViewPointer = mainViewUi.webEngineView;
 
-    // i18n : internationalization
-    m_ui.templateLabel->setText(i18n("This project is %1 days old", Settings::ageInDays()));
+    // Load a website.
+    webEngineViewPointer->setUrl(QUrl(QStringLiteral("https://www.stoutner.com/")));
 }