--- /dev/null
+/*
+ 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
+#include "mainview.h"
+
+#include "settings.h"
+#include "privacybrowserdebug.h"
+
+
+MainView::MainView(QWidget *parent)
+ : QWidget(parent)
+{
+ m_ui.setupUi(this);
+ handleSettingsChanged();
+}
+
+MainView::~MainView()
+{
+}
+
+void MainView::switchColors()
+{
+ // switch the foreground/background colors of the label
+ QColor color = Settings::colorBackground();
+ Settings::setColorBackground(Settings::colorForeground());
+ Settings::setColorForeground(color);
+
+ 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);
+
+ // i18n : internationalization
+ m_ui.templateLabel->setText(i18n("This project is %1 days old", Settings::ageInDays()));
+}