]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/commitdiff
At the PO template (translation) framework.
authorSoren Stoutner <soren@stoutner.com>
Fri, 21 Jan 2022 01:28:06 +0000 (18:28 -0700)
committerSoren Stoutner <soren@stoutner.com>
Fri, 21 Jan 2022 01:28:06 +0000 (18:28 -0700)
14 files changed:
CMakeLists.txt
COPYING
po/privacybrowser.pot [new file with mode: 0644]
src/CMakeLists.txt
src/PrivacyBrowserPCSettings.kcfg [deleted file]
src/PrivacyBrowserPCSettings.kcfgc [deleted file]
src/icons/privacy_browser.svg
src/licenses/GPLv3+.txt
src/main.cpp
src/mainwindow.cpp
src/privacybrowserpcview.cpp
src/settings.kcfg [new file with mode: 0644]
src/settings.kcfgc [new file with mode: 0644]
update_po_template [new file with mode: 0755]

index ca98f3512c7a40611ce3edc0d703c97bdb9fba16..29c01f6e5fd7266d8d134faffc44f811836f6b0d 100644 (file)
 # 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/>.
 
+
+# Set the minimum CMake version.
 cmake_minimum_required(VERSION 3.16)
 
+# Name the project.
 project(privacybrowser)
 
 # Set the minimum framework versions.
 set(QT_MIN_VERSION "5.15.0")
 set(KDE_FRAMEWORKS_MIN_VERSION "5.83.0")
 
+# Load the Extra CMake Modules that correspond to the KDE Frameworks version.
 find_package(ECM ${KDE_FRAMEWORKS_MIN_VERSION} REQUIRED NO_MODULE)
+
+# Set the CMake module path.
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
 
+# Include the KDE modules.
 include(KDEInstallDirs)
 include(KDECMakeSettings)
 include(KDECompilerSettings NO_POLICY_SCOPE)
 
+# Include the Extra CMake Modules.
 include(ECMInstallIcons)
 include(ECMQtDeclareLoggingCategory)
 include(FeatureSummary)
 
+# Load the Qt components.
 find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets)
 
+# Load the KDE Frameworks components.
 find_package(KF5 ${KDE_FRAMEWORKS_MIN_VERSION} REQUIRED COMPONENTS
     ConfigWidgets
     CoreAddons
@@ -46,11 +56,13 @@ find_package(KF5 ${KDE_FRAMEWORKS_MIN_VERSION} REQUIRED COMPONENTS
     XmlGui
 )
 
+# Add the subdirectories.
 add_subdirectory(doc)
 add_subdirectory(src)
 
-# Make it possible to use the po files fetched by the fetch-translations step
+# Make it possible to use the PO files fetched by the fetch-translations step.
 ki18n_install(po)
 kdoctools_install(po)
 
+# Generate a summary.
 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/COPYING b/COPYING
index 49e01c84feaab108725e8b5c41829b250e84bafe..3b013331cc9a799c94d70c9f5b5c965748eb4ad3 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -1,4 +1,4 @@
-Privacy Browser PC copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+Privacy Browser PC copyright © 2016-2017,2021-2022 Soren Stoutner <soren@stoutner.com>.
 
 This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
 
diff --git a/po/privacybrowser.pot b/po/privacybrowser.pot
new file mode 100644 (file)
index 0000000..18f6b42
--- /dev/null
@@ -0,0 +1,175 @@
+# 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/>.
+
+
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2022-01-20 17:18-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/privacybrowserpcview.cpp:44
+#, kde-format
+msgid "This project is %1 days old"
+msgstr ""
+
+#: src/mainwindow.cpp:38
+#, kde-format
+msgctxt "@action"
+msgid "Switch Colors"
+msgstr ""
+
+#: src/mainwindow.cpp:74
+#, kde-format
+msgctxt "@title:tab"
+msgid "General"
+msgstr ""
+
+#: src/main.cpp:44
+#, kde-format
+msgid "Privacy Browser"
+msgstr ""
+
+#: src/main.cpp:47
+#, kde-format
+msgid "Soren Stoutner"
+msgstr ""
+
+#: src/main.cpp:47
+#, kde-format
+msgid "Principal developer"
+msgstr ""
+
+#: src/main.cpp:51
+#, kde-format
+msgid "Copyright © 2016-2017,2021-2022 Soren Stoutner <soren@stoutner.com>"
+msgstr ""
+
+#: src/main.cpp:56
+#, kde-format
+msgid "A web browser that respects your privacy."
+msgstr ""
+
+#: rc.cpp:3
+#, kde-format
+msgid "Background color:"
+msgstr ""
+
+#: rc.cpp:6
+#, kde-format
+msgid "Choose a new background color"
+msgstr ""
+
+#: rc.cpp:9
+#, kde-format
+msgid ""
+"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css"
+"\">\n"
+"p, li { white-space: pre-wrap; }\n"
+"</style></head><body style=\" font-family:'DejaVu Serif'; font-size:9pt; "
+"font-weight:400; font-style:normal;\">\n"
+"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-"
+"right:0px; -qt-block-indent:0; text-indent:0px;\">Change the <span style=\" "
+"font-weight:600;\">background</span> color by clicking here and choose the "
+"new <span style=\" color:#ff0000;\">color</span> in the <span style=\" font-"
+"style:italic;\">color dialog</span>.</p></body></html>"
+msgstr ""
+
+#: rc.cpp:15
+#, kde-format
+msgid "Foreground color:"
+msgstr ""
+
+#: rc.cpp:18
+#, kde-format
+msgid "Choose a new foreground color"
+msgstr ""
+
+#: rc.cpp:21
+#, kde-format
+msgid ""
+"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css"
+"\">\n"
+"p, li { white-space: pre-wrap; }\n"
+"</style></head><body style=\" font-family:'DejaVu Serif'; font-size:9pt; "
+"font-weight:400; font-style:normal;\">\n"
+"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-"
+"right:0px; -qt-block-indent:0; text-indent:0px;\">Change the <span style=\" "
+"font-weight:600;\">foreground</span> color by clicking here and choose the "
+"new <span style=\" color:#ff0000;\">color</span> in the <span style=\" font-"
+"style:italic;\">color dialog</span>.</p></body></html>"
+msgstr ""
+
+#: rc.cpp:27
+#, kde-format
+msgid "Project age:"
+msgstr ""
+
+#: rc.cpp:30
+#, kde-format
+msgid "Set the project age (in days)"
+msgstr ""
+
+#: rc.cpp:33
+#, kde-format
+msgid "Change the project age (in days) by choosing a new number of days."
+msgstr ""
+
+#: rc.cpp:36
+#, kde-format
+msgid "color of the background"
+msgstr ""
+
+#: rc.cpp:39
+#, kde-format
+msgid "color of the foreground"
+msgstr ""
+
+#: rc.cpp:42
+#, kde-format
+msgid "age of the project"
+msgstr ""
+
+#: rc.cpp:45
+#, kde-format
+msgid "hello, world"
+msgstr ""
+
+#: rc.cpp:48
+#, kde-format
+msgid "Main Toolbar"
+msgstr ""
+
+#: rc.cpp:49
+#, kde-format
+msgctxt "NAME OF TRANSLATORS"
+msgid "Your names"
+msgstr ""
+
+#: rc.cpp:50
+#, kde-format
+msgctxt "EMAIL OF TRANSLATORS"
+msgid "Your emails"
+msgstr ""
index 077ff051da2a63c212052ae9c89fd16362bf3fe4..e251e06d08a8fc4301f1ce5d339b022883c7a29f 100644 (file)
 # 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/>.
 
+
 # Create the executable and add the resources.
 add_executable(privacybrowser resources.qrc)
 
+# List the sources to include in the executable.
 target_sources(privacybrowser PRIVATE
     main.cpp
     mainwindow.cpp
     privacybrowserpcview.cpp
 )
 
+# Add the Qt logging category.
 ecm_qt_declare_logging_category(privacybrowser
-    HEADER privacybrowserpcdebug.h
+    HEADER privacybrowserdebug.h
     IDENTIFIER PRIVACYBROWSER
     CATEGORY_NAME "privacybrowser"
 )
-kconfig_add_kcfg_files(privacybrowser PrivacyBrowserPCSettings.kcfgc)
+
+# Include the KConfig controller file.
+kconfig_add_kcfg_files(privacybrowser settings.kcfgc)
+
+# Use KDE Frameworks to handle internationalization of the following UI files.
 ki18n_wrap_ui(privacybrowser
     privacybrowserpcview.ui
     settings.ui
 )
 
+
 target_link_libraries(privacybrowser
     KF5::CoreAddons
     KF5::I18n
diff --git a/src/PrivacyBrowserPCSettings.kcfg b/src/PrivacyBrowserPCSettings.kcfg
deleted file mode 100644 (file)
index 492e0e9..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?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>
-</kcfg>
diff --git a/src/PrivacyBrowserPCSettings.kcfgc b/src/PrivacyBrowserPCSettings.kcfgc
deleted file mode 100644 (file)
index aae44b6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# Code generation options for kconfig_compiler
-File=PrivacyBrowserPCSettings.kcfg
-ClassName=PrivacyBrowserPCSettings
-Singleton=true
-# will create the necessary code for setting those variables
-Mutators=colorBackground,colorForeground
index 5d39ed42e120ba93d5b8da6d321b02a9a1be3cd9..428d50771f089dd52e31307a999f5edbbb3b2d47 100644 (file)
 <?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
-   height="546.13336"
-   viewBox="0 0 256 256"
-   width="546.13336"
-   id="svg2"
-   version="1.1"
-   inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
-   sodipodi:docname="privacy_browser.svg"
-   style="fill:#000000"
-   inkscape:export-filename="/home/soren/ownCloud/Android/Privacy Browser/Icons/Privacy Browser/Privacy Browser 680x680.png"
-   inkscape:export-xdpi="119.53"
-   inkscape:export-ydpi="119.53"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:dc="http://purl.org/dc/elements/1.1/">
-  <metadata
-     id="metadata12">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <defs
-     id="defs10" />
-  <sodipodi:namedview
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1"
-     objecttolerance="10"
-     gridtolerance="10"
-     guidetolerance="10"
-     inkscape:pageopacity="0"
-     inkscape:pageshadow="2"
-     inkscape:window-width="3644"
-     inkscape:window-height="2015"
-     id="namedview8"
-     showgrid="false"
-     inkscape:snap-bbox="true"
-     inkscape:zoom="1.2291667"
-     inkscape:cx="-108.61017"
-     inkscape:cy="218.84745"
-     inkscape:window-x="0"
-     inkscape:window-y="0"
-     inkscape:window-maximized="1"
-     inkscape:current-layer="g4150"
-     inkscape:pagecheckerboard="0">
-    <inkscape:grid
-       type="xygrid"
-       id="grid4223"
-       originx="0"
-       originy="0"
-       spacingx="1"
-       spacingy="1" />
-  </sodipodi:namedview>
-  <g
-     style="display:inline"
-     transform="translate(0,160)"
-     inkscape:label="Inner Shield"
-     id="g4150"
-     inkscape:groupmode="layer"
-     sodipodi:insensitive="true">
-    <path
-       style="display:inline;fill:#0d47a1;fill-opacity:1;stroke:none"
-       inkscape:connector-curvature="0"
-       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"
-       id="path4152"
-       sodipodi:nodetypes="ccscscc" />
-  </g>
-  <g
-     inkscape:groupmode="layer"
-     id="layer5"
-     inkscape:label="Shield"
-     transform="translate(0,160)"
-     style="display:inline"
-     sodipodi:insensitive="true">
-    <path
-       id="path4610-5"
-       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"
-       inkscape:connector-curvature="0"
-       style="display:inline;fill:#1976d2;fill-opacity:1;stroke:none" />
-  </g>
-  <g
-     inkscape:groupmode="layer"
-     id="layer3"
-     inkscape:label="Earth"
-     style="display:inline"
-     transform="translate(0,232)"
-     sodipodi:insensitive="true">
-    <path
-       style="display:inline;fill:#ffffff;fill-opacity:1"
-       id="path4209"
-       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"
-       inkscape:connector-curvature="0" />
-  </g>
+    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 49e01c84feaab108725e8b5c41829b250e84bafe..5bb31d51484e5c8c2c9c4186b98c6bdab419eed3 100644 (file)
@@ -1,5 +1,3 @@
-Privacy Browser PC 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
index 4f84887198df02807cf1ec7465b54c53a61b8a5d..5605cdf3760f10c07455192b78c77bce7ef77431 100644 (file)
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
 
     // Populate additional about data info.
     aboutData.setBugAddress("https://redmine.stoutner.com/projects/privacy-browser-pc/issues");
-    aboutData.setCopyrightStatement(i18n("Copyright © 2022 Soren Stoutner <soren@stoutner.com>"));
+    aboutData.setCopyrightStatement(i18n("Copyright © 2016-2017,2021-2022 Soren Stoutner <soren@stoutner.com>"));
     aboutData.setDesktopFileName(QStringLiteral("com.stoutner.privacybrowser"));
     aboutData.setHomepage(QStringLiteral("https://www.stoutner.com/privacy-browser-pc/"));
     aboutData.setLicenseTextFile(":/licenses/GPLv3+.txt");
index 739fca9603b3e11e6bc78f0a44cda526303a61b9..d0c4e1b0062c0d3634e8de66cb17558c415f41d9 100644 (file)
@@ -20,7 +20,8 @@
 // Application headers.
 #include "mainwindow.h"
 #include "privacybrowserpcview.h"
-#include "privacybrowserpcdebug.h"
+#include "privacybrowserdebug.h"
+#include "settings.h"
 
 // KDE Frameworks headers.
 #include <KActionCollection>
@@ -67,7 +68,7 @@ void MainWindow::settingsConfigure()
         return;
     }
 
-    KConfigDialog *dialog = new KConfigDialog(this, QStringLiteral("settings"), PrivacyBrowserPCSettings::self());
+    KConfigDialog *dialog = new KConfigDialog(this, QStringLiteral("settings"), Settings::self());
     QWidget *generalSettingsPage = new QWidget;
     m_settings.setupUi(generalSettingsPage);
     dialog->addPage(generalSettingsPage, i18nc("@title:tab", "General"), QStringLiteral("package_setting"));
index 84e5eed2b801cb16708a1280ffe9ba3dfcd339e2..8369f99391d8907bad3bac343b28c37e9f7ea726 100644 (file)
@@ -7,8 +7,8 @@
 // application headers
 #include "privacybrowserpcview.h"
 
-#include "PrivacyBrowserPCSettings.h"
-#include "privacybrowserpcdebug.h"
+#include "settings.h"
+#include "privacybrowserdebug.h"
 
 
 PrivacyBrowserPCView::PrivacyBrowserPCView(QWidget *parent)
@@ -25,9 +25,9 @@ PrivacyBrowserPCView::~PrivacyBrowserPCView()
 void PrivacyBrowserPCView::switchColors()
 {
     // switch the foreground/background colors of the label
-    QColor color = PrivacyBrowserPCSettings::colorBackground();
-    PrivacyBrowserPCSettings::setColorBackground(PrivacyBrowserPCSettings::colorForeground());
-    PrivacyBrowserPCSettings::setColorForeground(color);
+    QColor color = Settings::colorBackground();
+    Settings::setColorBackground(Settings::colorForeground());
+    Settings::setColorForeground(color);
 
     handleSettingsChanged();
 }
@@ -36,11 +36,11 @@ void PrivacyBrowserPCView::handleSettingsChanged()
 {
     qCDebug(PRIVACYBROWSER) << "PrivacyBrowserPCView::handleSettingsChanged()";
     QPalette palette = m_ui.templateLabel->palette();
-    palette.setColor(QPalette::Window, PrivacyBrowserPCSettings::colorBackground());
-    palette.setColor(QPalette::WindowText, PrivacyBrowserPCSettings::colorForeground());
+    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", PrivacyBrowserPCSettings::ageInDays()));
+    m_ui.templateLabel->setText(i18n("This project is %1 days old", Settings::ageInDays()));
 }
 
diff --git a/src/settings.kcfg b/src/settings.kcfg
new file mode 100644 (file)
index 0000000..492e0e9
--- /dev/null
@@ -0,0 +1,21 @@
+<?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>
+</kcfg>
diff --git a/src/settings.kcfgc b/src/settings.kcfgc
new file mode 100644 (file)
index 0000000..4f3b929
--- /dev/null
@@ -0,0 +1,29 @@
+# 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/>.
+
+
+# Specify the KConfig file.
+File=settings.kcfg
+
+# Specify the class name, which will be used to autogenerate .cpp and .h files.
+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.
+Mutators=colorBackground,colorForeground
diff --git a/update_po_template b/update_po_template
new file mode 100755 (executable)
index 0000000..38aa12c
--- /dev/null
@@ -0,0 +1,32 @@
+#! /usr/bin/env bash
+
+# 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/>.
+
+
+# Extract the strings from the UI and RC files and add them to a temporary .app file.
+extractrc `find -name \*.ui -o -name \*.rc -o -name \*.kcfg` >> rc.cpp
+
+# Add the names of the translators.
+echo 'i18nc("NAME OF TRANSLATORS", "Your names");' >> rc.cpp
+echo 'i18nc("EMAIL OF TRANSLATORS", "Your emails");' >> rc.cpp
+
+# Extract all the string to a PO template file.
+xgettext --c++ --kde --from-code=UTF-8 -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 -kkli18n:1 -kkli18nc:1c,2 -kkli18np:1,2 -kkli18ncp:1c,2,3 -kI18N_NOOP:1 -kI18NC_NOOP:1c,2 `find . -name \*.cpp` -o po/privacybrowser.pot
+
+# Remove the temporary .app file.
+rm -f rc.cpp