]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/commitdiff
Rename Local Storage to DOM Storage. https://redmine.stoutner.com/issues/852
authorSoren Stoutner <soren@stoutner.com>
Tue, 17 May 2022 23:10:23 +0000 (16:10 -0700)
committerSoren Stoutner <soren@stoutner.com>
Tue, 17 May 2022 23:10:23 +0000 (16:10 -0700)
40 files changed:
src/CMakeLists.txt
src/dialogs/AddOrEditCookieDialog.cpp
src/dialogs/CookiesDialog.cpp
src/dialogs/CookiesDialog.h
src/dialogs/DomainSettingsDialog.cpp
src/dialogs/DomainSettingsDialog.h
src/filters/MouseEventFilter.cpp
src/helpers/DomainsDatabaseHelper.cpp
src/helpers/DomainsDatabaseHelper.h
src/helpers/SearchEngineHelper.cpp
src/helpers/UserAgentHelper.cpp
src/icons/cookies-off.svg [new file with mode: 0644]
src/icons/cookies-on.svg [new file with mode: 0644]
src/interceptors/UrlRequestInterceptor.cpp
src/resources.qrc
src/settings/Settings.kcfg
src/settings/Settings.kcfgc
src/structs/CMakeLists.txt [new file with mode: 0644]
src/structs/PrivacyWebEngine.cpp [new file with mode: 0644]
src/structs/PrivacyWebEngine.h [new file with mode: 0644]
src/ui.rc/CMakeLists.txt [deleted file]
src/ui.rc/browser_ui.rc [deleted file]
src/ui.rcs/CMakeLists.txt [new file with mode: 0644]
src/ui.rcs/browser_ui.rc [new file with mode: 0644]
src/ui/AddOrEditCookieDialog.ui [deleted file]
src/ui/BrowserView.ui [deleted file]
src/ui/CookiesDialog.ui [deleted file]
src/ui/DomainSettingsDialog.ui [deleted file]
src/ui/SettingsGeneral.ui [deleted file]
src/ui/SettingsPrivacy.ui [deleted file]
src/uis/AddOrEditCookieDialog.ui [new file with mode: 0644]
src/uis/BrowserView.ui [new file with mode: 0644]
src/uis/CookiesDialog.ui [new file with mode: 0644]
src/uis/DomainSettingsDialog.ui [new file with mode: 0644]
src/uis/SettingsGeneral.ui [new file with mode: 0644]
src/uis/SettingsPrivacy.ui [new file with mode: 0644]
src/views/BrowserView.cpp
src/views/BrowserView.h
src/windows/BrowserWindow.cpp
src/windows/BrowserWindow.h

index 9729c95e3151f9ec34180c0006d0c02ac5f60be2..fb702314c31b9b49bd0efa8c8bb54197c18679d0 100644 (file)
@@ -35,12 +35,12 @@ kconfig_add_kcfg_files(privacy-browser settings/Settings.kcfgc)
 
 # Use KDE Frameworks to handle internationalization of the following UI files.
 ki18n_wrap_ui(privacy-browser
-    ui/AddOrEditCookieDialog.ui
-    ui/BrowserView.ui
-    ui/CookiesDialog.ui
-    ui/DomainSettingsDialog.ui
-    ui/SettingsGeneral.ui
-    ui/SettingsPrivacy.ui
+    uis/AddOrEditCookieDialog.ui
+    uis/BrowserView.ui
+    uis/CookiesDialog.ui
+    uis/DomainSettingsDialog.ui
+    uis/SettingsGeneral.ui
+    uis/SettingsPrivacy.ui
 )
 
 # Link the following libraries.
@@ -66,7 +66,8 @@ add_subdirectory(dialogs)
 add_subdirectory(filters)
 add_subdirectory(helpers)
 add_subdirectory(interceptors)
-add_subdirectory(ui.rc)
+add_subdirectory(structs)
+add_subdirectory(ui.rcs)
 add_subdirectory(views)
 add_subdirectory(windows)
 
index 1b0a9441a8a91e6dbb5e47d23f78ee7cb66c258f..78234a68b1119e29908cb8f6b48e41ff774b46d8 100644 (file)
@@ -32,6 +32,7 @@
 const int AddOrEditCookieDialog::AddCookie = 0;
 const int AddOrEditCookieDialog::EditCookie = 1;
 
+// Construct the class.
 AddOrEditCookieDialog::AddOrEditCookieDialog(const int &dialogType, const QNetworkCookie *cookiePointer) : QDialog(nullptr)
 {
     // Set the dialog window title according to the dialog type.
index 5763cb9c2ead6d6c68d8939e5b726bbb10cdc825..b200891566a8ef8def175108394de306e1cda854 100644 (file)
@@ -31,6 +31,7 @@
 #include <QShortcut>
 #include <QUrl>
 
+// Construct the class.
 bool cookieSortPredicate(const QNetworkCookie &leftHandCookie, const QNetworkCookie &rightHandCookie)
 {
     // Check to see if the domains are identical.
@@ -99,7 +100,7 @@ bool cookieSortPredicate(const QNetworkCookie &leftHandCookie, const QNetworkCoo
     }
 }
 
-CookiesDialog::CookiesDialog(std::forward_list<QNetworkCookie> *originalCookieListPointer) : QDialog(nullptr), cookieListPointer(originalCookieListPointer)
+CookiesDialog::CookiesDialog(std::list<QNetworkCookie> *originalCookieListPointer) : QDialog(nullptr), cookieListPointer(originalCookieListPointer)
 {
     // Set the dialog window title.
     setWindowTitle(i18nc("The cookies dialog window title", "Cookies"));
index 770a84681bfcd7b3c5bd9af7ce6203f1bafa8da3..f34beca66ad7b95153b93030472a7649f6069e69 100644 (file)
@@ -28,7 +28,7 @@
 #include <QTreeView>
 
 // C++ headers.
-#include <forward_list>
+#include <list>
 
 class CookiesDialog : public QDialog
 {
@@ -37,7 +37,7 @@ class CookiesDialog : public QDialog
 
 public:
     // The primary constructor.
-    explicit CookiesDialog(std::forward_list<QNetworkCookie> *cookieListPointer);
+    explicit CookiesDialog(std::list<QNetworkCookie> *cookieListPointer);
 
 signals:
     // The signals.
@@ -59,7 +59,7 @@ private:
     // The private variables.
     QItemSelectionModel *treeViewSelectionModelPointer;
     QPushButton *addCookieButtonPointer;
-    std::forward_list<QNetworkCookie> *cookieListPointer;
+    std::list<QNetworkCookie> *cookieListPointer;
     QPushButton *deleteAllButtonPointer;
     QPushButton *deleteCookieButtonPointer;
     QPushButton *editCookieButtonPointer;
index 32d61d09e4363401848c19eb39a1851d9cd7268f..eb43fb560ec7431b94dd1e1bbbf2721af5a604d0 100644 (file)
@@ -34,6 +34,7 @@ const int DomainSettingsDialog::SHOW_ALL_DOMAINS = 0;
 const int DomainSettingsDialog::ADD_DOMAIN = 1;
 const int DomainSettingsDialog::EDIT_DOMAIN = 2;
 
+// Construct the class.
 DomainSettingsDialog::DomainSettingsDialog(const int &startType, const QString &domainName) : QDialog(nullptr)
 {
     // Set the window title.
@@ -48,14 +49,14 @@ DomainSettingsDialog::DomainSettingsDialog(const int &startType, const QString &
     // Setup the UI.
     domainSettingsDialogUi.setupUi(this);
 
-    // Get handles for the views.
+    // Get handles for the widgets.
     domainsListViewPointer = domainSettingsDialogUi.domainsListView;
     domainSettingsWidgetPointer = domainSettingsDialogUi.domainSettingsWidget;
     domainNameLineEditPointer = domainSettingsDialogUi.domainNameLineEdit;
     javaScriptComboBoxPointer = domainSettingsDialogUi.javaScriptComboBox;
     javaScriptLabelPointer = domainSettingsDialogUi.javaScriptLabel;
-    localStorageComboBoxPointer = domainSettingsDialogUi.localStorageComboBox;
-    localStorageLabelPointer = domainSettingsDialogUi.localStorageLabel;
+    domStorageComboBoxPointer = domainSettingsDialogUi.domStorageComboBox;
+    domStorageLabelPointer = domainSettingsDialogUi.domStorageLabel;
     userAgentComboBoxPointer = domainSettingsDialogUi.userAgentComboBox;
     userAgentLabelPointer = domainSettingsDialogUi.userAgentLabel;
     zoomFactorComboBoxPointer = domainSettingsDialogUi.zoomFactorComboBox;
@@ -129,10 +130,10 @@ DomainSettingsDialog::DomainSettingsDialog(const int &startType, const QString &
     // Handle clicks on the domains.
     connect(domainsListViewPointer, SIGNAL(activated(QModelIndex)), this, SLOT(domainSelected(QModelIndex)));
 
-    // Connect the domain settings.
+    // Process changes to the domain settings.
     connect(domainNameLineEditPointer, SIGNAL(textEdited(QString)), this, SLOT(domainNameChanged(QString)));
     connect(javaScriptComboBoxPointer, SIGNAL(currentIndexChanged(int)), this, SLOT(javaScriptChanged(int)));
-    connect(localStorageComboBoxPointer, SIGNAL(currentIndexChanged(int)), this, SLOT(localStorageChanged(int)));
+    connect(domStorageComboBoxPointer, SIGNAL(currentIndexChanged(int)), this, SLOT(domStorageChanged(int)));
     connect(userAgentComboBoxPointer, SIGNAL(currentTextChanged(QString)), this, SLOT(userAgentChanged(QString)));
     connect(zoomFactorComboBoxPointer, SIGNAL(currentIndexChanged(int)), this, SLOT(zoomFactorComboBoxChanged(int)));
     connect(customZoomFactorSpinBoxPointer, SIGNAL(valueChanged(double)), this, SLOT(customZoomFactorChanged(double)));
@@ -157,7 +158,7 @@ void DomainSettingsDialog::addDomain(const QString &domainName) const
     // Set the values for the new domain.
     newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::DOMAIN_NAME), domainName);
     newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::JAVASCRIPT), DomainsDatabaseHelper::SYSTEM_DEFAULT);
-    newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::LOCAL_STORAGE), DomainsDatabaseHelper::SYSTEM_DEFAULT);
+    newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::DOM_STORAGE), DomainsDatabaseHelper::SYSTEM_DEFAULT);
     newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::USER_AGENT), UserAgentHelper::SYSTEM_DEFAULT_DATABASE);
     newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::ZOOM_FACTOR), DomainsDatabaseHelper::SYSTEM_DEFAULT);
     newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::CUSTOM_ZOOM_FACTOR), 1.0);
@@ -244,8 +245,8 @@ void DomainSettingsDialog::domainSelected(const QModelIndex &modelIndex) const
     // Populate the JavaScript combo box.
     javaScriptComboBoxPointer->setCurrentIndex(modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::JAVASCRIPT)).data().toInt());
 
-    // Populate the local storage combo box.
-    localStorageComboBoxPointer->setCurrentIndex(modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::LOCAL_STORAGE)).data().toInt());
+    // Populate the DOM storage combo box.
+    domStorageComboBoxPointer->setCurrentIndex(modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::DOM_STORAGE)).data().toInt());
 
     // Get the user agent string.
     QString userAgent = modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::USER_AGENT)).data().toString();
@@ -282,7 +283,7 @@ void DomainSettingsDialog::domainSelected(const QModelIndex &modelIndex) const
 
     // Populate the labels.
     populateJavaScriptLabel();
-    populateLocalStorageLabel();
+    populateDomStorageLabel();
     populateUserAgentLabel(userAgentComboBoxPointer->currentText());
 
     // Update the UI.
@@ -302,14 +303,14 @@ void DomainSettingsDialog::javaScriptChanged(const int &newIndex) const
     updateUi();
 }
 
-void DomainSettingsDialog::localStorageChanged(const int &newIndex) const
+void DomainSettingsDialog::domStorageChanged(const int &newIndex) const
 {
     // Update the domains table model.
-    domainsTableModelPointer->setData(domainsListViewPointer->selectionModel()->currentIndex().siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::LOCAL_STORAGE)),
+    domainsTableModelPointer->setData(domainsListViewPointer->selectionModel()->currentIndex().siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::DOM_STORAGE)),
                                       newIndex);
 
-    // Populate the local storage label.
-    populateLocalStorageLabel();
+    // Populate the DOM storage label.
+    populateDomStorageLabel();
 
     // Update the UI.
     updateUi();
@@ -335,8 +336,10 @@ void DomainSettingsDialog::populateJavaScriptLabel() const
         case (DomainsDatabaseHelper::SYSTEM_DEFAULT):
         {
             // Set the text according to the system default.
-            if (Settings::javaScript()) javaScriptLabelPointer->setText(i18nc("Domains settings label", "JavaScript enabled"));
-            else javaScriptLabelPointer->setText(i18nc("Domain settings label", "JavaScript disabled"));
+            if (Settings::javaScriptEnabled())
+                javaScriptLabelPointer->setText(i18nc("Domains settings label", "JavaScript enabled"));
+            else
+                javaScriptLabelPointer->setText(i18nc("Domain settings label", "JavaScript disabled"));
 
             break;
         }
@@ -344,7 +347,7 @@ void DomainSettingsDialog::populateJavaScriptLabel() const
         case (DomainsDatabaseHelper::DISABLED):
         {
             // Set the label text in bold.
-            javaScriptLabelPointer->setText(i18nc("Domain settings label.  The <strong> tags should be retained.", "<strong>JavaScript disabled</strong>"));
+            javaScriptLabelPointer->setText(i18nc("Domain settings label.  The <b> tags should be retained.", "<b>JavaScript disabled</b>"));
 
             break;
         }
@@ -352,23 +355,25 @@ void DomainSettingsDialog::populateJavaScriptLabel() const
         case (DomainsDatabaseHelper::ENABLED):
         {
             // Set the label text in bold.
-            javaScriptLabelPointer->setText(i18nc("Domains settings label.  The <strong> tags should be retained.", "<strong>JavaScript enabled</strong>"));
+            javaScriptLabelPointer->setText(i18nc("Domains settings label.  The <b> tags should be retained.", "<b>JavaScript enabled</b>"));
 
             break;
         }
     }
 }
 
-void DomainSettingsDialog::populateLocalStorageLabel() const
+void DomainSettingsDialog::populateDomStorageLabel() const
 {
     // Populate the label according to the currently selected index.
-    switch (localStorageComboBoxPointer->currentIndex())
+    switch (domStorageComboBoxPointer->currentIndex())
     {
         case (DomainsDatabaseHelper::SYSTEM_DEFAULT):
         {
             // Set the text according to the system default.
-            if (Settings::localStorage()) localStorageLabelPointer->setText(i18nc("Local storage label", "Local storage enabled"));
-            else localStorageLabelPointer->setText(i18nc("Local storage label", "Local storage disabled"));
+            if (Settings::domStorageEnabled())
+                domStorageLabelPointer->setText(i18nc("DOM storage label", "DOM storage enabled"));
+            else
+                domStorageLabelPointer->setText(i18nc("DOM storage label", "DOM storage disabled"));
 
             break;
         }
@@ -376,7 +381,7 @@ void DomainSettingsDialog::populateLocalStorageLabel() const
         case (DomainsDatabaseHelper::DISABLED):
         {
             // Set the label text in bold.
-            localStorageLabelPointer->setText(i18nc("Local storage label.  The <string> tags should be retained.", "<strong>Local storage disabled</strong>"));
+            domStorageLabelPointer->setText(i18nc("DOM storage label.  The <b> tags should be retained.", "<b>DOM storage disabled</b>"));
 
             break;
         }
@@ -384,7 +389,7 @@ void DomainSettingsDialog::populateLocalStorageLabel() const
         case (DomainsDatabaseHelper::ENABLED):
         {
             // Set the label text in bold.
-            localStorageLabelPointer->setText(i18nc("Local storage label.  The <strong> tags should be retained.", "<strong>Local storage enabled</strong>"));
+            domStorageLabelPointer->setText(i18nc("DOM storage label.  The <b> tags should be retained.", "<b>DOM storage enabled</b>"));
 
             break;
         }
index 5663787b1b6ecc749cef5c431b08d1e4d4abde14..a96c0d0df8b3496352ae80abdff138c4e52539d4 100644 (file)
@@ -51,10 +51,10 @@ private Q_SLOTS:
     void apply() const;
     void cancel();
     void customZoomFactorChanged(const double &newValue) const;
+    void domStorageChanged(const int &newIndex) const;
     void domainNameChanged(const QString &updatedDomainName) const;
     void domainSelected(const QModelIndex &modelIndex) const;
     void javaScriptChanged(const int &newIndex) const;
-    void localStorageChanged(const int &newIndex) const;
     void ok();
     void reset() const;
     void showAddMessageBox();
@@ -67,14 +67,14 @@ private:
     QPushButton *applyButtonPointer;
     QDoubleSpinBox *customZoomFactorSpinBoxPointer;
     QPushButton *deleteDomainButtonPointer;
+    QComboBox *domStorageComboBoxPointer;
+    QLabel *domStorageLabelPointer;
     QListView *domainsListViewPointer;
     KLineEdit *domainNameLineEditPointer;
     QWidget *domainSettingsWidgetPointer;
     QSqlTableModel *domainsTableModelPointer;
     QComboBox *javaScriptComboBoxPointer;
     QLabel *javaScriptLabelPointer;
-    QComboBox *localStorageComboBoxPointer;
-    QLabel *localStorageLabelPointer;
     QPushButton *resetButtonPointer;
     QComboBox *userAgentComboBoxPointer;
     QLabel *userAgentLabelPointer;
@@ -83,7 +83,7 @@ private:
     // The private functions.
     void addDomain(const QString &domainName) const;
     void populateJavaScriptLabel() const;
-    void populateLocalStorageLabel() const;
+    void populateDomStorageLabel() const;
     void populateUserAgentLabel(const QString &userAgentName) const;
     void updateUi() const;
 };
index 51bbb09031be2536e7ae2c15fd3d641da946054e..b6cb81f3f7a2bf50db90ae656a4aceea6b4e5395 100644 (file)
@@ -27,6 +27,7 @@
 // The primary constructor.
 MouseEventFilter::MouseEventFilter() : QObject() {};
 
+// Construct the class.
 bool MouseEventFilter::eventFilter(QObject *objectPointer, QEvent *eventPointer)
 {
     // Only process mouse button press events.
index 6ed871647cf7e4b62821a3d260e1b8ef707bbc09..2d63bd9c785c956abcc688e18b6ddbc27878fa2f 100644 (file)
@@ -32,12 +32,12 @@ const int DomainsDatabaseHelper::SCHEMA_VERSION = 4;
 const QString DomainsDatabaseHelper::_ID = "_id";
 const QString DomainsDatabaseHelper::DOMAIN_NAME = "domain_name";
 const QString DomainsDatabaseHelper::JAVASCRIPT = "javascript";
-const QString DomainsDatabaseHelper::LOCAL_STORAGE = "local_storage";
+const QString DomainsDatabaseHelper::DOM_STORAGE = "dom_storage";
 const QString DomainsDatabaseHelper::USER_AGENT = "user_agent";
 const QString DomainsDatabaseHelper::ZOOM_FACTOR = "zoom_factor";
 const QString DomainsDatabaseHelper::CUSTOM_ZOOM_FACTOR = "custom_zoom_factor";
 
-// The default constructor.
+// Construct the class.
 DomainsDatabaseHelper::DomainsDatabaseHelper() {}
 
 void DomainsDatabaseHelper::addDatabase()
@@ -102,8 +102,8 @@ void DomainsDatabaseHelper::addDatabase()
 
                     // Upgrade from schema version 3 to schema version 4.
                     case 3:
-                        // Add the Local Storage column.
-                        domainsDatabase.exec("ALTER TABLE " + DOMAINS_TABLE + " ADD COLUMN " + LOCAL_STORAGE + " INTEGER DEFAULT 0");
+                        // Add the DOM Storage column.
+                        domainsDatabase.exec("ALTER TABLE " + DOMAINS_TABLE + " ADD COLUMN " + DOM_STORAGE + " INTEGER DEFAULT 0");
                 }
 
                 // Update the schema version.
@@ -120,7 +120,7 @@ void DomainsDatabaseHelper::addDatabase()
                 _ID + " INTEGER PRIMARY KEY, " +
                 DOMAIN_NAME + " TEXT, " +
                 JAVASCRIPT + " INTEGER DEFAULT 0, " +
-                LOCAL_STORAGE + " INTEGER DEFAULT 0, " +
+                DOM_STORAGE + " INTEGER DEFAULT 0, " +
                 USER_AGENT + " TEXT DEFAULT '" + UserAgentHelper::SYSTEM_DEFAULT_DATABASE + "', " +
                 ZOOM_FACTOR + " INTEGER DEFAULT 0, " +
                 CUSTOM_ZOOM_FACTOR + " REAL DEFAULT 1.0)"
index 2ec812b480b9bfd01a2309eeb157b77d3ddfd5d6..9ab0f92698758257d7a5ccbfaaa9b875e76ee052 100644 (file)
@@ -43,10 +43,10 @@ public:
     static const QString _ID;
     static const QString CONNECTION_NAME;
     static const QString CUSTOM_ZOOM_FACTOR;
+    static const QString DOM_STORAGE;
     static const QString DOMAIN_NAME;
     static const QString DOMAINS_TABLE;
     static const QString JAVASCRIPT;
-    static const QString LOCAL_STORAGE;
     static const QString USER_AGENT;
     static const QString ZOOM_FACTOR;
 
index 82919269a7f19bf8368267669481a31a280606bf..8c0feb4bd2a69a099db843eb344801c813f32243 100644 (file)
@@ -20,7 +20,7 @@
 // Application headers.
 #include "SearchEngineHelper.h"
 
-// The default constructor.
+// Construct the class.
 SearchEngineHelper::SearchEngineHelper() {};
 
 QString SearchEngineHelper::getSearchUrl(const QString &searchEngineName)
index 9a51f227679962cbd6588b8fa6bb61de6c822835..634f16b65cd42e08de0d80a7c72bf328b60e4a50 100644 (file)
@@ -56,7 +56,7 @@ const QString UserAgentHelper::CHROME_WINDOWS_USER_AGENT = QStringLiteral("Mozil
 const QString UserAgentHelper::EDGE_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.56");
 const QString UserAgentHelper::SAFARI_MACOS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15");
 
-// The default constructor.
+// Construct the class.
 UserAgentHelper::UserAgentHelper() {};
 
 QString UserAgentHelper::getDatabaseUserAgentNameFromTranslatedName(const QString &translatedUserAgentName)
diff --git a/src/icons/cookies-off.svg b/src/icons/cookies-off.svg
new file mode 100644 (file)
index 0000000..7f84085
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   viewBox="0 0 256 256"
+   version="1.1"
+   id="svg8"
+   sodipodi:docname="cookies-off.svg"
+   inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
+   width="256"
+   height="256"
+   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">
+  <sodipodi:namedview
+     id="namedview10"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     inkscape:pagecheckerboard="0"
+     showgrid="false"
+     inkscape:zoom="6.3203125"
+     inkscape:cx="65.89864"
+     inkscape:cy="135.19901"
+     inkscape:window-width="3644"
+     inkscape:window-height="2015"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg8"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0" />
+  <defs
+     id="defs3051">
+    <style
+       type="text/css"
+       id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#232629;
+      }
+      .ColorScheme-PositiveText {
+        color:#27ae60;
+      }
+      </style>
+  </defs>
+  <path
+     style="fill:currentColor;fill-opacity:1;stroke:none;stroke-width:15.9983"
+     d="M 128,8.0125 A 95.990005,95.990005 0 0 0 56.757416,40.00916 H 16.011659 c -8.863077,0 -15.998334,7.13526 -15.998334,15.99834 v 95.99 c 0,8.86307 7.135257,15.99833 15.998334,15.99833 h 40.589524 a 95.990005,95.990005 0 0 0 71.336327,31.99667 c -8.83345,0.0342 -15.93584,7.15657 -15.93584,15.99833 0,0.44796 0.20198,0.8332 0.24997,1.28115 -25.9493,3.69558 -48.307471,14.71719 -48.307471,14.71719 V 247.9875 H 191.93084 v -15.99833 c 0,0 -22.29418,-11.02161 -48.30747,-14.71722 0.032,-0.44795 0.24997,-0.83319 0.24997,-1.28115 0,-8.82044 -7.06953,-15.93016 -15.87334,-15.9983 a 95.990005,95.990005 0 0 0 71.24257,-31.99667 h 40.74576 c 8.86308,0 15.99834,-7.13526 15.99834,-15.99833 v -95.99 c 0,-8.86308 -7.13526,-15.99834 -15.99834,-15.99834 H 199.39882 A 95.990005,95.990005 0 0 0 128,8.0125 Z m 0,15.99833 a 79.991671,79.991671 0 0 1 49.46359,17.34194 79.991671,79.991671 0 0 1 3.18718,2.62473 79.991671,79.991671 0 0 1 2.93719,2.74971 79.991671,79.991671 0 0 1 2.93719,2.99969 79.991671,79.991671 0 0 1 2.84346,3.21842 79.991671,79.991671 0 0 1 2.49974,3.06218 h 48.11998 V 72.00583 H 223.99 v 63.99333 h 15.99833 v 15.99835 H 191.86835 A 79.991671,79.991671 0 0 1 175.83877,167.99583 79.991671,79.991671 0 0 1 128,183.99418 79.991671,79.991671 0 0 1 78.536398,166.65223 a 79.991671,79.991671 0 0 1 -3.187167,-2.62474 79.991671,79.991671 0 0 1 -2.937195,-2.74971 79.991671,79.991671 0 0 1 -2.937193,-2.99969 79.991671,79.991671 0 0 1 -2.843455,-3.21842 79.991671,79.991671 0 0 1 -2.499739,-3.06217 H 16.011659 V 135.99916 H 32.009993 V 72.00583 H 16.011659 V 56.0075 H 64.162895 A 79.991671,79.991671 0 0 1 69.256115,49.85189 79.991671,79.991671 0 0 1 80.161229,40.00916 79.991671,79.991671 0 0 1 128,24.01083 Z"
+     class="ColorScheme-Text"
+     id="path4" />
+</svg>
diff --git a/src/icons/cookies-on.svg b/src/icons/cookies-on.svg
new file mode 100644 (file)
index 0000000..191f07a
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   viewBox="0 0 256 256"
+   version="1.1"
+   id="svg8"
+   sodipodi:docname="cookies-on.svg"
+   inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
+   width="256"
+   height="256"
+   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">
+  <sodipodi:namedview
+     id="namedview10"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     inkscape:pagecheckerboard="0"
+     showgrid="false"
+     inkscape:zoom="3.1601563"
+     inkscape:cx="-133.37948"
+     inkscape:cy="4.9048207"
+     inkscape:window-width="3644"
+     inkscape:window-height="2015"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg8" />
+  <defs
+     id="defs3051">
+    <style
+       type="text/css"
+       id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#232629;
+      }
+      .ColorScheme-PositiveText {
+        color:#27ae60;
+      }
+      </style>
+  </defs>
+  <g
+     id="g825"
+     transform="translate(0,7.036695)">
+    <path
+       style="fill:currentColor;fill-opacity:1;stroke:none;stroke-width:15.9951"
+       d="M 127.96086,1 A 95.970643,95.970643 0 0 0 56.732645,32.990214 H 15.995107 C 7.1338178,32.990214 0,40.124032 0,48.985321 v 95.970639 c 0,8.86129 7.1338178,15.99511 15.995107,15.99511 h 40.581337 a 95.970643,95.970643 0 0 0 71.321936,31.99022 c -8.83168,0.0342 -15.93263,7.15512 -15.93263,15.9951 0,0.44787 0.20194,0.83303 0.24992,1.28089 -25.94406,3.69484 -48.297722,14.71422 -48.297722,14.71422 v 15.99511 H 191.87881 V 224.9315 c 0,0 -22.2897,-11.01938 -48.29773,-14.71425 0.032,-0.44786 0.24992,-0.83303 0.24992,-1.28089 0,-8.81866 -7.0681,-15.92695 -15.87014,-15.99507 a 95.970643,95.970643 0 0 0 71.22821,-31.99022 h 40.73754 c 8.86129,0 15.9951,-7.13382 15.9951,-15.99511 V 48.985321 c 0,-8.861289 -7.13381,-15.995107 -15.9951,-15.995107 H 199.34528 A 95.970643,95.970643 0 0 0 127.96086,1 Z m 0,15.995107 a 79.975535,79.975535 0 0 1 49.45362,17.338447 79.975535,79.975535 0 0 1 3.18653,2.624197 79.975535,79.975535 0 0 1 2.93659,2.749159 79.975535,79.975535 0 0 1 2.93661,2.999083 79.975535,79.975535 0 0 1 2.84289,3.217766 79.975535,79.975535 0 0 1 2.49923,3.061562 h 48.11028 V 64.980428 H 223.9315 v 63.980432 h 15.99511 v 15.9951 h -48.11028 a 79.975535,79.975535 0 0 1 -16.02636,15.99511 79.975535,79.975535 0 0 1 -47.82911,15.99511 79.975535,79.975535 0 0 1 -49.453626,-17.33844 79.975535,79.975535 0 0 1 -3.186524,-2.62421 79.975535,79.975535 0 0 1 -2.936603,-2.74916 79.975535,79.975535 0 0 1 -2.936601,-2.99908 79.975535,79.975535 0 0 1 -2.84288,-3.21777 79.975535,79.975535 0 0 1 -2.499236,-3.06156 H 15.995107 v -15.9951 H 31.990214 V 64.980428 H 15.995107 V 48.985321 H 64.13663 a 79.975535,79.975535 0 0 1 5.092193,-6.154367 79.975535,79.975535 0 0 1 10.902914,-9.84074 79.975535,79.975535 0 0 1 47.829123,-15.995107 z"
+       class="ColorScheme-Text"
+       id="path4" />
+    <path
+       style="fill:#f67400;fill-opacity:1;stroke:none;stroke-width:15.9951"
+       class="ColorScheme-PositiveText"
+       d="M 175.94618,96.970406 A 47.985321,47.985321 0 0 1 127.96086,144.95573 47.985321,47.985321 0 0 1 79.975535,96.970406 47.985321,47.985321 0 0 1 127.96086,48.985085 47.985321,47.985321 0 0 1 175.94618,96.970406 Z"
+       id="path6" />
+  </g>
+</svg>
index 2b9bd053e8c0da3c31b7a3c2bb7f5d59a93cd286..d4059285576e1c469ac76178fb50fcb912073e4a 100644 (file)
@@ -20,7 +20,7 @@
 // Application headers.
 #include "UrlRequestInterceptor.h"
 
-// The default constructor.
+// Construct the class.
 UrlRequestInterceptor::UrlRequestInterceptor(QObject *parentObjectPointer) : QWebEngineUrlRequestInterceptor(parentObjectPointer) {}
 
 void UrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &urlRequestInfo)
index cfa6f792ba5ffb28989605ecb2ed2f8579d989f4..a311b848c6feea8aa3fda1ca94ed00be1e35e231 100644 (file)
@@ -19,6 +19,8 @@
 <!DOCTYPE RCC>
 <RCC version="1.0">
     <qresource>
+        <file>icons/cookies-off.svg</file>
+        <file>icons/cookies-on.svg</file>
         <file>icons/javascript-warning.svg</file>
         <file>icons/privacy-mode.svg</file>
         <file>icons/sc-apps-privacy-browser.svg</file>
index c5435fa77fda6a5b3c1a6535cf6fc74720dedeae..10d08f3c972494a22747d575e098805354f186fa 100644 (file)
     <kcfgfile name="privacybrowser"/>
 
     <group name="Privacy">
-        <entry name="javaScript" type="Bool">
+        <entry name="javaScriptEnabled" type="Bool">
             <default>false</default>
         </entry>
 
-        <entry name="localStorage" type="Bool">
+        <entry name="cookiesEnabled" type="Bool">
+            <default>false</default>
+        </entry>
+
+        <entry name="domStorageEnabled" type="Bool">
             <default>false</default>
         </entry>
 
index 3129834a05320720fa595daee2969e32418f37be..42940f7c9921c8cb1c0710c024cce03207757657 100644 (file)
@@ -22,5 +22,5 @@ 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.
+# Make the generated class a singleton.
 Singleton=true
diff --git a/src/structs/CMakeLists.txt b/src/structs/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9e6e2cb
--- /dev/null
@@ -0,0 +1,22 @@
+# 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/>.
+
+
+# List the sources to include in the executable.
+target_sources(privacy-browser PRIVATE
+    PrivacyWebEngine.cpp
+)
diff --git a/src/structs/PrivacyWebEngine.cpp b/src/structs/PrivacyWebEngine.cpp
new file mode 100644 (file)
index 0000000..14ccad7
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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 "PrivacyWebEngine.h"
+
+// Construct the struct.
+PrivacyWebEngine::PrivacyWebEngine(QWebEngineView *inputWebEngineViewPointer) : webEngineViewPointer(inputWebEngineViewPointer)
+{
+    // Initialize the cookie status.
+    cookiesEnabled = false;
+}
diff --git a/src/structs/PrivacyWebEngine.h b/src/structs/PrivacyWebEngine.h
new file mode 100644 (file)
index 0000000..b536c4f
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * 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 PRIVACYWEBENGINE_H
+#define PRIVACYWEBENGINE_H
+
+// Qt toolkit headers.
+#include <QWebEngineView>
+
+struct PrivacyWebEngine
+{
+public:
+    // The primary constructor.
+    PrivacyWebEngine(QWebEngineView *inputWebEngineViewPointer);
+
+    // The public variables.
+    bool cookiesEnabled;
+    QWebEngineView *webEngineViewPointer;
+};
+#endif
diff --git a/src/ui.rc/CMakeLists.txt b/src/ui.rc/CMakeLists.txt
deleted file mode 100644 (file)
index 2c8c30e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# 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/>.
-
-
-# Install Privacy Browser's RC (Runtime Configuration) files.
-install(FILES
-    browser_ui.rc
-    DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/privacybrowser)
diff --git a/src/ui.rc/browser_ui.rc b/src/ui.rc/browser_ui.rc
deleted file mode 100644 (file)
index e75b573..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?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/>. -->
-
-<!-- Documentation at <https://techbase.kde.org/Development/Architecture/KDE4/XMLGUI_Technology>. -->
-<!-- Better documentation at <https://invent.kde.org/frameworks/kxmlgui/-/blob/master/src/kxmlgui.xsd>. -->
-<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" >
-
-    <!-- The menu bar. -->
-    <MenuBar>
-        <!-- On-the-fly Settings. -->
-        <Menu name="on_the_fly_settings"> <text>On-The-Fly Settings</text>
-            <Menu name="user_agent" icon="user-group-properties"> <text>User Agent</text>
-                <Action name="user_agent_privacy_browser" />
-                <Action name="user_agent_webengine_default" />
-                <Action name="user_agent_firefox_linux" />
-                <Action name="user_agent_chromium_linux" />
-                <Action name="user_agent_firefox_windows" />
-                <Action name="user_agent_chrome_windows" />
-                <Action name="user_agent_edge_windows" />
-                <Action name="user_agent_safari_macos" />
-                <Action name="user_agent_custom" />
-            </Menu>
-
-            <Action name="zoom_factor" />
-
-            <Separator />
-
-            <Menu name="search_engine" icon="search"> <text>Search Engine</text>
-                <Action name="search_engine_mojeek" />
-                <Action name="search_engine_monocles" />
-                <Action name="search_engine_metager" />
-                <Action name="search_engine_google" />
-                <Action name="search_engine_bing" />
-                <Action name="search_engine_yahoo" />
-                <Action name="search_engine_custom" />
-            </Menu>
-        </Menu>
-
-        <!-- Settings. -->
-        <Menu name="settings">
-            <Action name="domain_settings" />
-            <Action name="cookies" />
-        </Menu>
-    </MenuBar>
-
-    <!-- The main toolbar is removed. -->
-    <ToolBar name="mainToolBar" deleted="true" />
-
-    <!-- The navigation toolbar. -->
-    <ToolBar name="navigation_toolbar" iconText="icononly"> <text>Navigation Toolbar</text>
-        <Action name="go_back" />
-        <Action name="go_forward" />
-        <Action name="view_redisplay" />
-        <Action name="go_home" />
-    </ToolBar>
-
-    <!-- The URL toolbar. -->
-    <ToolBar name="url_toolbar" iconText="icononly"> <text>URL Toolbar</text>
-        <Action name="javascript" />
-        <Action name="local_storage" />
-    </ToolBar>
-</gui>
diff --git a/src/ui.rcs/CMakeLists.txt b/src/ui.rcs/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2c8c30e
--- /dev/null
@@ -0,0 +1,22 @@
+# 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/>.
+
+
+# Install Privacy Browser's RC (Runtime Configuration) files.
+install(FILES
+    browser_ui.rc
+    DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/privacybrowser)
diff --git a/src/ui.rcs/browser_ui.rc b/src/ui.rcs/browser_ui.rc
new file mode 100644 (file)
index 0000000..fd80ccb
--- /dev/null
@@ -0,0 +1,85 @@
+<?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/>. -->
+
+<!-- Documentation at <https://techbase.kde.org/Development/Architecture/KDE4/XMLGUI_Technology>. -->
+<!-- Better documentation at <https://invent.kde.org/frameworks/kxmlgui/-/blob/master/src/kxmlgui.xsd>. -->
+<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" >
+
+    <!-- The menu bar. -->
+    <MenuBar>
+        <!-- On-the-fly Settings. -->
+        <Menu name="on_the_fly_settings"> <text>On-The-Fly Settings</text>
+            <Menu name="user_agent" icon="user-group-properties"> <text>User Agent</text>
+                <Action name="user_agent_privacy_browser" />
+                <Action name="user_agent_webengine_default" />
+                <Action name="user_agent_firefox_linux" />
+                <Action name="user_agent_chromium_linux" />
+                <Action name="user_agent_firefox_windows" />
+                <Action name="user_agent_chrome_windows" />
+                <Action name="user_agent_edge_windows" />
+                <Action name="user_agent_safari_macos" />
+                <Action name="user_agent_custom" />
+            </Menu>
+
+            <Action name="zoom_factor" />
+
+            <Separator />
+
+            <Menu name="search_engine" icon="search"> <text>Search Engine</text>
+                <Action name="search_engine_mojeek" />
+                <Action name="search_engine_monocles" />
+                <Action name="search_engine_metager" />
+                <Action name="search_engine_google" />
+                <Action name="search_engine_bing" />
+                <Action name="search_engine_yahoo" />
+                <Action name="search_engine_custom" />
+            </Menu>
+        </Menu>
+
+        <!-- Settings. -->
+        <Menu name="settings">
+            <Action name="domain_settings" />
+            <Action name="cookies" />
+        </Menu>
+    </MenuBar>
+
+    <!-- The main toolbar is removed. -->
+    <ToolBar name="mainToolBar" deleted="true" />
+
+    <!-- The navigation toolbar. -->
+    <ToolBar name="navigation_toolbar" iconText="icononly"> <text>Navigation Toolbar</text>
+        <Action name="go_back" />
+        <Action name="go_forward" />
+        <Action name="view_redisplay" />
+        <Action name="go_home" />
+    </ToolBar>
+
+    <!-- The URL toolbar. -->
+    <ToolBar name="url_toolbar" iconText="icononly"> <text>URL Toolbar</text>
+        <Action name="javascript" />
+        <Action name="on-the-fly_cookies" />
+        <Action name="dom_storage" />
+    </ToolBar>
+</gui>
diff --git a/src/ui/AddOrEditCookieDialog.ui b/src/ui/AddOrEditCookieDialog.ui
deleted file mode 100644 (file)
index adeaa4e..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-<?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>AddOrEditCookieDialog</class>
-
-    <widget class="QWidget">
-        <layout class="QVBoxLayout">
-            <item>
-                <!-- First row. -->
-                <layout class="QHBoxLayout">
-                    <property name="alignment">
-                        <enum>Qt::AlignLeft</enum>
-                    </property>
-
-                    <!-- Domain. -->
-                    <item>
-                        <widget class="QLabel">
-                            <property name="toolTip">
-                                <string>Cookies prepended by a period are accessible to all subdomains.</string>
-                            </property>
-
-                            <property name="text">
-                                <string>Domain</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QLineEdit" name="domainLineEdit" />
-                    </item>
-
-                    <item>
-                        <widget class="QLabel">
-                            <property name="textFormat">
-                                <enum>Qt::RichText</enum>
-                            </property>
-
-                            <!-- Spacer label. -->
-                            <property name="text">
-                                <string>&amp;nbsp;&amp;nbsp;&amp;nbsp;</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <!-- Name. -->
-                    <item>
-                        <widget class="QLabel">
-                            <property name="toolTip">
-                                <string>The name identifies the cookie.  Each cookie has a unique combination of domain, name, and path.</string>
-                            </property>
-
-                            <property name="text">
-                                <string>Name</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QLineEdit" name="nameLineEdit" />
-                    </item>
-                </layout>
-            </item>
-
-            <!-- Second row. -->
-            <item>
-                <layout class="QHBoxLayout">
-                    <property name="alignment">
-                        <enum>Qt::AlignLeft</enum>
-                    </property>
-
-                    <!-- Path. -->
-                    <item>
-                        <widget class="QLabel">
-                            <property name="toolTip">
-                                <string>Websites can restrict cookie access to subpath of their URL.</string>
-                            </property>
-
-                            <property name="text">
-                                <string>Path</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QLineEdit" name="pathLineEdit">
-                            <property name="text">
-                                <string>/</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QLabel">
-                            <property name="textFormat">
-                                <enum>Qt::RichText</enum>
-                            </property>
-
-                            <!-- Spacer label. -->
-                            <property name="text">
-                                <string>&amp;nbsp;&amp;nbsp;&amp;nbsp;</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <!-- Expiration date. -->
-                    <item>
-                        <widget class="QCheckBox" name="expirationCheckBox">
-                            <property name="toolTip">
-                                <string>Cookies without an expiration date are known as session cookies and are expected to be deleted every time the browser closes.</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QLabel">
-                            <property name="toolTip">
-                                <string>Cookies without an expiration date are known as session cookies and are expected to be deleted every time the browser closes.</string>
-                            </property>
-
-                            <property name="text">
-                                <string>Expiration date</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QLabel">
-                            <property name="textFormat">
-                                <enum>Qt::RichText</enum>
-                            </property>
-
-                            <!-- Spacer label. -->
-                            <property name="text">
-                                <string>&amp;nbsp;</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QDateTimeEdit" name="expirationDateTimeEdit">
-                            <property name="dateTime">
-                                <datetime>
-                                    <year>2030</year>
-                                    <month>1</month>
-                                    <day>1</day>
-                                    <hour>0</hour>
-                                    <minute>0</minute>
-                                    <second>0</second>
-                                </datetime>
-                            </property>
-
-                            <property name="calendarPopup">
-                                <bool>true</bool>
-                            </property>
-
-                            <property name="enabled">
-                                <bool>false</bool>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QLabel">
-                            <property name="textFormat">
-                                <enum>Qt::RichText</enum>
-                            </property>
-
-                            <!-- Spacer label. -->
-                            <property name="text">
-                                <string>&amp;nbsp;&amp;nbsp;&amp;nbsp;</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <!-- HTTP only. -->
-                    <item>
-                        <widget class="QCheckBox" name="httpOnlyCheckBox">
-                            <property name="toolTip">
-                                <string>Restrict cookie access to HTTP (and HTTPS). This prevents JavaScript from accessing the cookie, which hardens it against cross-site scripting attacks.</string>
-                            </property>
-
-                            <property name="checked">
-                                <bool>true</bool>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QLabel">
-                            <property name="toolTip">
-                                <string>Restrict cookie access to HTTP (and HTTPS). This prevents JavaScript from accessing the cookie, which hardens it against cross-site scripting attacks.</string>
-                            </property>
-
-                            <property name="text">
-                                <string>HTTP only</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QLabel">
-                            <property name="textFormat">
-                                <enum>Qt::RichText</enum>
-                            </property>
-
-                            <!-- Spacer label. -->
-                            <property name="text">
-                                <string>&amp;nbsp;&amp;nbsp;&amp;nbsp;</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <!-- Secure. -->
-                    <item>
-                        <widget class="QCheckBox" name="secureCheckBox">
-                            <property name="toolTip">
-                                <string>Only allow the cookie to be transferred across HTTPS (as opposed to HTTP).</string>
-                            </property>
-
-                            <property name="checked">
-                                <bool>true</bool>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QLabel">
-                            <property name="toolTip">
-                                <string>Only allow the cookie to be transferred across HTTPS (as opposed to HTTP).</string>
-                            </property>
-
-                            <property name="text">
-                                <string>Secure</string>
-                            </property>
-                        </widget>
-                    </item>
-                </layout>
-            </item>
-
-            <!-- Third row. -->
-            <item>
-                <layout class="QHBoxLayout">
-                    <property name="alignment">
-                        <enum>Qt::AlignLeft</enum>
-                    </property>
-
-                    <!-- Value. -->
-                    <item>
-                        <widget class="QLabel">
-                            <property name="toolTip">
-                                <string>The value contains the cookie data.</string>
-                            </property>
-
-                            <property name="text">
-                                <string>Value</string>
-                            </property>
-                        </widget>
-                    </item>
-
-                    <item>
-                        <widget class="QLineEdit" name="valueLineEdit" />
-                    </item>
-                </layout>
-            </item>
-
-            <!-- Spacer. -->
-            <item>
-                <spacer>
-                    <property name="orientation">
-                        <enum>Qt::Vertical</enum>
-                    </property>
-                </spacer>
-            </item>
-
-            <!-- Dialog buttons. -->
-            <item>
-                <widget class="QDialogButtonBox" name="dialogButtonBox">
-                    <property name="standardButtons">
-                        <set>QDialogButtonBox::Save | QDialogButtonBox::Cancel</set>
-                    </property>
-                </widget>
-            </item>
-        </layout>
-    </widget>
-</ui>
diff --git a/src/ui/BrowserView.ui b/src/ui/BrowserView.ui
deleted file mode 100644 (file)
index 26ba072..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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>BrowserView</class>
-    <!-- Main widget. -->
-    <widget class="QWidget">
-        <!-- Main layout. -->
-        <layout class="QVBoxLayout">
-            <!-- Set the spacing between items to 0. -->
-            <property name="spacing">
-                <number>0</number>
-            </property>
-
-            <!-- Set the margins to 0. -->
-            <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>
-
-            <!-- WebEngine view. -->
-            <item>
-                <widget class="QWebEngineView" name="webEngineView" />
-            </item>
-        </layout>
-    </widget>
-</ui>
diff --git a/src/ui/CookiesDialog.ui b/src/ui/CookiesDialog.ui
deleted file mode 100644 (file)
index 9c3c2dc..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<?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>CookiesDialog</class>
-
-
-    <widget class="QWidget">
-        <property name="geometry">
-            <rect>
-                <x>0</x>
-                <y>0</y>
-                <height>1000</height>
-                <width>1500</width>
-            </rect>
-        </property>
-
-        <layout class="QVBoxLayout">
-            <item>
-                <!-- Scroll area. -->
-                <widget class="QTreeView" name="treeView" />
-            </item>
-
-            <item>
-                <layout class="QHBoxLayout">
-                    <!-- Add cookie button. -->
-                    <item>
-                        <widget class="QPushButton" name="addCookieButton">
-                            <property name="text">
-                                <string>&amp;Add cookie</string>
-                            </property>
-
-                            <property name="icon">
-                                <iconset theme="list-add" />
-                            </property>
-                        </widget>
-                    </item>
-
-                    <!-- Edit cookie button. -->
-                    <item>
-                        <widget class="QPushButton" name="editCookieButton">
-                            <property name="text">
-                                <string>&amp;Edit cookie</string>
-                            </property>
-
-                            <property name="icon">
-                                <iconset theme="edit-entry" />
-                            </property>
-                        </widget>
-                    </item>
-
-                    <!-- Delete domain button. -->
-                    <item>
-                        <widget class="QPushButton" name="deleteCookieButton">
-                            <property name="text">
-                                <string>De&amp;lete cookie</string>
-                            </property>
-
-                            <property name="icon">
-                                <iconset theme="list-remove" />
-                            </property>
-                        </widget>
-                    </item>
-
-                    <!-- Close button. -->
-                    <item>
-                        <widget class="QDialogButtonBox" name="dialogButtonBox">
-                            <property name="standardButtons">
-                                <set>QDialogButtonBox::Close</set>
-                            </property>
-                        </widget>
-                    </item>
-                </layout>
-            </item>
-        </layout>
-    </widget>
-</ui>
diff --git a/src/ui/DomainSettingsDialog.ui b/src/ui/DomainSettingsDialog.ui
deleted file mode 100644 (file)
index ae9322d..0000000
+++ /dev/null
@@ -1,349 +0,0 @@
-<?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>DomainSettingsDialog</class>
-
-    <widget class="QWidget">
-        <property name="geometry">
-            <rect>
-                <x>0</x>
-                <y>0</y>
-                <height>1000</height>
-                <width>1500</width>
-            </rect>
-        </property>
-
-        <!-- Main layout. -->
-        <layout class="QHBoxLayout">
-            <item>
-                <layout class="QVBoxLayout">
-                    <!-- Domains list view. -->
-                    <item>
-                        <widget class="QListView" name="domainsListView"/>
-                    </item>
-
-                    <!-- Domain buttons. -->
-                    <item>
-                        <layout class="QHBoxLayout">
-                            <!-- Add domain button. -->
-                            <item>
-                                <widget class="QPushButton" name="addDomainButton">
-                                    <property name="text">
-                                        <string>Add domain</string>
-                                    </property>
-
-                                    <property name="icon">
-                                        <iconset theme="list-add" />
-                                    </property>
-                                </widget>
-                            </item>
-
-                            <!-- Delete domain button. -->
-                            <item>
-                                <widget class="QPushButton" name="deleteDomainButton">
-                                    <property name="text">
-                                        <string>Delete domain</string>
-                                    </property>
-
-                                    <property name="icon">
-                                        <iconset theme="list-remove" />
-                                    </property>
-                                </widget>
-                            </item>
-
-                            <!-- Spacer. -->
-                            <item>
-                                <spacer>
-                                    <property name="orientation">
-                                        <enum>Qt::Horizontal</enum>
-                                    </property>
-                                </spacer>
-                            </item>
-                        </layout>
-                    </item>
-                </layout>
-            </item>
-
-            <item>
-                <layout class="QVBoxLayout">
-                    <item>
-                        <widget class="QWidget" name="domainSettingsWidget">
-                            <!-- Domain settings form layout. -->
-                            <layout class="QFormLayout">
-                                <!-- Domain name. -->
-                                <item row="0" column="0">
-                                    <widget class="QLabel" name="domainNameLabel">
-                                        <property name="text">
-                                            <string>Domain name</string>
-                                        </property>
-                                    </widget>
-                                </item>
-
-                                <item row="0" column="1">
-                                    <widget class="KLineEdit" name="domainNameLineEdit">
-                                        <property name="toolTip">
-                                            <string>*. may be prepended to a domain to include all subdomains (eg. *.stoutner.com).</string>
-                                        </property>
-                                    </widget>
-                                </item>
-
-                                <!-- JavaScript. -->
-                                <item row="1" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>JavaScript</string>
-                                        </property>
-                                    </widget>
-                                </item>
-
-                                <item row="1" column="1">
-                                    <widget class="QComboBox" name="javaScriptComboBox">
-                                        <property name="toolTip">
-                                            <string>JavaScript allows websites to run programs (scripts) on the device.</string>
-                                        </property>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>JavaScript disabled</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>JavaScript enabled</string>
-                                            </property>
-                                        </item>
-                                    </widget>
-                                </item>
-
-                                <item row="2" column="1">
-                                    <widget class="QLabel" name="javaScriptLabel">
-                                        <property name="textFormat">
-                                            <enum>Qt::RichText</enum>
-                                        </property>
-                                    </widget>
-                                </item>
-
-                                <!-- Local storage. -->
-                                <item row="3" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>Local storage</string>
-                                        </property>
-                                    </widget>
-                                </item>
-
-                                <item row="3" column="1">
-                                    <widget class="QComboBox" name="localStorageComboBox">
-                                        <property name="toolTip">
-                                            <string>Local storage, sometimes also called DOM storage, is like cookies on steroids.</string>
-                                        </property>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Local storage disabled</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Local storage enabled</string>
-                                            </property>
-                                        </item>
-                                    </widget>
-                                </item>
-
-                                <item row="4" column="1">
-                                    <widget class="QLabel" name="localStorageLabel">
-                                        <property name="textFormat">
-                                            <enum>Qt::RichText</enum>
-                                        </property>
-                                    </widget>
-                                </item>
-
-                                <!-- User agent. -->
-                                <item row="5" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>User agent</string>
-                                        </property>
-                                    </widget>
-                                </item>
-
-                                <item row="5" column="1">
-                                    <widget class="QComboBox" name="userAgentComboBox">
-                                        <property name="sizePolicy">
-                                            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                                                <horstretch>0</horstretch>
-                                                <verstretch>0</verstretch>
-                                            </sizepolicy>
-                                        </property>
-
-                                        <property name="editable">
-                                            <bool>true</bool>
-                                        </property>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Privacy Browser</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>WebEngine default</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Firefox on Linux</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Chromium on Linux</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Firefox on Windows</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Chrome on Windows</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Edge on Windows</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Safari on macOS</string>
-                                            </property>
-                                        </item>
-                                    </widget>
-                                </item>
-
-                                <item row="6" column="1">
-                                    <widget class="QLabel" name="userAgentLabel">
-                                        <property name="textFormat">
-                                            <enum>Qt::RichText</enum>
-                                        </property>
-                                    </widget>
-                                </item>
-
-                                <!-- Zoom factor. -->
-                                <item row="7" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>Zoom factor</string>
-                                        </property>
-                                    </widget>
-                                </item>
-
-                                <item row="7" column="1">
-                                    <widget class="QComboBox" name="zoomFactorComboBox">
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Custom</string>
-                                            </property>
-                                        </item>
-                                    </widget>
-                                </item>
-
-                                <item row="8" column="1">
-                                    <widget class="QDoubleSpinBox" name="customZoomFactorSpinBox">
-                                        <property name="toolTip">
-                                            <string>Set the zoom factor between 0.25 and 5.00.  The default is 1.00.</string>
-                                        </property>
-
-                                        <property name="minimum">
-                                            <double>0.250000000000000</double>
-                                        </property>
-
-                                        <property name="maximum">
-                                            <double>5.000000000000000</double>
-                                        </property>
-
-                                        <property name="singleStep">
-                                            <double>0.250000000000000</double>
-                                        </property>
-                                    </widget>
-                                </item>
-                            </layout>
-                        </widget>
-                    </item>
-
-                    <!-- Spacer. -->
-                    <item>
-                        <spacer>
-                            <property name="orientation">
-                                <enum>Qt::Vertical</enum>
-                            </property>
-                        </spacer>
-                    </item>
-
-                    <!-- Dialog buttons. -->
-                    <item>
-                        <widget class="QDialogButtonBox" name="dialogButtonBox">
-                            <property name="standardButtons">
-                                <set>QDialogButtonBox::Reset | QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel</set>
-                            </property>
-                        </widget>
-                    </item>
-                </layout>
-            </item>
-        </layout>
-    </widget>
-</ui>
diff --git a/src/ui/SettingsGeneral.ui b/src/ui/SettingsGeneral.ui
deleted file mode 100644 (file)
index 65b693e..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-<?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">
-    <!-- The name of the generated class. -->
-    <class>GeneralSettings</class>
-
-    <widget class="QWidget">
-        <layout class="QFormLayout">
-            <!-- Homepage. -->
-            <item row="0" column="0">
-                <widget class="QLabel" name="homepageLabel">
-                    <property name="text">
-                        <string>Homepage</string>
-                    </property>
-                </widget>
-            </item>
-
-            <item row="0" column="1">
-                <widget class="KLineEdit" name="kcfg_homepage">
-                    <property name="toolTip">
-                        <string>The default is https://www.mojeek.com/.</string>
-                    </property>
-                </widget>
-            </item>
-
-            <!-- Search engine. -->
-            <item row="1" column="0">
-                <widget class="QLabel">
-                    <property name="text">
-                        <string>Search engine</string>
-                    </property>
-                </widget>
-            </item>
-
-            <item row="1" column="1">
-                <widget class="QComboBox" name="kcfg_searchEngine">
-                    <property name="sizePolicy">
-                        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                            <horstretch>0</horstretch>
-                            <verstretch>0</verstretch>
-                        </sizepolicy>
-                    </property>
-
-                    <property name="toolTip">
-                        <string>The default is Mojeek.</string>
-                    </property>
-
-                    <property name="editable">
-                        <bool>true</bool>
-                    </property>
-
-                    <item>
-                        <property name="text">
-                            <string>Mojeek</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>Monocles</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>MetaGer</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>Google</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>Bing</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>Yahoo</string>
-                        </property>
-                    </item>
-                </widget>
-            </item>
-
-            <item row="2" column="1">
-                <widget class="QLabel" name="searchEngineLabel">
-                    <property name="textInteractionFlags">
-                        <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
-                    </property>
-                </widget>
-            </item>
-
-            <!-- Zoom factor. -->
-            <item row="3" column="0">
-                <widget class="QLabel" name="zoomFactorLabel">
-                    <property name="text">
-                        <string>Zoom factor</string>
-                    </property>
-                </widget>
-            </item>
-
-            <item row="3" column="1">
-                <widget class="QDoubleSpinBox" name="kcfg_zoomFactor">
-                    <property name="toolTip">
-                        <string>Set the zoom factor between 0.25 and 5.00.  The default is 1.00.</string>
-                    </property>
-
-                    <property name="minimum">
-                        <double>0.250000000000000</double>
-                    </property>
-
-                    <property name="maximum">
-                        <double>5.000000000000000</double>
-                    </property>
-
-                    <property name="singleStep">
-                        <double>0.250000000000000</double>
-                    </property>
-                </widget>
-            </item>
-        </layout>
-    </widget>
-</ui>
diff --git a/src/ui/SettingsPrivacy.ui b/src/ui/SettingsPrivacy.ui
deleted file mode 100644 (file)
index 6fa7c5b..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-<?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">
-    <!-- The name of the generated class. -->
-    <class>PrivacySettings</class>
-
-    <widget class="QWidget">
-        <layout class="QFormLayout">
-            <!-- JavaScript. -->
-            <item row="0" column="1">
-                <widget class="QCheckBox" name="kcfg_javaScript">
-                    <property name="text">
-                        <string>JavaScript</string>
-                    </property>
-
-                    <property name="toolTip">
-                        <string>JavaScript allows websites to run programs (scripts) on the device.  The default is disabled.</string>
-                    </property>
-                </widget>
-            </item>
-
-            <!-- Local storage. -->
-            <item row="1" column="1">
-                <widget class="QCheckBox" name="kcfg_localStorage">
-                    <property name="text">
-                        <string>Local storage</string>
-                    </property>
-
-                    <property name="toolTip">
-                        <string>Local storage, sometimes also called DOM storage, is like cookies on steroids.</string>
-                    </property>
-                </widget>
-            </item>
-
-            <!-- User agent. -->
-            <item row="2" column="0">
-                <widget class="QLabel">
-                    <property name="text">
-                        <string>User agent</string>
-                    </property>
-                </widget>
-            </item>
-
-            <item row="2" column="1">
-                <widget class="QComboBox" name="kcfg_userAgent">
-                    <property name="sizePolicy">
-                        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                            <horstretch>0</horstretch>
-                            <verstretch>0</verstretch>
-                        </sizepolicy>
-                    </property>
-
-                    <property name="toolTip">
-                        <string>The default is Privacy Browser.</string>
-                    </property>
-
-                    <property name="editable">
-                        <bool>true</bool>
-                    </property>
-
-                    <item>
-                        <property name="text">
-                            <string>Privacy Browser</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>WebEngine Default</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>Firefox Linux</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>Chromium Linux</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>Firefox Windows</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>Chrome Windows</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>Edge Windows</string>
-                        </property>
-                    </item>
-
-                    <item>
-                        <property name="text">
-                            <string>Safari macOS</string>
-                        </property>
-                    </item>
-                </widget>
-            </item>
-
-            <item row="3" column="1">
-                <widget class="QLabel" name="userAgentLabel">
-                    <property name="textInteractionFlags">
-                        <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
-                    </property>
-                </widget>
-            </item>
-        </layout>
-    </widget>
-</ui>
diff --git a/src/uis/AddOrEditCookieDialog.ui b/src/uis/AddOrEditCookieDialog.ui
new file mode 100644 (file)
index 0000000..adeaa4e
--- /dev/null
@@ -0,0 +1,303 @@
+<?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>AddOrEditCookieDialog</class>
+
+    <widget class="QWidget">
+        <layout class="QVBoxLayout">
+            <item>
+                <!-- First row. -->
+                <layout class="QHBoxLayout">
+                    <property name="alignment">
+                        <enum>Qt::AlignLeft</enum>
+                    </property>
+
+                    <!-- Domain. -->
+                    <item>
+                        <widget class="QLabel">
+                            <property name="toolTip">
+                                <string>Cookies prepended by a period are accessible to all subdomains.</string>
+                            </property>
+
+                            <property name="text">
+                                <string>Domain</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QLineEdit" name="domainLineEdit" />
+                    </item>
+
+                    <item>
+                        <widget class="QLabel">
+                            <property name="textFormat">
+                                <enum>Qt::RichText</enum>
+                            </property>
+
+                            <!-- Spacer label. -->
+                            <property name="text">
+                                <string>&amp;nbsp;&amp;nbsp;&amp;nbsp;</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <!-- Name. -->
+                    <item>
+                        <widget class="QLabel">
+                            <property name="toolTip">
+                                <string>The name identifies the cookie.  Each cookie has a unique combination of domain, name, and path.</string>
+                            </property>
+
+                            <property name="text">
+                                <string>Name</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QLineEdit" name="nameLineEdit" />
+                    </item>
+                </layout>
+            </item>
+
+            <!-- Second row. -->
+            <item>
+                <layout class="QHBoxLayout">
+                    <property name="alignment">
+                        <enum>Qt::AlignLeft</enum>
+                    </property>
+
+                    <!-- Path. -->
+                    <item>
+                        <widget class="QLabel">
+                            <property name="toolTip">
+                                <string>Websites can restrict cookie access to subpath of their URL.</string>
+                            </property>
+
+                            <property name="text">
+                                <string>Path</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QLineEdit" name="pathLineEdit">
+                            <property name="text">
+                                <string>/</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QLabel">
+                            <property name="textFormat">
+                                <enum>Qt::RichText</enum>
+                            </property>
+
+                            <!-- Spacer label. -->
+                            <property name="text">
+                                <string>&amp;nbsp;&amp;nbsp;&amp;nbsp;</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <!-- Expiration date. -->
+                    <item>
+                        <widget class="QCheckBox" name="expirationCheckBox">
+                            <property name="toolTip">
+                                <string>Cookies without an expiration date are known as session cookies and are expected to be deleted every time the browser closes.</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QLabel">
+                            <property name="toolTip">
+                                <string>Cookies without an expiration date are known as session cookies and are expected to be deleted every time the browser closes.</string>
+                            </property>
+
+                            <property name="text">
+                                <string>Expiration date</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QLabel">
+                            <property name="textFormat">
+                                <enum>Qt::RichText</enum>
+                            </property>
+
+                            <!-- Spacer label. -->
+                            <property name="text">
+                                <string>&amp;nbsp;</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QDateTimeEdit" name="expirationDateTimeEdit">
+                            <property name="dateTime">
+                                <datetime>
+                                    <year>2030</year>
+                                    <month>1</month>
+                                    <day>1</day>
+                                    <hour>0</hour>
+                                    <minute>0</minute>
+                                    <second>0</second>
+                                </datetime>
+                            </property>
+
+                            <property name="calendarPopup">
+                                <bool>true</bool>
+                            </property>
+
+                            <property name="enabled">
+                                <bool>false</bool>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QLabel">
+                            <property name="textFormat">
+                                <enum>Qt::RichText</enum>
+                            </property>
+
+                            <!-- Spacer label. -->
+                            <property name="text">
+                                <string>&amp;nbsp;&amp;nbsp;&amp;nbsp;</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <!-- HTTP only. -->
+                    <item>
+                        <widget class="QCheckBox" name="httpOnlyCheckBox">
+                            <property name="toolTip">
+                                <string>Restrict cookie access to HTTP (and HTTPS). This prevents JavaScript from accessing the cookie, which hardens it against cross-site scripting attacks.</string>
+                            </property>
+
+                            <property name="checked">
+                                <bool>true</bool>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QLabel">
+                            <property name="toolTip">
+                                <string>Restrict cookie access to HTTP (and HTTPS). This prevents JavaScript from accessing the cookie, which hardens it against cross-site scripting attacks.</string>
+                            </property>
+
+                            <property name="text">
+                                <string>HTTP only</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QLabel">
+                            <property name="textFormat">
+                                <enum>Qt::RichText</enum>
+                            </property>
+
+                            <!-- Spacer label. -->
+                            <property name="text">
+                                <string>&amp;nbsp;&amp;nbsp;&amp;nbsp;</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <!-- Secure. -->
+                    <item>
+                        <widget class="QCheckBox" name="secureCheckBox">
+                            <property name="toolTip">
+                                <string>Only allow the cookie to be transferred across HTTPS (as opposed to HTTP).</string>
+                            </property>
+
+                            <property name="checked">
+                                <bool>true</bool>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QLabel">
+                            <property name="toolTip">
+                                <string>Only allow the cookie to be transferred across HTTPS (as opposed to HTTP).</string>
+                            </property>
+
+                            <property name="text">
+                                <string>Secure</string>
+                            </property>
+                        </widget>
+                    </item>
+                </layout>
+            </item>
+
+            <!-- Third row. -->
+            <item>
+                <layout class="QHBoxLayout">
+                    <property name="alignment">
+                        <enum>Qt::AlignLeft</enum>
+                    </property>
+
+                    <!-- Value. -->
+                    <item>
+                        <widget class="QLabel">
+                            <property name="toolTip">
+                                <string>The value contains the cookie data.</string>
+                            </property>
+
+                            <property name="text">
+                                <string>Value</string>
+                            </property>
+                        </widget>
+                    </item>
+
+                    <item>
+                        <widget class="QLineEdit" name="valueLineEdit" />
+                    </item>
+                </layout>
+            </item>
+
+            <!-- Spacer. -->
+            <item>
+                <spacer>
+                    <property name="orientation">
+                        <enum>Qt::Vertical</enum>
+                    </property>
+                </spacer>
+            </item>
+
+            <!-- Dialog buttons. -->
+            <item>
+                <widget class="QDialogButtonBox" name="dialogButtonBox">
+                    <property name="standardButtons">
+                        <set>QDialogButtonBox::Save | QDialogButtonBox::Cancel</set>
+                    </property>
+                </widget>
+            </item>
+        </layout>
+    </widget>
+</ui>
diff --git a/src/uis/BrowserView.ui b/src/uis/BrowserView.ui
new file mode 100644 (file)
index 0000000..26ba072
--- /dev/null
@@ -0,0 +1,55 @@
+<?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>BrowserView</class>
+    <!-- Main widget. -->
+    <widget class="QWidget">
+        <!-- Main layout. -->
+        <layout class="QVBoxLayout">
+            <!-- Set the spacing between items to 0. -->
+            <property name="spacing">
+                <number>0</number>
+            </property>
+
+            <!-- Set the margins to 0. -->
+            <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>
+
+            <!-- WebEngine view. -->
+            <item>
+                <widget class="QWebEngineView" name="webEngineView" />
+            </item>
+        </layout>
+    </widget>
+</ui>
diff --git a/src/uis/CookiesDialog.ui b/src/uis/CookiesDialog.ui
new file mode 100644 (file)
index 0000000..9c3c2dc
--- /dev/null
@@ -0,0 +1,94 @@
+<?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>CookiesDialog</class>
+
+
+    <widget class="QWidget">
+        <property name="geometry">
+            <rect>
+                <x>0</x>
+                <y>0</y>
+                <height>1000</height>
+                <width>1500</width>
+            </rect>
+        </property>
+
+        <layout class="QVBoxLayout">
+            <item>
+                <!-- Scroll area. -->
+                <widget class="QTreeView" name="treeView" />
+            </item>
+
+            <item>
+                <layout class="QHBoxLayout">
+                    <!-- Add cookie button. -->
+                    <item>
+                        <widget class="QPushButton" name="addCookieButton">
+                            <property name="text">
+                                <string>&amp;Add cookie</string>
+                            </property>
+
+                            <property name="icon">
+                                <iconset theme="list-add" />
+                            </property>
+                        </widget>
+                    </item>
+
+                    <!-- Edit cookie button. -->
+                    <item>
+                        <widget class="QPushButton" name="editCookieButton">
+                            <property name="text">
+                                <string>&amp;Edit cookie</string>
+                            </property>
+
+                            <property name="icon">
+                                <iconset theme="edit-entry" />
+                            </property>
+                        </widget>
+                    </item>
+
+                    <!-- Delete domain button. -->
+                    <item>
+                        <widget class="QPushButton" name="deleteCookieButton">
+                            <property name="text">
+                                <string>De&amp;lete cookie</string>
+                            </property>
+
+                            <property name="icon">
+                                <iconset theme="list-remove" />
+                            </property>
+                        </widget>
+                    </item>
+
+                    <!-- Close button. -->
+                    <item>
+                        <widget class="QDialogButtonBox" name="dialogButtonBox">
+                            <property name="standardButtons">
+                                <set>QDialogButtonBox::Close</set>
+                            </property>
+                        </widget>
+                    </item>
+                </layout>
+            </item>
+        </layout>
+    </widget>
+</ui>
diff --git a/src/uis/DomainSettingsDialog.ui b/src/uis/DomainSettingsDialog.ui
new file mode 100644 (file)
index 0000000..1972848
--- /dev/null
@@ -0,0 +1,396 @@
+<?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>DomainSettingsDialog</class>
+
+    <widget class="QWidget">
+        <property name="geometry">
+            <rect>
+                <x>0</x>
+                <y>0</y>
+                <height>1000</height>
+                <width>1500</width>
+            </rect>
+        </property>
+
+        <!-- Main layout. -->
+        <layout class="QHBoxLayout">
+            <item>
+                <layout class="QVBoxLayout">
+                    <!-- Domains list view. -->
+                    <item>
+                        <widget class="QListView" name="domainsListView"/>
+                    </item>
+
+                    <!-- Domain buttons. -->
+                    <item>
+                        <layout class="QHBoxLayout">
+                            <!-- Add domain button. -->
+                            <item>
+                                <widget class="QPushButton" name="addDomainButton">
+                                    <property name="text">
+                                        <string>Add domain</string>
+                                    </property>
+
+                                    <property name="icon">
+                                        <iconset theme="list-add" />
+                                    </property>
+                                </widget>
+                            </item>
+
+                            <!-- Delete domain button. -->
+                            <item>
+                                <widget class="QPushButton" name="deleteDomainButton">
+                                    <property name="text">
+                                        <string>Delete domain</string>
+                                    </property>
+
+                                    <property name="icon">
+                                        <iconset theme="list-remove" />
+                                    </property>
+                                </widget>
+                            </item>
+
+                            <!-- Spacer. -->
+                            <item>
+                                <spacer>
+                                    <property name="orientation">
+                                        <enum>Qt::Horizontal</enum>
+                                    </property>
+                                </spacer>
+                            </item>
+                        </layout>
+                    </item>
+                </layout>
+            </item>
+
+            <item>
+                <layout class="QVBoxLayout">
+                    <item>
+                        <widget class="QWidget" name="domainSettingsWidget">
+                            <!-- Domain settings form layout. -->
+                            <layout class="QFormLayout">
+                                <!-- Domain name. -->
+                                <item row="0" column="0">
+                                    <widget class="QLabel" name="domainNameLabel">
+                                        <property name="text">
+                                            <string>Domain name</string>
+                                        </property>
+
+                                        <property name="toolTip">
+                                            <string>*. may be prepended to a domain to include all subdomains (eg. *.stoutner.com).</string>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <item row="0" column="1">
+                                    <widget class="KLineEdit" name="domainNameLineEdit" />
+                                </item>
+
+                                <!-- JavaScript. -->
+                                <item row="1" column="0">
+                                    <widget class="QLabel">
+                                        <property name="text">
+                                            <string>JavaScript</string>
+                                        </property>
+
+                                        <property name="toolTip">
+                                            <string>JavaScript allows websites to run programs (scripts) on the device.</string>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <item row="1" column="1">
+                                    <widget class="QComboBox" name="javaScriptComboBox">
+                                        <item>
+                                            <property name="text">
+                                                <string>System default</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>JavaScript disabled</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>JavaScript enabled</string>
+                                            </property>
+                                        </item>
+                                    </widget>
+                                </item>
+
+                                <item row="2" column="1">
+                                    <widget class="QLabel" name="javaScriptLabel">
+                                        <property name="textFormat">
+                                            <enum>Qt::RichText</enum>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <!-- Cookies storage. -->
+                                <item row="3" column="0">
+                                    <widget class="QLabel">
+                                        <property name="text">
+                                            <string>Cookies</string>
+                                        </property>
+
+                                        <property name="toolTip">
+                                            <string>Local storage includes cookies, IndexedDB, DOM storage, filesystem API, and service workers.  DOM storage also requires a separate control to be enabled.  Local storage is disabled by default.</string>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <item row="3" column="1">
+                                    <widget class="QComboBox" name="cookiesComboBox">
+                                        <item>
+                                            <property name="text">
+                                                <string>System default</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>Cookies enabled</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>Cookies disabled</string>
+                                            </property>
+                                        </item>
+                                    </widget>
+                                </item>
+
+                                <item row="4" column="1">
+                                    <widget class="QLabel" name="cookiesLabel">
+                                        <property name="textFormat">
+                                            <enum>Qt::RichText</enum>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <!-- DOM storage. -->
+                                <item row="5" column="0">
+                                    <widget class="QLabel">
+                                        <property name="text">
+                                            <string>DOM storage</string>
+                                        </property>
+
+                                        <property name="toolTip">
+                                            <string>DOM storage, sometimes called web storage, is like cookies on steroids.  To function, it requires that both JavaScript and local storage be enabled.</string>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <item row="5" column="1">
+                                    <widget class="QComboBox" name="domStorageComboBox">
+                                        <item>
+                                            <property name="text">
+                                                <string>System default</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>DOM storage disabled</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>DOM storage enabled</string>
+                                            </property>
+                                        </item>
+                                    </widget>
+                                </item>
+
+                                <item row="6" column="1">
+                                    <widget class="QLabel" name="domStorageLabel">
+                                        <property name="textFormat">
+                                            <enum>Qt::RichText</enum>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <!-- User agent. -->
+                                <item row="7" column="0">
+                                    <widget class="QLabel">
+                                        <property name="text">
+                                            <string>User agent</string>
+                                        </property>
+
+                                        <property name="toolTip">
+                                            <string>The user agent identifies the browser to the web server.  It serves no useful purpose, but many web servers refuse to return the web page if they don't see a user agent they like.</string>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <item row="7" column="1">
+                                    <widget class="QComboBox" name="userAgentComboBox">
+                                        <property name="sizePolicy">
+                                            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                                                <horstretch>0</horstretch>
+                                                <verstretch>0</verstretch>
+                                            </sizepolicy>
+                                        </property>
+
+                                        <property name="editable">
+                                            <bool>true</bool>
+                                        </property>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>System default</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>Privacy Browser</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>WebEngine default</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>Firefox on Linux</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>Chromium on Linux</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>Firefox on Windows</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>Chrome on Windows</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>Edge on Windows</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>Safari on macOS</string>
+                                            </property>
+                                        </item>
+                                    </widget>
+                                </item>
+
+                                <item row="8" column="1">
+                                    <widget class="QLabel" name="userAgentLabel">
+                                        <property name="textFormat">
+                                            <enum>Qt::RichText</enum>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <!-- Zoom factor. -->
+                                <item row="9" column="0">
+                                    <widget class="QLabel">
+                                        <property name="text">
+                                            <string>Zoom factor</string>
+                                        </property>
+
+                                        <property name="toolTip">
+                                            <string>Set the zoom factor between 0.25 and 5.00.</string>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <item row="9" column="1">
+                                    <widget class="QComboBox" name="zoomFactorComboBox">
+                                        <item>
+                                            <property name="text">
+                                                <string>System default</string>
+                                            </property>
+                                        </item>
+
+                                        <item>
+                                            <property name="text">
+                                                <string>Custom</string>
+                                            </property>
+                                        </item>
+                                    </widget>
+                                </item>
+
+                                <item row="10" column="1">
+                                    <widget class="QDoubleSpinBox" name="customZoomFactorSpinBox">
+                                        <property name="minimum">
+                                            <double>0.250000000000000</double>
+                                        </property>
+
+                                        <property name="maximum">
+                                            <double>5.000000000000000</double>
+                                        </property>
+
+                                        <property name="singleStep">
+                                            <double>0.250000000000000</double>
+                                        </property>
+                                    </widget>
+                                </item>
+                            </layout>
+                        </widget>
+                    </item>
+
+                    <!-- Spacer. -->
+                    <item>
+                        <spacer>
+                            <property name="orientation">
+                                <enum>Qt::Vertical</enum>
+                            </property>
+                        </spacer>
+                    </item>
+
+                    <!-- Dialog buttons. -->
+                    <item>
+                        <widget class="QDialogButtonBox" name="dialogButtonBox">
+                            <property name="standardButtons">
+                                <set>QDialogButtonBox::Reset | QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel</set>
+                            </property>
+                        </widget>
+                    </item>
+                </layout>
+            </item>
+        </layout>
+    </widget>
+</ui>
diff --git a/src/uis/SettingsGeneral.ui b/src/uis/SettingsGeneral.ui
new file mode 100644 (file)
index 0000000..425ea65
--- /dev/null
@@ -0,0 +1,147 @@
+<?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">
+    <!-- The name of the generated class. -->
+    <class>GeneralSettings</class>
+
+    <widget class="QWidget">
+        <layout class="QFormLayout">
+            <!-- Homepage. -->
+            <item row="0" column="0">
+                <widget class="QLabel" name="homepageLabel">
+                    <property name="text">
+                        <string>Homepage</string>
+                    </property>
+
+                    <property name="toolTip">
+                        <string>The default is https://www.mojeek.com/.</string>
+                    </property>
+                </widget>
+            </item>
+
+            <item row="0" column="1">
+                <widget class="KLineEdit" name="kcfg_homepage" />
+            </item>
+
+            <!-- Search engine. -->
+            <item row="1" column="0">
+                <widget class="QLabel">
+                    <property name="text">
+                        <string>Search engine</string>
+                    </property>
+
+                    <property name="toolTip">
+                        <string>The default is Mojeek.</string>
+                    </property>
+                </widget>
+            </item>
+
+            <item row="1" column="1">
+                <widget class="QComboBox" name="kcfg_searchEngine">
+                    <property name="sizePolicy">
+                        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                            <horstretch>0</horstretch>
+                            <verstretch>0</verstretch>
+                        </sizepolicy>
+                    </property>
+
+                    <property name="editable">
+                        <bool>true</bool>
+                    </property>
+
+                    <item>
+                        <property name="text">
+                            <string>Mojeek</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>Monocles</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>MetaGer</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>Google</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>Bing</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>Yahoo</string>
+                        </property>
+                    </item>
+                </widget>
+            </item>
+
+            <item row="2" column="1">
+                <widget class="QLabel" name="searchEngineLabel">
+                    <property name="textInteractionFlags">
+                        <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+                    </property>
+                </widget>
+            </item>
+
+            <!-- Zoom factor. -->
+            <item row="3" column="0">
+                <widget class="QLabel" name="zoomFactorLabel">
+                    <property name="text">
+                        <string>Zoom factor</string>
+                    </property>
+
+                    <property name="toolTip">
+                        <string>Set the zoom factor between 0.25 and 5.00.  The default is 1.00.</string>
+                    </property>
+                </widget>
+            </item>
+
+            <item row="3" column="1">
+                <widget class="QDoubleSpinBox" name="kcfg_zoomFactor">
+
+                    <property name="minimum">
+                        <double>0.250000000000000</double>
+                    </property>
+
+                    <property name="maximum">
+                        <double>5.000000000000000</double>
+                    </property>
+
+                    <property name="singleStep">
+                        <double>0.250000000000000</double>
+                    </property>
+                </widget>
+            </item>
+        </layout>
+    </widget>
+</ui>
diff --git a/src/uis/SettingsPrivacy.ui b/src/uis/SettingsPrivacy.ui
new file mode 100644 (file)
index 0000000..6989f2a
--- /dev/null
@@ -0,0 +1,151 @@
+<?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">
+    <!-- The name of the generated class. -->
+    <class>PrivacySettings</class>
+
+    <widget class="QWidget">
+        <layout class="QFormLayout">
+            <!-- JavaScript. -->
+            <item row="0" column="1">
+                <widget class="QCheckBox" name="kcfg_javaScriptEnabled">
+                    <property name="text">
+                        <string>JavaScript</string>
+                    </property>
+
+                    <property name="toolTip">
+                        <string>JavaScript allows websites to run programs (scripts) on the device.  The default is disabled.</string>
+                    </property>
+                </widget>
+            </item>
+
+            <!-- Cookies. -->
+            <item row="1" column="1">
+                <widget class="QCheckBox" name="kcfg_cookiesEnabled">
+                    <property name="text">
+                        <string>Cookies</string>
+                    </property>
+
+                    <property name="toolTip">
+                        <string>Local storage includes cookies, IndexedDB, DOM storage, filesystem API, and service workers.  DOM storage also requires a separate control to be enabled.  Local storage is disabled by default.</string>
+                    </property>
+                </widget>
+            </item>
+
+            <!-- DOM storage. -->
+            <item row="2" column="1">
+                <widget class="QCheckBox" name="kcfg_domStorageEnabled">
+                    <property name="text">
+                        <string>DOM storage</string>
+                    </property>
+
+                    <property name="toolTip">
+                        <string>DOM storage, sometimes called web storage, is like cookies on steroids.  To function, it requires that both JavaScript and local storage be enabled.  It is disabled by default.</string>
+                    </property>
+                </widget>
+            </item>
+
+            <!-- User agent. -->
+            <item row="3" column="0">
+                <widget class="QLabel">
+                    <property name="text">
+                        <string>User agent</string>
+                    </property>
+
+                    <property name="toolTip">
+                        <string>The user agent identifies the browser to the web server.  It serves no useful purpose, but many web servers refuse to return the web page if they don't see a user agent they like.  The default is Privacy Browser.</string>
+                    </property>
+                </widget>
+            </item>
+
+            <item row="3" column="1">
+                <widget class="QComboBox" name="kcfg_userAgent">
+                    <property name="sizePolicy">
+                        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                            <horstretch>0</horstretch>
+                            <verstretch>0</verstretch>
+                        </sizepolicy>
+                    </property>
+
+                    <property name="editable">
+                        <bool>true</bool>
+                    </property>
+
+                    <item>
+                        <property name="text">
+                            <string>Privacy Browser</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>WebEngine Default</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>Firefox Linux</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>Chromium Linux</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>Firefox Windows</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>Chrome Windows</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>Edge Windows</string>
+                        </property>
+                    </item>
+
+                    <item>
+                        <property name="text">
+                            <string>Safari macOS</string>
+                        </property>
+                    </item>
+                </widget>
+            </item>
+
+            <item row="4" column="1">
+                <widget class="QLabel" name="userAgentLabel">
+                    <property name="textInteractionFlags">
+                        <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+                    </property>
+                </widget>
+            </item>
+        </layout>
+    </widget>
+</ui>
index 82e7e3ee0d0614d4e32e78e8984a2d6da3a8f59c..777d12efcda177e1ed877a615cd03938045625f0 100644 (file)
 // Initialize the public static variables.
 QString BrowserView::webEngineDefaultUserAgent = QStringLiteral("");
 
+// Construct the class.
 BrowserView::BrowserView(QWidget *parent) : QWidget(parent)
 {
+    // Initialize the variables.
+    privacyWebEngineListPointer = new QList<PrivacyWebEngine*>;
+
     // Instantiate the browser view UI.
     Ui::BrowserView browserViewUi;
 
@@ -59,6 +63,33 @@ BrowserView::BrowserView(QWidget *parent) : QWidget(parent)
     webEngineSettingsPointer = webEngineViewPointer->settings();
     webEngineCookieStorePointer = webEngineProfilePointer->cookieStore();
 
+    // Initialize the current privacy web engine pointer.
+    currentPrivacyWebEnginePointer = new PrivacyWebEngine(webEngineViewPointer);
+
+    // Populate the privacy web engine list.
+    privacyWebEngineListPointer->append(currentPrivacyWebEnginePointer);
+
+    // Set the cookie filter.
+    webEngineCookieStorePointer->setCookieFilter([this](const QWebEngineCookieStore::FilterRequest &filterRequest)
+    {
+        // qDebug() << "Cookie page URL:  " << filterRequest.firstPartyUrl << ", Cookie URL:  " << filterRequest.origin << ",  Is third-party:  " << filterRequest.thirdParty;
+
+        // Block all third party local storage requests, including the sneaky ones that don't register a first party URL.
+        if (filterRequest.thirdParty || (filterRequest.firstPartyUrl == QStringLiteral("")))
+            return false;
+
+        // Check each tab to see if this local storage request should be allowed.
+        for (PrivacyWebEngine *privacyWebEnginePointer : *privacyWebEngineListPointer)
+        {
+            // Allow this local storage request if it comes from a tab with local storage enabled.
+            if (privacyWebEnginePointer->cookiesEnabled && (webEngineViewPointer->url().host() == filterRequest.firstPartyUrl.host()))
+                return true;
+        }
+
+        // Block any remaining local storage requests.
+        return false;
+    });
+
     // Process cookie changes.
     connect(webEngineCookieStorePointer, SIGNAL(cookieAdded(QNetworkCookie)), this, SLOT(cookieAdded(QNetworkCookie)));
     connect(webEngineCookieStorePointer, SIGNAL(cookieRemoved(QNetworkCookie)), this, SLOT(cookieRemoved(QNetworkCookie)));
@@ -185,7 +216,7 @@ void BrowserView::applyDomainSettings(const QString &hostname, const bool reload
             case (DomainsDatabaseHelper::SYSTEM_DEFAULT):
             {
                 // Set the default JavaScript status.
-                webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScript());
+                webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScriptEnabled());
 
                 break;
             }
@@ -207,20 +238,23 @@ void BrowserView::applyDomainSettings(const QString &hostname, const bool reload
             }
         }
 
-        // Set local storage.
-        switch (domainRecord.field(DomainsDatabaseHelper::LOCAL_STORAGE).value().toInt())
+        // Set the cookie status.  TODO.
+        currentPrivacyWebEnginePointer->cookiesEnabled = Settings::cookiesEnabled();
+
+        // Set DOM storage.
+        switch (domainRecord.field(DomainsDatabaseHelper::DOM_STORAGE).value().toInt())
         {
             case (DomainsDatabaseHelper::SYSTEM_DEFAULT):
             {
-                // Set the default local storage status.
-                webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, Settings::localStorage());
+                // Set the default DOM storage status.
+                webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, Settings::domStorageEnabled());
 
                 break;
             }
 
             case (DomainsDatabaseHelper::DISABLED):
             {
-                // Disable local storage.
+                // Disable DOM storage.
                 webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, false);
 
                 break;
@@ -228,7 +262,7 @@ void BrowserView::applyDomainSettings(const QString &hostname, const bool reload
 
             case (DomainsDatabaseHelper::ENABLED):
             {
-                // Enable local storage.
+                // Enable DOM storage.
                 webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
 
                 break;
@@ -259,10 +293,13 @@ void BrowserView::applyDomainSettings(const QString &hostname, const bool reload
     else  // The hostname does not have domain settings.
     {
         // Set the JavaScript status.
-        webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScript());
+        webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScriptEnabled());
+
+        // Set the cookie status.
+        currentPrivacyWebEnginePointer->cookiesEnabled = Settings::cookiesEnabled();
 
-        // Set local storage.
-        webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, Settings::localStorage());
+        // Set DOM storage.
+        webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, Settings::domStorageEnabled());
 
         // Set the user agent.
         webEngineProfilePointer->setHttpUserAgent(UserAgentHelper::getUserAgentFromDatabaseName(Settings::userAgent()));
@@ -279,7 +316,8 @@ void BrowserView::applyDomainSettings(const QString &hostname, const bool reload
 
     // Emit the update actions signals.
     emit updateJavaScriptAction(webEngineSettingsPointer->testAttribute(QWebEngineSettings::JavascriptEnabled));
-    emit updateLocalStorageAction(webEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
+    emit updateCookiesAction(currentPrivacyWebEnginePointer->cookiesEnabled);
+    emit updateDomStorageAction(webEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
     emit updateUserAgentActions(webEngineProfilePointer->httpUserAgent());
     emit updateZoomFactorAction(webEngineViewPointer->zoomFactor());
 
@@ -473,6 +511,18 @@ void BrowserView::refresh() const
     webEngineViewPointer->reload();
 }
 
+void BrowserView::toggleCookies()
+{
+    // Toggle cookies.
+    currentPrivacyWebEnginePointer->cookiesEnabled = !currentPrivacyWebEnginePointer->cookiesEnabled;
+
+    // Update the cookies icon.
+    emit updateCookiesAction(currentPrivacyWebEnginePointer->cookiesEnabled);
+
+    // Reload the website.
+    webEngineViewPointer->reload();
+}
+
 void BrowserView::toggleJavaScript() const
 {
     // Toggle JavaScript.
@@ -485,13 +535,13 @@ void BrowserView::toggleJavaScript() const
     webEngineViewPointer->reload();
 }
 
-void BrowserView::toggleLocalStorage() const
+void BrowserView::toggleDomStorage() const
 {
-    // Toggle local storage.
+    // Toggle DOM storage.
     webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, !webEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
 
-    // Update the local storage icon.
-    emit updateLocalStorageAction(webEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
+    // Update the DOM storage action icon.
+    emit updateDomStorageAction(webEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
 
     // Reload the website.
     webEngineViewPointer->reload();
index ae1c06ae3bc0b997f2168877eec9368ba6f8db07..031496600d74c36a90589bc956a8ea5d15d5db59 100644 (file)
 #ifndef BROWSERVIEW_H
 #define BROWSERVIEW_H
 
+// Application headers.
+#include "structs/PrivacyWebEngine.h"
+
 // KDE Framework headers.
 #include <KLineEdit>
 
-// Qt framework headers.
+// Qt toolkit headers.
 #include <QPushButton>
 #include <QWebEngineHistory>
 #include <QWebEngineProfile>
@@ -45,8 +48,9 @@ public:
     // The public functions.
     void applyOnTheFlyZoomFactor(const double &zoomFactor);
     void loadInitialWebsite();
+    void toggleCookies();
+    void toggleDomStorage() const;
     void toggleJavaScript() const;
-    void toggleLocalStorage() const;
 
     // The public static variables.
     static QString webEngineDefaultUserAgent;
@@ -60,10 +64,11 @@ signals:
     void linkHovered(const QString &linkUrl) const;
     void showProgressBar(const int &progress) const;
     void updateBackAction(const bool &isEnabled) const;
+    void updateCookiesAction(const bool &isEnabled) const;
+    void updateDomStorageAction(const bool &isEnabled) const;
     void updateDomainSettingsIndicator(const bool &status, const QString &domainSettingsDomain) const;
     void updateForwardAction(const bool &isEnabled) const;
     void updateJavaScriptAction(const bool &isEnabled) const;
-    void updateLocalStorageAction(const bool &isEnabled) const;
     void updateSearchEngineActions(const QString &searchEngine) const;
     void updateUrlLineEdit(const QUrl &newUrl) const;
     void updateUserAgentActions(const QString &userAgent) const;
@@ -100,6 +105,8 @@ private Q_SLOTS:
 private:
     // The private variables.
     double currentZoomFactor;  // This can be removed once <https://redmine.stoutner.com/issues/799> has been resolved.
+    PrivacyWebEngine *currentPrivacyWebEnginePointer;
+    QList<PrivacyWebEngine*> *privacyWebEngineListPointer;
     QString searchEngineUrl;
     QWebEngineCookieStore *webEngineCookieStorePointer;
     QWebEngineHistory *webEngineHistoryPointer;
index 2cfc251151648d13fcdd54d1eb2b4a135ccb84c0..ef264a5db5476d3ae05074bbfdb23bd9ca5b8f1d 100644 (file)
 #include <QNetworkCookie>
 #include <QStatusBar>
 
+// Construct the class.
 BrowserWindow::BrowserWindow() : KXmlGuiWindow()
 {
+    // Initialize the variables.
+    cookieListPointer = new std::list<QNetworkCookie>;
+    cookiesEnabled = false;
+    javaScriptEnabled = false;
+
     // Instantiate the main view pointer.
     browserViewPointer = new BrowserView(this);
 
@@ -75,9 +81,10 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     searchEngineYahooActionPointer = actionCollectionPointer->addAction(QStringLiteral("search_engine_yahoo"));
     searchEngineCustomActionPointer = actionCollectionPointer->addAction(QStringLiteral("search_engine_custom"));
     QAction *domainSettingsActionPointer = actionCollectionPointer->addAction(QStringLiteral("domain_settings"));
-    QAction *cookiesActionPointer = actionCollectionPointer->addAction(QStringLiteral("cookies"));
+    cookiesActionPointer = actionCollectionPointer->addAction(QStringLiteral("cookies"));
     javaScriptActionPointer = actionCollectionPointer->addAction(QStringLiteral("javascript"));
-    localStorageActionPointer = actionCollectionPointer->addAction(QStringLiteral("local_storage"));
+    onTheFlyCookiesActionPointer = actionCollectionPointer->addAction(QStringLiteral("on-the-fly_cookies"));
+    domStorageActionPointer = actionCollectionPointer->addAction(QStringLiteral("dom_storage"));
 
     // Create the action groups
     QActionGroup *userAgentActionGroupPointer = new QActionGroup(this);
@@ -119,7 +126,10 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     searchEngineYahooActionPointer->setCheckable(true);
     searchEngineCustomActionPointer->setCheckable(true);
 
-    // Set the non-mutable action text.
+    // Get the number of cookies.
+    int numberOfCookies = cookieListPointer->size();
+
+    // Set the action text.
     userAgentPrivacyBrowserActionPointer->setText(UserAgentHelper::PRIVACY_BROWSER_TRANSLATED);
     userAgentWebEngineDefaultActionPointer->setText(UserAgentHelper::WEB_ENGINE_DEFAULT_TRANSLATED);
     userAgentFirefoxLinuxActionPointer->setText(UserAgentHelper::FIREFOX_LINUX_TRANSLATED);
@@ -135,9 +145,10 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     searchEngineBingActionPointer->setText(i18nc("Search engine", "Bing"));
     searchEngineYahooActionPointer->setText(i18nc("Search engine", "Yahoo"));
     domainSettingsActionPointer->setText(i18nc("Domain Settings action", "Domain Settings"));
-    cookiesActionPointer->setText(i18nc("Cookies action", "Cookies"));
+    cookiesActionPointer->setText(i18nc("The Cookies action, which also displays the number of cookies", "Cookies - %1", numberOfCookies));
     javaScriptActionPointer->setText(i18nc("JavaScript action", "JavaScript"));
-    localStorageActionPointer->setText(i18nc("Local Storage action", "Local Storage"));
+    onTheFlyCookiesActionPointer->setText(i18nc("The On-The-Fly Cookies action, which also display the number of cookies", "Cookies - %1", numberOfCookies));
+    domStorageActionPointer->setText(i18nc("DOM Storage action", "DOM Storage"));
 
     // Set the action icons.
     userAgentPrivacyBrowserActionPointer->setIcon(QIcon(":/icons/privacy-mode"));
@@ -159,6 +170,7 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     zoomFactorActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("zoom")));
     domainSettingsActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("settings-configure")));
     cookiesActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("preferences-web-browser-cookies")));
+    onTheFlyCookiesActionPointer->setIcon(QIcon(":/icons/cookies-off"));
 
     // Update the on-the-fly menus.
     connect(browserViewPointer, SIGNAL(updateUserAgentActions(QString)), this, SLOT(updateUserAgentActions(QString)));
@@ -176,13 +188,15 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
 
     // Connect the URL toolbar actions.
     connect(javaScriptActionPointer, SIGNAL(triggered()), this, SLOT(toggleJavaScript()));
-    connect(localStorageActionPointer, SIGNAL(triggered()), this, SLOT(toggleLocalStorage()));
+    connect(onTheFlyCookiesActionPointer, SIGNAL(triggered()), this, SLOT(toggleCookies()));
+    connect(domStorageActionPointer, SIGNAL(triggered()), this, SLOT(toggleDomStorage()));
 
     // Update the URL toolbar actions.
     connect(browserViewPointer, SIGNAL(updateBackAction(bool)), backActionPointer, SLOT(setEnabled(bool)));
     connect(browserViewPointer, SIGNAL(updateForwardAction(bool)), forwardActionPointer, SLOT(setEnabled(bool)));
     connect(browserViewPointer, SIGNAL(updateJavaScriptAction(bool)), this, SLOT(updateJavaScriptAction(bool)));
-    connect(browserViewPointer, SIGNAL(updateLocalStorageAction(bool)), this, SLOT(updateLocalStorageAction(bool)));
+    connect(browserViewPointer, SIGNAL(updateCookiesAction(bool)), this, SLOT(updateCookiesAction(bool)));
+    connect(browserViewPointer, SIGNAL(updateDomStorageAction(bool)), this, SLOT(updateDomStorageAction(bool)));
 
     // Setup the GUI based on the browser_ui.rc file.
     setupGUI(StandardWindowOption::Default, ("browser_ui.rc"));
@@ -237,9 +251,6 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     // Update the applied palette.
     connect(browserViewPointer, SIGNAL(updateDomainSettingsIndicator(bool, QString)), this, SLOT(updateDomainSettingsIndicator(bool, QString)));
 
-    // Initialize the cookie list.
-    cookieListPointer = new std::forward_list<QNetworkCookie>;
-
     // Process cookie changes.
     connect(browserViewPointer, SIGNAL(addCookie(QNetworkCookie)), this, SLOT(addCookieToList(QNetworkCookie)));
     connect(browserViewPointer, SIGNAL(removeCookie(QNetworkCookie)), this, SLOT(removeCookieFromList(QNetworkCookie)));
@@ -251,8 +262,16 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
 void BrowserWindow::addCookieToList(const QNetworkCookie &newCookie) const
 {
     qDebug() << "Add cookie:  " << newCookie.toRawForm();
+
     // Add the new cookie to the list.
     cookieListPointer->push_front(newCookie);
+
+    // Get the number of cookies.
+    int numberOfCookies = cookieListPointer->size();
+
+    // Update the action text.
+    cookiesActionPointer->setText(i18nc("The Cookies action, which also displays the number of cookies", "Cookies - %1", numberOfCookies));
+    onTheFlyCookiesActionPointer->setText(i18nc("The On-The-Fly Cookies action, which also display the number of cookies", "Cookies - %1", numberOfCookies));
 }
 
 void BrowserWindow::addOrEditDomainSettings() const
@@ -407,6 +426,13 @@ void BrowserWindow::removeCookieFromList(const QNetworkCookie &cookie) const
 
     // Remove the cookie from the list.
     cookieListPointer->remove(cookie);
+
+    // Get the number of cookies.
+    int numberOfCookies = cookieListPointer->size();
+
+    // Update the action text.
+    cookiesActionPointer->setText(i18nc("The Cookies action, which also displays the number of cookies", "Cookies - %1", numberOfCookies));
+    onTheFlyCookiesActionPointer->setText(i18nc("The On-The-Fly Cookies action, which also display the number of cookies", "Cookies - %1", numberOfCookies));
 }
 
 void BrowserWindow::showProgressBar(const int &progress) const
@@ -499,6 +525,15 @@ void BrowserWindow::settingsConfigure()
     }
 }
 
+void BrowserWindow::toggleCookies() const
+{
+    // Remove the focus from teh URL line edit.
+    urlLineEditPointer->clearFocus();
+
+    // Toggle cookies.
+    browserViewPointer->toggleCookies();
+}
+
 void BrowserWindow::toggleJavaScript() const
 {
     // Remove the focus from the URL line edit.
@@ -508,37 +543,64 @@ void BrowserWindow::toggleJavaScript() const
     browserViewPointer->toggleJavaScript();
 }
 
-void BrowserWindow::toggleLocalStorage() const
+void BrowserWindow::toggleDomStorage() const
 {
     // Remove the focus from the URL line edit.
     urlLineEditPointer->clearFocus();
 
-    // Toggle JavaScript.
-    browserViewPointer->toggleLocalStorage();
+    // Toggle DOM storage.
+    browserViewPointer->toggleDomStorage();
+}
+
+void BrowserWindow::updateCookiesAction(const bool &isEnabled)
+{
+    // Update the cookies status.
+    cookiesEnabled = isEnabled;
+
+    // Update the icon.
+    if (cookiesEnabled)
+        onTheFlyCookiesActionPointer->setIcon(QIcon(":/icons/cookies-on"));
+    else
+        onTheFlyCookiesActionPointer->setIcon(QIcon(":/icons/cookies-off"));
+
+    // Update the status of the DOM storage action.
+    domStorageActionPointer->setEnabled(cookiesEnabled & javaScriptEnabled);
 }
 
 void BrowserWindow::updateDomainSettingsIndicator(const bool &status, const QString &domainSettingsDomain)
 {
     // Set the domain palette according to the status.
-    if (status) urlLineEditPointer->setPalette(domainSettingsPalette);
-    else urlLineEditPointer->setPalette(noDomainSettingsPalette);
+    if (status)
+        urlLineEditPointer->setPalette(domainSettingsPalette);
+    else
+        urlLineEditPointer->setPalette(noDomainSettingsPalette);
 
     // Store the domain.
     currentDomainSettingsDomain = domainSettingsDomain;
 }
 
-void BrowserWindow::updateJavaScriptAction(const bool &isEnabled) const
+void BrowserWindow::updateJavaScriptAction(const bool &isEnabled)
 {
+    // Update the JavaScript status.
+    javaScriptEnabled = isEnabled;
+
     // Set the icon according to the status.
-    if (isEnabled) javaScriptActionPointer->setIcon(QIcon(":/icons/javascript-warning"));
-    else javaScriptActionPointer->setIcon(QIcon(":/icons/privacy-mode"));
+    if (javaScriptEnabled)
+        javaScriptActionPointer->setIcon(QIcon(":/icons/javascript-warning"));
+    else
+        javaScriptActionPointer->setIcon(QIcon(":/icons/privacy-mode"));
+
+    // Update the status of the DOM storage action.
+    domStorageActionPointer->setEnabled(javaScriptEnabled & cookiesEnabled);
 }
 
-void BrowserWindow::updateLocalStorageAction(const bool &isEnabled) const
+void BrowserWindow::updateDomStorageAction(const bool &isEnabled) const
 {
     // Set the icon according to the status.
-    if (isEnabled) localStorageActionPointer->setIcon(QIcon::fromTheme("disk-quota-low"));
-    else localStorageActionPointer->setIcon(QIcon::fromTheme("disk-quota"));
+    if (isEnabled)
+        domStorageActionPointer->setIcon(QIcon::fromTheme("disk-quota-low"));
+    else
+        domStorageActionPointer->setIcon(QIcon::fromTheme("disk-quota"));
 }
 
 void BrowserWindow::updateSearchEngineActions(const QString &searchEngine) const
index a35e060c12bc6dfb32a9fcddff63d12f4164134c..c66a528ce7679d39372480278f8cfb5ccf2391a0 100644 (file)
@@ -32,7 +32,7 @@
 #include <QProgressBar>
 
 // C++ headers.
-#include <forward_list>
+#include <list>
 
 class BrowserWindow : public KXmlGuiWindow
 {
@@ -63,11 +63,13 @@ private Q_SLOTS:
     void removeCookieFromList(const QNetworkCookie &cookie) const;
     void settingsConfigure();
     void showProgressBar(const int &progress) const;
+    void toggleCookies() const;
+    void toggleDomStorage() const;
     void toggleJavaScript() const;
-    void toggleLocalStorage() const;
+    void updateCookiesAction(const bool &isEnabled);
+    void updateDomStorageAction(const bool &isEnabled) const;
     void updateDomainSettingsIndicator(const bool &status, const QString &domainSettingsDomain);
-    void updateJavaScriptAction(const bool &isEnabled) const;
-    void updateLocalStorageAction(const bool &isEnabled) const;
+    void updateJavaScriptAction(const bool &isEnabled);
     void updateSearchEngineActions(const QString &searchEngine) const;
     void updateUserAgentActions(const QString &userAgent) const;
     void updateZoomFactorAction(const double &zoomFactor);
@@ -79,14 +81,18 @@ private:
     // The private variables.
     BrowserView *browserViewPointer;
     KConfigDialog *configDialogPointer;
-    std::forward_list<QNetworkCookie> *cookieListPointer;
+    std::list<QNetworkCookie> *cookieListPointer;
+    QAction *cookiesActionPointer;
+    bool cookiesEnabled;
     QString currentDomainSettingsDomain;
     QUrl currentUrl;
     double currentZoomFactor;
+    QAction *domStorageActionPointer;
     QPalette domainSettingsPalette;
     QAction *javaScriptActionPointer;
-    QAction *localStorageActionPointer;
+    bool javaScriptEnabled;
     QPalette noDomainSettingsPalette;
+    QAction *onTheFlyCookiesActionPointer;
     QProgressBar *progressBarPointer;
     QLabel *searchEngineLabelPointer;
     QAction *searchEngineMojeekActionPointer;