]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/commitdiff
Highlight non-default domain settings.
authorSoren Stoutner <soren@stoutner.com>
Tue, 9 Aug 2022 23:39:12 +0000 (16:39 -0700)
committerSoren Stoutner <soren@stoutner.com>
Tue, 9 Aug 2022 23:39:12 +0000 (16:39 -0700)
src/dialogs/DomainSettingsDialog.cpp
src/dialogs/DomainSettingsDialog.h
src/helpers/UserAgentHelper.cpp
src/uis/DomainSettingsDialog.ui
src/uis/TabWidget.ui
src/widgets/TabWidget.cpp
src/windows/BrowserWindow.cpp

index c8dc3ea8bdd2b7486c2914843620424ef142b3c1..34ff70e592bf988a8bdc3eb8d69f617361983ad7 100644 (file)
@@ -53,14 +53,19 @@ DomainSettingsDialog::DomainSettingsDialog(const int &startType, const QString &
     domainsListViewPointer = domainSettingsDialogUi.domainsListView;
     domainSettingsWidgetPointer = domainSettingsDialogUi.domainSettingsWidget;
     domainNameLineEditPointer = domainSettingsDialogUi.domainNameLineEdit;
+    javaScriptWidgetPointer = domainSettingsDialogUi.javaScriptWidget;
     javaScriptComboBoxPointer = domainSettingsDialogUi.javaScriptComboBox;
     javaScriptLabelPointer = domainSettingsDialogUi.javaScriptLabel;
+    localStorageWidgetPointer = domainSettingsDialogUi.localStorageWidget;
     localStorageComboBoxPointer = domainSettingsDialogUi.localStorageComboBox;
     localStorageLabelPointer = domainSettingsDialogUi.localStorageLabel;
+    domStorageWidgetPointer = domainSettingsDialogUi.domStorageWidget;
     domStorageComboBoxPointer = domainSettingsDialogUi.domStorageComboBox;
     domStorageLabelPointer = domainSettingsDialogUi.domStorageLabel;
+    userAgentWidgetPointer = domainSettingsDialogUi.userAgentWidget;
     userAgentComboBoxPointer = domainSettingsDialogUi.userAgentComboBox;
     userAgentLabelPointer = domainSettingsDialogUi.userAgentLabel;
+    zoomFactorWidgetPointer = domainSettingsDialogUi.zoomFactorWidget;
     zoomFactorComboBoxPointer = domainSettingsDialogUi.zoomFactorComboBox;
     customZoomFactorSpinBoxPointer = domainSettingsDialogUi.customZoomFactorSpinBox;
     QPushButton *addDomainButtonPointer = domainSettingsDialogUi.addDomainButton;
@@ -96,6 +101,21 @@ DomainSettingsDialog::DomainSettingsDialog(const int &startType, const QString &
     // Read the data from the database and apply it to the table model.
     domainsTableModelPointer->select();
 
+    // Get the default palette.
+    defaultPalette = javaScriptWidgetPointer->palette();
+
+    // Populate the highlighted palette.
+    highlightedPalette = defaultPalette;
+
+    // Get the default highlight color.
+    QColor highlightColor = defaultPalette.color(QPalette::Highlight);
+
+    // Set the highlight color to be partially transparent.
+    highlightColor.setAlpha(64);
+
+    // Set highlighted background color.
+    highlightedPalette.setColor(QPalette::Window, highlightColor);
+
     // Setup the dialog according to the start type.
     switch (startType)
     {
@@ -353,30 +373,39 @@ void DomainSettingsDialog::populateDomStorageLabel() const
     // Populate the label according to the currently selected index.
     switch (domStorageComboBoxPointer->currentIndex())
     {
-        // Set the text according to the system default.
         case (DomainsDatabase::SYSTEM_DEFAULT):
         {
+            // Set the text according to the system default.
             if (Settings::domStorageEnabled())
                 domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label.", "DOM storage enabled"));
             else
                 domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label.", "DOM storage disabled"));
 
+            // Reset the palette.
+            domStorageWidgetPointer->setPalette(defaultPalette);
+
             break;
         }
 
-        // Set the disabled text in bold.
         case (DomainsDatabase::DISABLED):
         {
+            // Set the disabled text in bold.
             domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label.  The <b> tags should be retained.", "<b>DOM storage disabled</b>"));
 
+            // Set the palette.
+            domStorageWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
 
-        // Set the enabled text in bold.
         case (DomainsDatabase::ENABLED):
         {
+            // Set the enabled text in bold.
             domStorageLabelPointer->setText(i18nc("Domain settings DOM storage label.  The <b> tags should be retained.", "<b>DOM storage enabled</b>"));
 
+            // Set the palette.
+            domStorageWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
     }
@@ -387,30 +416,39 @@ void DomainSettingsDialog::populateJavaScriptLabel() const
     // Populate the label according to the currently selected index.
     switch (javaScriptComboBoxPointer->currentIndex())
     {
-        // Set the text according to the system default.
         case (DomainsDatabase::SYSTEM_DEFAULT):
         {
+            // Set the text according to the system default.
             if (Settings::javaScriptEnabled())
                 javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label.", "JavaScript enabled"));
             else
                 javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label.", "JavaScript disabled"));
 
+            // Reset the palette.
+            javaScriptWidgetPointer->setPalette(defaultPalette);
+
             break;
         }
 
-        // Set the disabled text in bold.
         case (DomainsDatabase::DISABLED):
         {
+            // Set the disabled text in bold.
             javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label.  The <b> tags should be retained.", "<b>JavaScript disabled</b>"));
 
+            // Set the palette.
+            javaScriptWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
 
-        // Set the enabled text in bold.
         case (DomainsDatabase::ENABLED):
         {
+            // Set the enabled text in bold.
             javaScriptLabelPointer->setText(i18nc("Domain settings JavaScript label.  The <b> tags should be retained.", "<b>JavaScript enabled</b>"));
 
+            // Set the palette.
+            javaScriptWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
     }
@@ -421,30 +459,39 @@ void DomainSettingsDialog::populateLocalStorageLabel() const
     // Populate the label according to the currently selected index.
     switch (localStorageComboBoxPointer->currentIndex())
     {
-        // Set the text according to the system default.
         case (DomainsDatabase::SYSTEM_DEFAULT):
         {
+            // Set the text according to the system default.
             if (Settings::localStorageEnabled())
                 localStorageLabelPointer->setText(i18nc("Domain settings local storage label.", "Local storage enabled"));
             else
                 localStorageLabelPointer->setText(i18nc("Domain settings local storage label.", "Local storage disabled"));
 
+            // Reset the palette.
+            localStorageWidgetPointer->setPalette(defaultPalette);
+
             break;
         }
 
-        // Set the disabled text in bold.
         case (DomainsDatabase::DISABLED):
         {
+            // Set the disabled text in bold.
             localStorageLabelPointer->setText(i18nc("Domain settings local storage label.  The <b> tags should be retained.", "<b>Local storage disabled</b>"));
 
+            // Set the palette.
+            localStorageWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
 
-        // Set the enabled text in bold.
         case (DomainsDatabase::ENABLED):
         {
+            // Set the enabled text in bold.
             localStorageLabelPointer->setText(i18nc("Domain settings local storage label.  The <b> tabs should be retained.", "<b>Local storage enabled</b>"));
 
+            // Set the palette.
+            localStorageWidgetPointer->setPalette(highlightedPalette);
+
             break;
         }
     }
@@ -458,11 +505,17 @@ void DomainSettingsDialog::populateUserAgentLabel(const QString &userAgentName)
     {
         // Display the system default user agent name.
         userAgentLabelPointer->setText(UserAgentHelper::getTranslatedUserAgentNameFromDatabaseName(Settings::userAgent()));
+
+        // Reset the palette.
+        userAgentWidgetPointer->setPalette(defaultPalette);
     }
     else
     {
         // Display the user agent name in bold.
         userAgentLabelPointer->setText("<strong>" + userAgentName + "</strong>");
+
+        // Set the palette.
+        userAgentWidgetPointer->setPalette(highlightedPalette);
     }
 }
 
@@ -597,11 +650,17 @@ void DomainSettingsDialog::zoomFactorComboBoxChanged(const int &newIndex) const
     {
         // Display the default zoom factor.
         customZoomFactorSpinBoxPointer->setValue(Settings::zoomFactor());
+
+        // Reset the palette.
+        zoomFactorWidgetPointer->setPalette(defaultPalette);
     }
     else  // Custom zoom factor is selected.
     {
         // Display the custom zoom factor from the domain settings.
         customZoomFactorSpinBoxPointer->setValue(modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabase::CUSTOM_ZOOM_FACTOR)).data().toDouble());
+
+        // Set the palette.
+        zoomFactorWidgetPointer->setPalette(highlightedPalette);
     }
 
     // Update the status of the custom zoom factor spin box.
index fb4590211a99fd6bdddf7ce1f068fa3a26f304a4..7680a0323252b109ed27f78369837c11e3182af4 100644 (file)
@@ -67,7 +67,9 @@ private:
     // The private variables.
     QPushButton *applyButtonPointer;
     QDoubleSpinBox *customZoomFactorSpinBoxPointer;
+    QPalette defaultPalette;
     QPushButton *deleteDomainButtonPointer;
+    QWidget *domStorageWidgetPointer;
     QComboBox *domStorageComboBoxPointer;
     QLabel *domStorageLabelPointer;
     KLineEdit *domainNameLineEditPointer;
@@ -75,13 +77,18 @@ private:
     QListView *domainsListViewPointer;
     QSqlTableModel *domainsTableModelPointer;
     QItemSelectionModel *domainsSelectionModelPointer;
+    QPalette highlightedPalette;
+    QWidget *javaScriptWidgetPointer;
     QComboBox *javaScriptComboBoxPointer;
     QLabel *javaScriptLabelPointer;
+    QWidget *localStorageWidgetPointer;
     QComboBox *localStorageComboBoxPointer;
     QLabel *localStorageLabelPointer;
     QPushButton *resetButtonPointer;
+    QWidget *userAgentWidgetPointer;
     QComboBox *userAgentComboBoxPointer;
     QLabel *userAgentLabelPointer;
+    QWidget *zoomFactorWidgetPointer;
     QComboBox *zoomFactorComboBoxPointer;
 
     // The private functions.
index 9727c31aa13f5c3e6a1635e4b80374d81edcb259..14a71e2cd8720ebd8978ca291a7f1081ecff9aa6 100644 (file)
@@ -50,11 +50,11 @@ const QString UserAgentHelper::SAFARI_MACOS_TRANSLATED = i18n("Safari on macOS")
 // Define the public user agent constants.
 const QString UserAgentHelper::PRIVACY_BROWSER_USER_AGENT = QStringLiteral("PrivacyBrowser/1.0");
 const QString UserAgentHelper::FIREFOX_LINUX_USER_AGENT = QStringLiteral("Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0");
-const QString UserAgentHelper::CHROMIUM_LINUX_USER_AGENT = QStringLiteral("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36");
-const QString UserAgentHelper::FIREFOX_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0");
-const QString UserAgentHelper::CHROME_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36");
-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");
+const QString UserAgentHelper::CHROMIUM_LINUX_USER_AGENT = QStringLiteral("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36");
+const QString UserAgentHelper::FIREFOX_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0");
+const QString UserAgentHelper::CHROME_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36");
+const QString UserAgentHelper::EDGE_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 Edg/103.0.1264.71");
+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.5 Safari/605.1.15");
 
 // Construct the class.
 UserAgentHelper::UserAgentHelper() {};
index d7eac8e1d0fa2cd6f240f567e6cba41be174cdbd..f0893630a760fb3c70f825efc597c04b6a166859 100644 (file)
@@ -33,6 +33,7 @@
 
         <!-- Main layout. -->
         <layout class="QHBoxLayout">
+            <!-- Left column. -->
             <item>
                 <layout class="QVBoxLayout">
                     <!-- Domains list view. -->
                 </layout>
             </item>
 
+            <!-- Right column. -->
             <item>
                 <layout class="QVBoxLayout">
+                    <!-- Domain settings widget.-->
                     <item>
                         <widget class="QWidget" name="domainSettingsWidget">
-                            <!-- Domain settings form layout. -->
-                            <layout class="QFormLayout">
-                                <!-- Domain name. -->
-                                <item row="0" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>Domain name</string>
-                                        </property>
+                            <layout class="QVBoxLayout">
 
-                                        <property name="toolTip">
-                                            <string>*. may be prepended to a domain to include all subdomains (eg. *.stoutner.com).</string>
-                                        </property>
-                                    </widget>
-                                </item>
+                                <!-- Domain name. -->
+                                <item>
+                                    <layout class="QFormLayout">
+                                        <item row="0" column="0">
+                                            <widget class="QLabel">
+                                                <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 row="0" column="1">
+                                            <widget class="KLineEdit" name="domainNameLineEdit" />
+                                        </item>
+                                    </layout>
                                 </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>
+                                <item>
+                                    <widget class="QWidget" name="javaScriptWidget">
+                                        <property name="autoFillBackground">
+                                            <bool>true</bool>
                                         </property>
-                                    </widget>
-                                </item>
 
-                                <item row="1" column="1">
-                                    <widget class="QComboBox" name="javaScriptComboBox">
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
+                                        <layout class="QFormLayout">
+                                            <property name="leftMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>JavaScript disabled</string>
+                                            <property name="topMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>JavaScript enabled</string>
+                                            <property name="rightMargin">
+                                                <number>10</number>
+                                            </property>
+                                            <property name="bottomMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-                                    </widget>
-                                </item>
 
-                                <item row="2" column="1">
-                                    <widget class="QLabel" name="javaScriptLabel">
-                                        <property name="textFormat">
-                                            <enum>Qt::RichText</enum>
-                                        </property>
+                                            <item row="0" 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="0" 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="1" column="1">
+                                                <widget class="QLabel" name="javaScriptLabel">
+                                                    <property name="textFormat">
+                                                        <enum>Qt::RichText</enum>
+                                                    </property>
+                                                </widget>
+                                            </item>
+                                        </layout>
                                     </widget>
                                 </item>
 
                                 <!-- Local storage. -->
-                                <item row="3" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>Local storage</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>
+                                <item>
+                                    <widget class="QWidget" name="localStorageWidget">
+                                        <property name="autoFillBackground">
+                                            <bool>true</bool>
                                         </property>
-                                    </widget>
-                                </item>
 
-                                <item row="3" column="1">
-                                    <widget class="QComboBox" name="localStorageComboBox">
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
+                                        <layout class="QFormLayout">
+                                            <property name="leftMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Local storage disabled</string>
+                                            <property name="topMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Local storage enabled</string>
+                                            <property name="rightMargin">
+                                                <number>10</number>
+                                            </property>
+                                            <property name="bottomMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-                                    </widget>
-                                </item>
 
-                                <item row="4" column="1">
-                                    <widget class="QLabel" name="localStorageLabel">
-                                        <property name="textFormat">
-                                            <enum>Qt::RichText</enum>
-                                        </property>
+                                            <item row="0" column="0">
+                                                <widget class="QLabel">
+                                                    <property name="text">
+                                                        <string>Local storage</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="0" column="1">
+                                                <widget class="QComboBox" name="localStorageComboBox">
+                                                    <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="1" column="1">
+                                                <widget class="QLabel" name="localStorageLabel">
+                                                    <property name="textFormat">
+                                                        <enum>Qt::RichText</enum>
+                                                    </property>
+                                                </widget>
+                                            </item>
+                                        </layout>
                                     </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>
+                                <item>
+                                    <widget class="QWidget" name="domStorageWidget">
+                                        <property name="autoFillBackground">
+                                            <bool>true</bool>
                                         </property>
-                                    </widget>
-                                </item>
 
-                                <item row="5" column="1">
-                                    <widget class="QComboBox" name="domStorageComboBox">
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
+                                        <layout class="QFormLayout">
+                                            <property name="leftMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>DOM storage disabled</string>
+                                            <property name="topMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>DOM storage enabled</string>
+                                            <property name="rightMargin">
+                                                <number>10</number>
+                                            </property>
+                                            <property name="bottomMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-                                    </widget>
-                                </item>
 
-                                <item row="6" column="1">
-                                    <widget class="QLabel" name="domStorageLabel">
-                                        <property name="textFormat">
-                                            <enum>Qt::RichText</enum>
-                                        </property>
+                                            <item row="0" 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="0" 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="1" column="1">
+                                                <widget class="QLabel" name="domStorageLabel">
+                                                    <property name="textFormat">
+                                                        <enum>Qt::RichText</enum>
+                                                    </property>
+                                                </widget>
+                                            </item>
+                                        </layout>
                                     </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">
+                                <item>
+                                    <widget class="QWidget" name="userAgentWidget">
+                                        <property name="autoFillBackground">
                                             <bool>true</bool>
                                         </property>
 
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
-                                            </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Privacy Browser</string>
+                                        <layout class="QFormLayout">
+                                            <property name="leftMargin">
+                                                <number>10</number>
                                             </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 name="topMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Edge on Windows</string>
+                                            <property name="rightMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Safari on macOS</string>
+                                            <property name="bottomMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-                                    </widget>
-                                </item>
 
-                                <item row="8" column="1">
-                                    <widget class="QLabel" name="userAgentLabel">
-                                        <property name="textFormat">
-                                            <enum>Qt::RichText</enum>
-                                        </property>
+                                            <item row="0" 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="0" 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="1" column="1">
+                                                <widget class="QLabel" name="userAgentLabel">
+                                                    <property name="textFormat">
+                                                        <enum>Qt::RichText</enum>
+                                                    </property>
+                                                </widget>
+                                            </item>
+                                        </layout>
                                     </widget>
                                 </item>
 
                                 <!-- Zoom factor. -->
-                                <item row="9" column="0">
-                                    <widget class="QLabel">
-                                        <property name="text">
-                                            <string>Zoom factor</string>
-                                        </property>
-
-                                        <property name="toolTip">
-                                            <string>Valid values for the zoom factor are between 0.25 and 5.00.</string>
+                                <item>
+                                    <widget class="QWidget" name="zoomFactorWidget">
+                                        <property name="autoFillBackground">
+                                            <bool>true</bool>
                                         </property>
-                                    </widget>
-                                </item>
 
-                                <item row="9" column="1">
-                                    <widget class="QComboBox" name="zoomFactorComboBox">
-                                        <item>
-                                            <property name="text">
-                                                <string>System default</string>
+                                        <layout class="QFormLayout">
+                                            <property name="leftMargin">
+                                                <number>10</number>
                                             </property>
-                                        </item>
-
-                                        <item>
-                                            <property name="text">
-                                                <string>Custom</string>
+                                            <property name="topMargin">
+                                                <number>10</number>
+                                            </property>
+                                            <property name="rightMargin">
+                                                <number>10</number>
+                                            </property>
+                                            <property name="bottomMargin">
+                                                <number>10</number>
                                             </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>
+                                            <item row="0" column="0">
+                                                <widget class="QLabel">
+                                                    <property name="text">
+                                                        <string>Zoom factor</string>
+                                                    </property>
+
+                                                    <property name="toolTip">
+                                                        <string>Valid values for the zoom factor are between 0.25 and 5.00.</string>
+                                                    </property>
+                                                </widget>
+                                            </item>
+
+                                            <item row="0" 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="1" 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>
                             </layout>
index 375f4d5201e35c5091d868c92b8a7bcec7c5117e..ad6a5a0cfce0724c6778f0e1f508ef2b43018b63 100644 (file)
                         </size>
                     </property>
 
-                    <property name="documentMode">
-                        <bool>true</bool>
-                    </property>
-
                     <property name="tabsClosable">
                         <bool>true</bool>
                     </property>
index 3b0ce087949de5f5b3de0bd38ded94451facc743..59e424331fd78643d2ae7927a56c87239ee300ff 100644 (file)
@@ -449,9 +449,9 @@ void TabWidget::applyDomainSettings(const QString &hostname, const bool reloadWe
         currentWebEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScriptEnabled());
 
         // Set the local storage status.
-        //currentPrivacyWebEngineViewPointer->localStorageEnabled = Settings::localStorageEnabled();
+        currentPrivacyWebEngineViewPointer->localStorageEnabled = Settings::localStorageEnabled();
 
-        // Set DOM storage.
+        // Set DOM storage.  In QWebEngineSettings it is called Local Storage.
         currentWebEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, Settings::domStorageEnabled());
 
         // Set the user agent.
index 8d2417179119626908faa1576bb8df5bd41643fd..acf72db504019702db450969a89e17523b0a0681 100644 (file)
@@ -175,7 +175,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")));
-    domStorageActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("view-web-browser-dom-tree")));
+    domStorageActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("code-class")));
 
     // Update the on-the-fly menus.
     connect(tabWidgetPointer, SIGNAL(updateUserAgentActions(QString, bool)), this, SLOT(updateUserAgentActions(QString, bool)));