]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/commitdiff
Add a web engine view.
authorSoren Stoutner <soren@stoutner.com>
Thu, 27 Jan 2022 22:19:24 +0000 (15:19 -0700)
committerSoren Stoutner <soren@stoutner.com>
Thu, 27 Jan 2022 22:19:24 +0000 (15:19 -0700)
14 files changed:
CMakeLists.txt
src/CMakeLists.txt
src/icons/sc-apps-privacy_browser.svg [deleted file]
src/main.cpp
src/mainview.cpp
src/mainview.h
src/mainview.ui
src/mainwindow.cpp
src/mainwindow.h
src/privacybrowserui.rc
src/resources.qrc
src/settings.kcfg
src/settings.kcfgc
src/settings.ui

index 29c01f6e5fd7266d8d134faffc44f811836f6b0d..b32fd1854b7db33b922b9bcc1fc05a59b9229ff8 100644 (file)
@@ -43,7 +43,12 @@ include(ECMQtDeclareLoggingCategory)
 include(FeatureSummary)
 
 # Load the Qt components.
-find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets)
+find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
+    Core
+    Gui
+    WebEngineWidgets
+    Widgets
+)
 
 # Load the KDE Frameworks components.
 find_package(KF5 ${KDE_FRAMEWORKS_MIN_VERSION} REQUIRED COMPONENTS
index 513e8e6222eaab9b6491411bc0ddf437ce0d9802..811cb8092acde2825fbfbab3bc09a32ae093dae7 100644 (file)
@@ -26,9 +26,9 @@ target_sources(privacy-browser PRIVATE
     mainview.cpp
 )
 
-# Add the Qt logging category.  This will create the `privacybrowserdebug.h` header file.
+# Add the Qt logging category.  This will create the `debug.h` header file.
 ecm_qt_declare_logging_category(privacy-browser
-    HEADER privacybrowserdebug.h
+    HEADER debug.h
     IDENTIFIER PRIVACYBROWSER
     CATEGORY_NAME "privacybrowser"
 )
@@ -51,6 +51,7 @@ target_link_libraries(privacy-browser
     KF5::I18n
     KF5::XmlGui
     Qt5::Widgets
+    Qt5::WebEngineWidgets
 )
 
 # Install Privacy Browser using the default KDE arguments.
@@ -66,4 +67,4 @@ install(FILES com.stoutner.privacybrowser.appdata.xml DESTINATION ${KDE_INSTALL_
 install(FILES privacybrowserui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/privacybrowser)
 
 # Install Privacy Browser's icon.
-ecm_install_icons(ICONS icons/sc-apps-privacy_browser.svg DESTINATION ${KDE_INSTALL_ICONDIR})
+ecm_install_icons(ICONS icons/sc-apps-privacy-browser.svg DESTINATION ${KDE_INSTALL_ICONDIR})
diff --git a/src/icons/sc-apps-privacy_browser.svg b/src/icons/sc-apps-privacy_browser.svg
deleted file mode 100644 (file)
index 428d507..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-
-<!--
-  Copyright © 2016-2017,2021-2022 Soren Stoutner <soren@stoutner.com>.
-
-  This file is derived from `security` and `language`, which are part of the Android Material icon set.  They are released under the Apache License 2.0.  <https://fonts.google.com/icons>
-
-  This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
-
-  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/>. -->
-
-<svg
-    xmlns="http://www.w3.org/2000/svg"
-    viewBox="0 0 256 256" >
-
-    <!-- Inner Shield. -->
-    <g transform="translate(0,160)" >
-        <path
-            style="fill:#0d47a1"
-            d="m 128,-147.2 -94.254546,41.89091 v 62.836368 c 0,58.123635 40.215273,112.477091 94.254546,125.672721 54.03928,-13.19563 94.25454,-67.549086 94.25454,-125.672721 v -62.836368 z" />
-    </g>
-
-    <!-- Outer Shield. -->
-    <g transform="translate(0,160)" >
-        <path
-            style="fill:#1976d2"
-            d="m 128,-160 -104.727273,46.54546 v 69.818182 C 23.272727,20.945459 67.956363,81.338188 128,95.999999 188.04364,81.338188 232.72727,20.945459 232.72727,-43.636358 v -69.818182 z m 0,127.883641 h 81.45454 C 203.28728,15.825464 171.28727,58.530919 128,71.912739 V -31.999996 H 46.545455 V -98.327268 L 128,-134.51636 Z" />
-    </g>
-
-    <!-- Globe. -->
-    <g transform="translate(0,232)" >
-        <path
-            style="fill:#ffffff"
-            d="m 127.92021,-183.78553 c -44.041614,0 -79.705747,35.74391 -79.705747,79.78553 0,44.041617 35.664133,79.785537 79.705747,79.785537 44.1214,0 79.86533,-35.74392 79.86533,-79.785537 0,-44.04162 -35.74393,-79.78553 -79.86533,-79.78553 z m 55.29138,47.87132 h -23.53674 c -2.55313,-9.9732 -6.22326,-19.54746 -11.0104,-28.40365 14.68055,5.02648 26.88773,15.23903 34.54714,28.40365 z M 128,-167.50929 c 6.6222,9.57427 11.80825,20.18574 15.23903,31.59508 h -30.47807 c 3.43078,-11.40934 8.61684,-22.02081 15.23904,-31.59508 z M 66.245993,-88.042889 C 64.969425,-93.149168 64.171571,-98.494798 64.171571,-104 c 0,-5.5052 0.797855,-10.85083 2.074422,-15.95711 h 26.96751 c -0.63829,5.26585 -1.117,10.5317 -1.117,15.95711 0,5.425417 0.47872,10.691263 1.117,15.957111 z m 6.542412,15.957108 H 96.32514 c 2.553137,9.973191 6.22327,19.547449 11.0104,28.403644 C 92.655006,-48.708619 80.44782,-58.841391 72.788405,-72.085781 Z M 96.32514,-135.91421 H 72.788405 c 7.659415,-13.2444 19.866601,-23.37717 34.547135,-28.40365 -4.78713,8.85619 -8.457263,18.43045 -11.0104,28.40365 z M 128,-40.49071 c -6.6222,-9.574268 -11.80826,-20.185747 -15.23904,-31.595071 h 30.47807 C 139.80825,-60.676457 134.6222,-50.064978 128,-40.49071 Z m 18.66982,-47.552179 h -37.33964 c -0.71801,-5.265848 -1.27656,-10.531694 -1.27656,-15.957111 0,-5.42541 0.55854,-10.77105 1.27656,-15.95711 h 37.33964 c 0.71811,5.18606 1.27656,10.5317 1.27656,15.95711 0,5.425417 -0.55844,10.691263 -1.27656,15.957111 z m 1.99463,44.360752 c 4.78714,-8.856195 8.45727,-18.430453 11.0104,-28.403644 h 23.53674 c -7.65941,13.164605 -19.86659,23.377162 -34.54714,28.403644 z m 14.12204,-44.360752 c 0.63828,-5.265848 1.117,-10.531694 1.117,-15.957111 0,-5.42541 -0.47871,-10.69126 -1.117,-15.95711 h 26.96752 c 1.27656,5.10628 2.07441,10.45191 2.07441,15.95711 0,5.505202 -0.79784,10.850832 -2.07441,15.957111 z" />
-    </g>
-</svg>
index 341636475c2025d75aab7e0bbbad635939f5052c..6bf5e74b642466face091a50d80a2acbc9969fe8 100644 (file)
 // KDE Frameworks headers.
 #include <KAboutData>
 #include <KCrash>
+#include <KLocalizedString>
 #include <KDBusService>
 
 // Qt headers.
+#include <QApplication>
 #include <QCommandLineParser>
 #include <QFile>
 
@@ -41,7 +43,7 @@ int main(int argc, char *argv[])
     KCrash::initialize();
 
     // Instantiate about data, setting the component name, the display name, and the version.
-    KAboutData aboutData(QStringLiteral("privacy-browser"), i18n("Privacy Browser"), QStringLiteral("0.1"));
+    KAboutData aboutData(QStringLiteral("privacybrowser"), i18n("Privacy Browser"), QStringLiteral("0.1"));
 
     // Add the author name, job description, email address, and website.
     aboutData.addAuthor(i18n("Soren Stoutner"),i18n("Principal developer"), QStringLiteral("soren@stoutner.com"), QStringLiteral("https://www.stoutner.com/"));
@@ -59,7 +61,7 @@ int main(int argc, char *argv[])
     KAboutData::setApplicationData(aboutData);
 
     // Set the window icon.
-    application.setWindowIcon(QIcon::fromTheme(QStringLiteral("privacy-browser"), QIcon(":/icons/sc-apps-privacy_browser.svg")));
+    application.setWindowIcon(QIcon::fromTheme(QStringLiteral("privacy-browser"), QIcon(":/icons/sc-apps-privacy-browser.svg")));
 
     // Create a command line parser.
     QCommandLineParser commandLineParser;
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/")));
 }
index 6b9e6ca8657f93405100422e43c54cc1a50ebfa7..8129ecaf57bdf9618ea9ad0ebb03febfe8e8810f 100644 (file)
@@ -1,45 +1,39 @@
 /*
-    SPDX-FileCopyrightText: %{CURRENT_YEAR} %{AUTHOR} <%{EMAIL}>
-
-    SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
-*/
+ * 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/>.
+ */
 
 #ifndef MAINVIEW_H
 #define MAINVIEW_H
 
+// Application headers.
 #include "ui_mainview.h"
 
-
-/**
- * This class serves as the main window for privacybrowserpc.  It handles the
- * menus, toolbars and status bars.
- *
- * @short Main window class
- * @author %{AUTHOR} <%{EMAIL}>
- * @version %{VERSION}
- */
 class MainView : public QWidget
 {
+    // Include the Q_OBJECT macro.
     Q_OBJECT
+
 public:
-    /**
-     * Default Constructor
-     */
+    // The default contructor.
     explicit MainView(QWidget *parent);
 
-    /**
-     * Default Destructor
-     */
-    ~MainView() override;
-
-public Q_SLOTS:
-    void switchColors();
-    void handleSettingsChanged();
-
 private:
-    // this is the name of the root widget inside our Ui file
-    // you can rename it in designer and then change it here
-    Ui::MainView m_ui;
+    // Declare the private variables.
+    Ui::MainView mainViewUi;
 };
-
 #endif
index 2f42279333e00955195a2d304e6eccc74b6b413c..41b9b00b2a021f8e9573760937fd4cbe2f001b22 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+  This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
+
+  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/>. -->
+
 <ui version="4.0">
- <class>MainView</class>
- <widget class="QWidget" name="MainView">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>315</width>
-    <height>233</height>
-   </rect>
-  </property>
-  <property name="autoFillBackground">
-   <bool>true</bool>
-  </property>
-  <layout class="QGridLayout">
-   <property name="leftMargin">
-    <number>0</number>
-   </property>
-   <property name="topMargin">
-    <number>0</number>
-   </property>
-   <property name="rightMargin">
-    <number>0</number>
-   </property>
-   <property name="bottomMargin">
-    <number>0</number>
-   </property>
-   <item row="0" column="0">
-    <widget class="QLabel" name="templateLabel">
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="WindowText">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>119</red>
-           <green>119</green>
-           <blue>119</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Button">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="AlternateBase">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>0</red>
-           <green>0</green>
-           <blue>0</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
-     </property>
-     <property name="font">
-      <font>
-       <family>Sans Serif</family>
-       <pointsize>12</pointsize>
-      </font>
-     </property>
-     <property name="autoFillBackground">
-      <bool>true</bool>
-     </property>
-     <property name="text">
-      <string>hello, world</string>
-     </property>
-     <property name="scaledContents">
-      <bool>true</bool>
-     </property>
-     <property name="alignment">
-      <set>Qt::AlignCenter</set>
-     </property>
-     <property name="wordWrap">
-      <bool>false</bool>
-     </property>
+    <class>MainView</class>
+
+    <widget class="QWidget" name="MainView">
+        <!-- TODO.  Make this maximized by default. -->
+        <property name="geometry">
+            <rect>
+                <x>0</x>
+                <y>0</y>
+                <width>315</width>
+                <height>233</height>
+            </rect>
+        </property>
+
+        <layout class="QGridLayout">
+            <property name="topMargin">
+                <number>0</number>
+            </property>
+
+            <property name="bottomMargin">
+                <number>0</number>
+            </property>
+
+            <property name="leftMargin">
+                <number>0</number>
+            </property>
+
+            <property name="rightMargin">
+                <number>0</number>
+            </property>
+
+            <item row="0" column="0">
+                <widget class="QWebEngineView" name="webEngineView">
+                </widget>
+            </item>
+        </layout>
     </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
+
+    <resources/>
+
+    <connections/>
 </ui>
index 9cde452405cdd43ee1a71c2e8843caa66fae56ed..3564a8e7a71d32e638d4a6a0683de73552fa4473 100644 (file)
@@ -20,8 +20,8 @@
 // Application headers.
 #include "mainview.h"
 #include "mainwindow.h"
-#include "privacybrowserdebug.h"
 #include "settings.h"
+#include "ui_settings.h"
 
 // KDE Frameworks headers.
 #include <KActionCollection>
@@ -30,7 +30,7 @@
 MainWindow::MainWindow() : KXmlGuiWindow()
 {
     // Instantiate the main view pointer.
-    mainViewPointer = new MainView(this);
+    MainView *mainViewPointer = new MainView(this);
 
     // Set the main view as the central widget.
     setCentralWidget(mainViewPointer);
@@ -49,36 +49,45 @@ MainWindow::MainWindow() : KXmlGuiWindow()
     // Connect the signals to the slots.
     connect(switchColorsActionPointer, &QAction::triggered, mainViewPointer, &MainView::switchColors);
 
+    // Add the standard actions.
     KStandardAction::openNew(this, SLOT(fileNew()), actionCollectionPointer);
     KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollectionPointer);
     KStandardAction::preferences(this, SLOT(settingsConfigure()), actionCollectionPointer);
 
+    // Setup the GUI based on the privacybrowserui.rc file.
     setupGUI();
 }
 
 void MainWindow::fileNew()
 {
-    qCDebug(PRIVACYBROWSER) << "MainWindow::fileNew()";
+    // Display a new instance of Privacy Browser.
     (new MainWindow)->show();
 }
 
 void MainWindow::settingsConfigure()
 {
-    qCDebug(PRIVACYBROWSER) << "MainWindow::settingsConfigure()";
-    // The preference dialog is derived from prefs_base.ui
-    //
-    // compare the names of the widgets in the .ui file
-    // to the names of the variables in the .kcfg file
-    //avoid to have 2 dialogs shown
-    if (KConfigDialog::showDialog(QStringLiteral("settings"))) {
-        return;
-    }
+    // Check to make sure the dialog box isn't already displayed.
+    if (!KConfigDialog::exists(QStringLiteral("settings")))
+    {
+        // Create a general settings page.
+        QWidget *generalSettingsWidgetPointer = new QWidget;
+
+        // Instantiate the settings UI.
+        Ui::Settings settingsUi;
+
+        // Setup the UI to display the general settings widget.
+        settingsUi.setupUi(generalSettingsWidgetPointer);
+
+        // Instantiate a settings config dialog from the settings.kcfg file.
+        KConfigDialog *configDialogPointer = new KConfigDialog(this, QStringLiteral("settings"), Settings::self());
 
-    KConfigDialog *dialog = new KConfigDialog(this, QStringLiteral("settings"), Settings::self());
-    QWidget *generalSettingsPage = new QWidget;
-    settingsWidget.setupUi(generalSettingsPage);
-    dialog->addPage(generalSettingsPage, i18nc("@title:tab", "General"), QStringLiteral("package_setting"));
-    connect(dialog, &KConfigDialog::settingsChanged, mainViewPointer, &MainView::handleSettingsChanged);
-    dialog->setAttribute(Qt::WA_DeleteOnClose);
-    dialog->show();
+        // Add the general settings widget page.
+        configDialogPointer->addPage(generalSettingsWidgetPointer, i18nc("@title:tab", "General"), QStringLiteral("package_setting"));
+
+        // Delete the config dialog when it is closed.
+        configDialogPointer->setAttribute(Qt::WA_DeleteOnClose);
+
+        // Make it so.
+        configDialogPointer->show();
+    }
 }
index 3e48bd43175724140485703a11fedc779baee341..588ac9ed3b19ba429178473838da893450b1b9fe 100644 (file)
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
 
-// Application headers.
-#include "settings.h"
-#include "ui_settings.h"
-
 // KDE Frameworks headers.
 #include <KXmlGuiWindow>
 
-class MainView;
-
 class MainWindow : public KXmlGuiWindow
 {
     // Include the Q_OBJECT macro.
@@ -42,10 +36,5 @@ private Q_SLOTS:
     // Define the private slots.
     void fileNew();
     void settingsConfigure();
-
-private:
-    // Define the private variables.
-    Ui::Settings settingsWidget;
-    MainView *mainViewPointer;
 };
 #endif
index 977ea543835dffbca41baca7d7b4efc610d292d1..cedd0c6b1ed7da175cdb26c973973be90273b4fd 100644 (file)
@@ -1,20 +1,43 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<gui name="privacybrowser"
-     version="1"
-     xmlns="http://www.kde.org/standards/kxmlgui/1.0"
-     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-     xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0
-                         http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd">
-<MenuBar>
-  <Menu name="edit">
-    <Action name="switch_action"/>
-  </Menu>
-</MenuBar>
-
-<ToolBar name="mainToolBar" noMerge="1">
-    <text>Main Toolbar</text>
-    <Action name="switch_action"/>
-    <Separator/>
-    <Action name="options_configure"/>
-</ToolBar>
+
+<!--
+  Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+  This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
+
+  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/>. -->
+
+<gui
+    name="privacybrowser"
+    version="1"
+    xmlns="http://www.kde.org/standards/kxmlgui/1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" >
+
+    <MenuBar>
+        <Menu name="edit">
+            <Action name="switch_action"/>
+        </Menu>
+    </MenuBar>
+
+    <ToolBar name="mainToolBar" noMerge="1">
+        <text>Main Toolbar</text>
+
+        <Action name="switch_action"/>
+
+        <Separator/>
+
+        <Action name="options_configure"/>
+    </ToolBar>
 </gui>
index f836ed9cea51126046c384deab0a8bc26bc72a73..5ac9f4c0381a5951dc769af005176947358619cd 100644 (file)
@@ -19,7 +19,7 @@
 <!DOCTYPE RCC>
 <RCC version="1.0">
     <qresource>
-        <file>icons/sc-apps-privacy_browser.svg</file>
+        <file>icons/sc-apps-privacy-browser.svg</file>
         <file>licenses/GPLv3+.txt</file>
     </qresource>
 </RCC>
index 492e0e958cd785f164582ba39f80a46c2b32e78b..9a85eda27cd2485d2563ac7b13be404504c107ce 100644 (file)
@@ -1,21 +1,44 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
-      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-      xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
-      http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
-  <kcfgfile name="privacybrowserpcrc"/>
-  <group name="Preferences">
-    <entry name="colorBackground" type="Color">
-           <label>color of the background</label>
-           <default>black</default>
-    </entry>
-    <entry name="colorForeground" type="Color">
-           <label>color of the foreground</label>
-           <default>yellow</default>
-    </entry>
-    <entry name="ageInDays" type="Int">
-           <label>age of the project</label>
-           <default>2</default>
-    </entry>
-  </group>
+
+<!--
+  Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+  This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
+
+  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/>. -->
+
+<kcfg
+    xmlns="http://www.kde.org/standards/kcfg/1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+
+    <kcfgfile name="privacybrowserpc"/>
+
+    <group name="Preferences">
+        <entry name="colorBackground" type="Color">
+            <label>color of the background</label>
+            <default>black</default>
+        </entry>
+
+        <entry name="colorForeground" type="Color">
+            <label>color of the foreground</label>
+            <default>yellow</default>
+        </entry>
+
+        <entry name="ageInDays" type="Int">
+            <label>age of the project</label>
+            <default>2</default>
+        </entry>
+    </group>
 </kcfg>
index 4f3b929e6fd3b9bc608a96cc182a1c8770bf1b69..4cd27467884968e5527b0c916533c35ec74a3b72 100644 (file)
@@ -25,5 +25,5 @@ ClassName=Settings
 # Make the generated class a singleton.  TODO, the default is false.  This may not be needed.
 Singleton=true
 
-# Create code for mutating (making changes to) the listed variables.  TODO, the default is false.  These may not be needed.
+# Allow mutating (making changes to) the listed variables.
 Mutators=colorBackground,colorForeground
index e7759ac198faa4c4bf4de49c9335f46a8ab146ac..fdfe8f22c520bf655d6a4db53e6eb0be7007ac10 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+  This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
+
+  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/>. -->
+
 <ui version="4.0">
- <class>Settings</class>
- <widget class="QWidget" name="Settings">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>374</width>
-    <height>200</height>
-   </rect>
-  </property>
-  <layout class="QFormLayout">
-   <item row="0" column="0">
-    <widget class="QLabel" name="backgroundLabel">
-     <property name="text">
-      <string>Background color:</string>
-     </property>
+    <class>Settings</class>
+
+    <widget class="QWidget" name="Settings">
+        <property name="geometry">
+            <rect>
+                <x>0</x>
+                <y>0</y>
+                <width>374</width>
+                <height>200</height>
+            </rect>
+        </property>
+
+        <layout class="QFormLayout">
+            <item row="0" column="0">
+                <widget class="QLabel" name="backgroundLabel">
+                    <property name="text">
+                        <string>Background color:</string>
+                    </property>
+                </widget>
+            </item>
+
+            <item row="0" column="1">
+                <widget class="KColorButton" name="kcfg_colorBackground">
+                    <property name="toolTip">
+                        <string>Choose a new background color</string>
+                    </property>
+
+                    <property name="whatsThis">
+                        <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+                            p, li { white-space: pre-wrap; }
+                            &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+                            &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Change the &lt;span style=&quot; font-weight:600;&quot;&gt;background&lt;/span&gt; color by clicking here and choose the new &lt;span style=&quot; color:#ff0000;&quot;&gt;color&lt;/span&gt; in the &lt;span style=&quot; font-style:italic;&quot;&gt;color dialog&lt;/span&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+                    </property>
+
+                    <property name="text">
+                        <string/>
+                    </property>
+                </widget>
+            </item>
+
+            <item row="1" column="0">
+                <widget class="QLabel" name="foregroundLabel">
+                    <property name="text">
+                        <string>Foreground color:</string>
+                    </property>
+                </widget>
+            </item>
+
+            <item row="1" column="1">
+                <widget class="KColorButton" name="kcfg_colorForeground">
+                    <property name="toolTip">
+                        <string>Choose a new foreground color</string>
+                    </property>
+
+                    <property name="whatsThis">
+                        <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+                            p, li { white-space: pre-wrap; }
+                            &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
+                            &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Change the &lt;span style=&quot; font-weight:600;&quot;&gt;foreground&lt;/span&gt; color by clicking here and choose the new &lt;span style=&quot; color:#ff0000;&quot;&gt;color&lt;/span&gt; in the &lt;span style=&quot; font-style:italic;&quot;&gt;color dialog&lt;/span&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+                    </property>
+
+                    <property name="text">
+                        <string/>
+                    </property>
+                </widget>
+            </item>
+
+            <item row="2" column="0">
+                <widget class="QLabel" name="projectLabel">
+                    <property name="text">
+                        <string>Project age:</string>
+                    </property>
+                </widget>
+            </item>
+
+            <item row="2" column="1">
+                <widget class="QSpinBox" name="kcfg_ageInDays">
+                    <property name="toolTip">
+                        <string>Set the project age (in days)</string>
+                    </property>
+
+                    <property name="whatsThis">
+                        <string>Change the project age (in days) by choosing a new number of days.</string>
+                    </property>
+
+                    <property name="minimum">
+                        <number>1</number>
+                    </property>
+
+                    <property name="value">
+                        <number>2</number>
+                    </property>
+                </widget>
+            </item>
+        </layout>
     </widget>
-   </item>
-   <item row="0" column="1">
-    <widget class="KColorButton" name="kcfg_colorBackground">
-     <property name="toolTip">
-      <string>Choose a new background color</string>
-     </property>
-     <property name="whatsThis">
-      <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Change the &lt;span style=&quot; font-weight:600;&quot;&gt;background&lt;/span&gt; color by clicking here and choose the new &lt;span style=&quot; color:#ff0000;&quot;&gt;color&lt;/span&gt; in the &lt;span style=&quot; font-style:italic;&quot;&gt;color dialog&lt;/span&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0">
-    <widget class="QLabel" name="foregroundLabel">
-     <property name="text">
-      <string>Foreground color:</string>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <widget class="KColorButton" name="kcfg_colorForeground">
-     <property name="toolTip">
-      <string>Choose a new foreground color</string>
-     </property>
-     <property name="whatsThis">
-      <string>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Change the &lt;span style=&quot; font-weight:600;&quot;&gt;foreground&lt;/span&gt; color by clicking here and choose the new &lt;span style=&quot; color:#ff0000;&quot;&gt;color&lt;/span&gt; in the &lt;span style=&quot; font-style:italic;&quot;&gt;color dialog&lt;/span&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="0">
-    <widget class="QLabel" name="projectLabel">
-     <property name="text">
-      <string>Project age:</string>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="1">
-    <widget class="QSpinBox" name="kcfg_ageInDays">
-     <property name="toolTip">
-      <string>Set the project age (in days)</string>
-     </property>
-     <property name="whatsThis">
-      <string>Change the project age (in days) by choosing a new number of days.</string>
-     </property>
-     <property name="minimum">
-      <number>1</number>
-     </property>
-     <property name="value">
-      <number>2</number>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>KColorButton</class>
-   <extends>QPushButton</extends>
-   <header>kcolorbutton.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
+
+    <customwidgets>
+        <customwidget>
+            <class>KColorButton</class>
+
+            <extends>QPushButton</extends>
+
+            <header>kcolorbutton.h</header>
+        </customwidget>
+    </customwidgets>
+
+    <resources/>
+
+    <connections/>
 </ui>