X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fmainview.cpp;fp=src%2Fmainview.cpp;h=844f930971428834cd1bd747df6d028a5624b204;hp=c437c2c4ac130b31739961ddb65898c99c23e7f5;hb=255215b082091aaadd5ef24cfc0880cd81e42272;hpb=153c5c0d60eaf3185cb4419032fb0fdaeb78907c diff --git a/src/mainview.cpp b/src/mainview.cpp index c437c2c..844f930 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -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 . + * + * This file is part of 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 . + */ + +// 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 -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/"))); }