]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blob - src/privacybrowserpcview.cpp
At the PO template (translation) framework.
[PrivacyBrowserPC.git] / src / privacybrowserpcview.cpp
1 /*
2     SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}>
3
4     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
5 */
6
7 // application headers
8 #include "privacybrowserpcview.h"
9
10 #include "settings.h"
11 #include "privacybrowserdebug.h"
12
13
14 PrivacyBrowserPCView::PrivacyBrowserPCView(QWidget *parent)
15     : QWidget(parent)
16 {
17     m_ui.setupUi(this);
18     handleSettingsChanged();
19 }
20
21 PrivacyBrowserPCView::~PrivacyBrowserPCView()
22 {
23 }
24
25 void PrivacyBrowserPCView::switchColors()
26 {
27     // switch the foreground/background colors of the label
28     QColor color = Settings::colorBackground();
29     Settings::setColorBackground(Settings::colorForeground());
30     Settings::setColorForeground(color);
31
32     handleSettingsChanged();
33 }
34
35 void PrivacyBrowserPCView::handleSettingsChanged()
36 {
37     qCDebug(PRIVACYBROWSER) << "PrivacyBrowserPCView::handleSettingsChanged()";
38     QPalette palette = m_ui.templateLabel->palette();
39     palette.setColor(QPalette::Window, Settings::colorBackground());
40     palette.setColor(QPalette::WindowText, Settings::colorForeground());
41     m_ui.templateLabel->setPalette(palette);
42
43     // i18n : internationalization
44     m_ui.templateLabel->setText(i18n("This project is %1 days old", Settings::ageInDays()));
45 }
46