WebBrowserInterfacePage: added the missing interface configuration page for the web browser (part 2).

Sat, 29 Feb 2020 18:23:39 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 29 Feb 2020 18:23:39 +0100
changeset 7433
386487a96672
parent 7432
f5488e9ab8c6
child 7435
67c98dc48ffc

WebBrowserInterfacePage: added the missing interface configuration page for the web browser (part 2).

eric6/APIs/Python3/eric6.api file | annotate | diff | comparison | revisions
eric6/APIs/Python3/eric6.bas file | annotate | diff | comparison | revisions
eric6/Documentation/Help/source.qch file | annotate | diff | comparison | revisions
eric6/Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
eric6/Documentation/Source/eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.html file | annotate | diff | comparison | revisions
eric6/Documentation/Source/index-eric6.Preferences.ConfigurationPages.html file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/WebBrowserInterfacePage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/WebBrowserInterfacePage.ui file | annotate | diff | comparison | revisions
--- a/eric6/APIs/Python3/eric6.api	Sat Feb 29 18:20:06 2020 +0100
+++ b/eric6/APIs/Python3/eric6.api	Sat Feb 29 18:23:39 2020 +0100
@@ -6360,6 +6360,9 @@
 eric6.Preferences.ConfigurationPages.WebBrowserFlashCookieManagerPage.WebBrowserFlashCookieManagerPage.save?4()
 eric6.Preferences.ConfigurationPages.WebBrowserFlashCookieManagerPage.WebBrowserFlashCookieManagerPage?1()
 eric6.Preferences.ConfigurationPages.WebBrowserFlashCookieManagerPage.create?4(dlg)
+eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.WebBrowserInterfacePage.save?4()
+eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.WebBrowserInterfacePage?1()
+eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.create?4(dlg)
 eric6.Preferences.ConfigurationPages.WebBrowserPage.WebBrowserPage.on_defaultHomeButton_clicked?4()
 eric6.Preferences.ConfigurationPages.WebBrowserPage.WebBrowserPage.on_refererWhitelistButton_clicked?4()
 eric6.Preferences.ConfigurationPages.WebBrowserPage.WebBrowserPage.on_setCurrentPageButton_clicked?4()
--- a/eric6/APIs/Python3/eric6.bas	Sat Feb 29 18:20:06 2020 +0100
+++ b/eric6/APIs/Python3/eric6.bas	Sat Feb 29 18:23:39 2020 +0100
@@ -1001,6 +1001,7 @@
 WebBrowserAppearancePage ConfigurationPageBase Ui_WebBrowserAppearancePage
 WebBrowserClearPrivateDataDialog QDialog Ui_WebBrowserClearPrivateDataDialog
 WebBrowserFlashCookieManagerPage ConfigurationPageBase Ui_WebBrowserFlashCookieManagerPage
+WebBrowserInterfacePage ConfigurationPageBase Ui_WebBrowserInterfacePage
 WebBrowserJavaScriptConsole QTextEdit
 WebBrowserLanguagesDialog QDialog Ui_WebBrowserLanguagesDialog
 WebBrowserPage QWebEnginePage
Binary file eric6/Documentation/Help/source.qch has changed
--- a/eric6/Documentation/Help/source.qhp	Sat Feb 29 18:20:06 2020 +0100
+++ b/eric6/Documentation/Help/source.qhp	Sat Feb 29 18:23:39 2020 +0100
@@ -753,6 +753,7 @@
               <section title="eric6.Preferences.ConfigurationPages.ViewmanagerPage" ref="eric6.Preferences.ConfigurationPages.ViewmanagerPage.html" />
               <section title="eric6.Preferences.ConfigurationPages.WebBrowserAppearancePage" ref="eric6.Preferences.ConfigurationPages.WebBrowserAppearancePage.html" />
               <section title="eric6.Preferences.ConfigurationPages.WebBrowserFlashCookieManagerPage" ref="eric6.Preferences.ConfigurationPages.WebBrowserFlashCookieManagerPage.html" />
+              <section title="eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage" ref="eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.html" />
               <section title="eric6.Preferences.ConfigurationPages.WebBrowserPage" ref="eric6.Preferences.ConfigurationPages.WebBrowserPage.html" />
               <section title="eric6.Preferences.ConfigurationPages.WebBrowserSpellCheckingPage" ref="eric6.Preferences.ConfigurationPages.WebBrowserSpellCheckingPage.html" />
               <section title="eric6.Preferences.ConfigurationPages.WebBrowserVirusTotalPage" ref="eric6.Preferences.ConfigurationPages.WebBrowserVirusTotalPage.html" />
@@ -16156,6 +16157,11 @@
       <keyword name="WebBrowserFlashCookieManagerPage (Constructor)" id="WebBrowserFlashCookieManagerPage (Constructor)" ref="eric6.Preferences.ConfigurationPages.WebBrowserFlashCookieManagerPage.html#WebBrowserFlashCookieManagerPage.__init__" />
       <keyword name="WebBrowserFlashCookieManagerPage (Module)" id="WebBrowserFlashCookieManagerPage (Module)" ref="eric6.Preferences.ConfigurationPages.WebBrowserFlashCookieManagerPage.html" />
       <keyword name="WebBrowserFlashCookieManagerPage.save" id="WebBrowserFlashCookieManagerPage.save" ref="eric6.Preferences.ConfigurationPages.WebBrowserFlashCookieManagerPage.html#WebBrowserFlashCookieManagerPage.save" />
+      <keyword name="WebBrowserInterfacePage" id="WebBrowserInterfacePage" ref="eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.html#WebBrowserInterfacePage" />
+      <keyword name="WebBrowserInterfacePage (Constructor)" id="WebBrowserInterfacePage (Constructor)" ref="eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.html#WebBrowserInterfacePage.__init__" />
+      <keyword name="WebBrowserInterfacePage (Module)" id="WebBrowserInterfacePage (Module)" ref="eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.html" />
+      <keyword name="WebBrowserInterfacePage.__populateStyleCombo" id="WebBrowserInterfacePage.__populateStyleCombo" ref="eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.html#WebBrowserInterfacePage.__populateStyleCombo" />
+      <keyword name="WebBrowserInterfacePage.save" id="WebBrowserInterfacePage.save" ref="eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.html#WebBrowserInterfacePage.save" />
       <keyword name="WebBrowserJavaScriptConsole" id="WebBrowserJavaScriptConsole" ref="eric6.WebBrowser.WebBrowserJavaScriptConsole.html#WebBrowserJavaScriptConsole" />
       <keyword name="WebBrowserJavaScriptConsole (Constructor)" id="WebBrowserJavaScriptConsole (Constructor)" ref="eric6.WebBrowser.WebBrowserJavaScriptConsole.html#WebBrowserJavaScriptConsole.__init__" />
       <keyword name="WebBrowserJavaScriptConsole (Module)" id="WebBrowserJavaScriptConsole (Module)" ref="eric6.WebBrowser.WebBrowserJavaScriptConsole.html" />
@@ -17016,6 +17022,7 @@
       <keyword name="create" id="create" ref="eric6.Preferences.ConfigurationPages.ViewmanagerPage.html#create" />
       <keyword name="create" id="create" ref="eric6.Preferences.ConfigurationPages.WebBrowserAppearancePage.html#create" />
       <keyword name="create" id="create" ref="eric6.Preferences.ConfigurationPages.WebBrowserFlashCookieManagerPage.html#create" />
+      <keyword name="create" id="create" ref="eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.html#create" />
       <keyword name="create" id="create" ref="eric6.Preferences.ConfigurationPages.WebBrowserPage.html#create" />
       <keyword name="create" id="create" ref="eric6.Preferences.ConfigurationPages.WebBrowserSpellCheckingPage.html#create" />
       <keyword name="create" id="create" ref="eric6.Preferences.ConfigurationPages.WebBrowserVirusTotalPage.html#create" />
@@ -18380,6 +18387,7 @@
       <file>eric6.Preferences.ConfigurationPages.ViewmanagerPage.html</file>
       <file>eric6.Preferences.ConfigurationPages.WebBrowserAppearancePage.html</file>
       <file>eric6.Preferences.ConfigurationPages.WebBrowserFlashCookieManagerPage.html</file>
+      <file>eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.html</file>
       <file>eric6.Preferences.ConfigurationPages.WebBrowserPage.html</file>
       <file>eric6.Preferences.ConfigurationPages.WebBrowserSpellCheckingPage.html</file>
       <file>eric6.Preferences.ConfigurationPages.WebBrowserVirusTotalPage.html</file>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric6/Documentation/Source/eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.html	Sat Feb 29 18:23:39 2020 +0100
@@ -0,0 +1,141 @@
+<!DOCTYPE html>
+<html><head>
+<title>eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage</title>
+<meta charset="UTF-8">
+<style>
+body {
+    background: #EDECE6;
+    margin: 0em 1em 10em 1em;
+    color: black;
+}
+
+h1 { color: white; background: #85774A; }
+h2 { color: white; background: #85774A; }
+h3 { color: white; background: #9D936E; }
+h4 { color: white; background: #9D936E; }
+    
+a { color: #BA6D36; }
+
+</style>
+</head>
+<body>
+<a NAME="top" ID="top"></a>
+<h1>eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage</h1>
+
+<p>
+Module implementing the Interface configuration page (variant for web browser).
+</p>
+<h3>Global Attributes</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Classes</h3>
+
+<table>
+
+<tr>
+<td><a href="#WebBrowserInterfacePage">WebBrowserInterfacePage</a></td>
+<td>Class implementing the Interface configuration page (variant for web browser).</td>
+</tr>
+</table>
+<h3>Functions</h3>
+
+<table>
+
+<tr>
+<td><a href="#create">create</a></td>
+<td>Module function to create the configuration page.</td>
+</tr>
+</table>
+<hr />
+<hr />
+<a NAME="WebBrowserInterfacePage" ID="WebBrowserInterfacePage"></a>
+<h2>WebBrowserInterfacePage</h2>
+
+<p>
+    Class implementing the Interface configuration page (variant for web
+    browser).
+</p>
+<h3>Derived from</h3>
+ConfigurationPageBase, Ui_WebBrowserInterfacePage
+<h3>Class Attributes</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Class Methods</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Methods</h3>
+
+<table>
+
+<tr>
+<td><a href="#WebBrowserInterfacePage.__init__">WebBrowserInterfacePage</a></td>
+<td>Constructor</td>
+</tr>
+<tr>
+<td><a href="#WebBrowserInterfacePage.__populateStyleCombo">__populateStyleCombo</a></td>
+<td>Private method to populate the style combo box.</td>
+</tr>
+<tr>
+<td><a href="#WebBrowserInterfacePage.save">save</a></td>
+<td>Public slot to save the Interface configuration.</td>
+</tr>
+</table>
+<h3>Static Methods</h3>
+
+<table>
+<tr><td>None</td></tr>
+</table>
+
+<a NAME="WebBrowserInterfacePage.__init__" ID="WebBrowserInterfacePage.__init__"></a>
+<h4>WebBrowserInterfacePage (Constructor)</h4>
+<b>WebBrowserInterfacePage</b>(<i></i>)
+
+<p>
+        Constructor
+</p>
+<a NAME="WebBrowserInterfacePage.__populateStyleCombo" ID="WebBrowserInterfacePage.__populateStyleCombo"></a>
+<h4>WebBrowserInterfacePage.__populateStyleCombo</h4>
+<b>__populateStyleCombo</b>(<i></i>)
+
+<p>
+        Private method to populate the style combo box.
+</p>
+<a NAME="WebBrowserInterfacePage.save" ID="WebBrowserInterfacePage.save"></a>
+<h4>WebBrowserInterfacePage.save</h4>
+<b>save</b>(<i></i>)
+
+<p>
+        Public slot to save the Interface configuration.
+</p>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+<hr />
+<a NAME="create" ID="create"></a>
+<h2>create</h2>
+<b>create</b>(<i>dlg</i>)
+
+<p>
+    Module function to create the configuration page.
+</p>
+<dl>
+
+<dt><i>dlg</i></dt>
+<dd>
+reference to the configuration dialog
+</dd>
+</dl>
+<dl>
+<dt>Returns:</dt>
+<dd>
+reference to the instantiated page (ConfigurationPageBase)
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+</body></html>
\ No newline at end of file
--- a/eric6/Documentation/Source/index-eric6.Preferences.ConfigurationPages.html	Sat Feb 29 18:20:06 2020 +0100
+++ b/eric6/Documentation/Source/index-eric6.Preferences.ConfigurationPages.html	Sat Feb 29 18:23:39 2020 +0100
@@ -278,6 +278,10 @@
 <td>Module implementing the Flash Cookies Manager configuration page.</td>
 </tr>
 <tr>
+<td><a href="eric6.Preferences.ConfigurationPages.WebBrowserInterfacePage.html">WebBrowserInterfacePage</a></td>
+<td>Module implementing the Interface configuration page (variant for web browser).</td>
+</tr>
+<tr>
 <td><a href="eric6.Preferences.ConfigurationPages.WebBrowserPage.html">WebBrowserPage</a></td>
 <td>Module implementing the  Web Browser configuration page.</td>
 </tr>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric6/Preferences/ConfigurationPages/WebBrowserInterfacePage.py	Sat Feb 29 18:23:39 2020 +0100
@@ -0,0 +1,80 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2006 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing the Interface configuration page (variant for web browser).
+"""
+
+from __future__ import unicode_literals
+
+from PyQt5.QtWidgets import QStyleFactory
+
+from E5Gui.E5PathPicker import E5PathPickerModes
+
+from .ConfigurationPageBase import ConfigurationPageBase
+from .Ui_WebBrowserInterfacePage import Ui_WebBrowserInterfacePage
+
+import Preferences
+
+
+class WebBrowserInterfacePage(ConfigurationPageBase,
+                              Ui_WebBrowserInterfacePage):
+    """
+    Class implementing the Interface configuration page (variant for web
+    browser).
+    """
+    def __init__(self):
+        """
+        Constructor
+        """
+        super(WebBrowserInterfacePage, self).__init__()
+        self.setupUi(self)
+        self.setObjectName("InterfacePage")
+        
+        self.styleSheetPicker.setMode(E5PathPickerModes.OpenFileMode)
+        self.styleSheetPicker.setFilters(self.tr(
+            "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;"
+            "All files (*)"))
+        
+        # set initial values
+        self.__populateStyleCombo()
+        self.styleSheetPicker.setText(Preferences.getUI("StyleSheet"))
+    
+    def save(self):
+        """
+        Public slot to save the Interface configuration.
+        """
+        # save the style settings
+        styleIndex = self.styleComboBox.currentIndex()
+        style = self.styleComboBox.itemData(styleIndex)
+        Preferences.setUI("Style", style)
+        Preferences.setUI(
+            "StyleSheet",
+            self.styleSheetPicker.text())
+    
+    def __populateStyleCombo(self):
+        """
+        Private method to populate the style combo box.
+        """
+        curStyle = Preferences.getUI("Style")
+        styles = sorted(list(QStyleFactory.keys()))
+        self.styleComboBox.addItem(self.tr('System'), "System")
+        for style in styles:
+            self.styleComboBox.addItem(style, style)
+        currentIndex = self.styleComboBox.findData(curStyle)
+        if currentIndex == -1:
+            currentIndex = 0
+        self.styleComboBox.setCurrentIndex(currentIndex)
+    
+
+def create(dlg):
+    """
+    Module function to create the configuration page.
+    
+    @param dlg reference to the configuration dialog
+    @return reference to the instantiated page (ConfigurationPageBase)
+    """
+    page = WebBrowserInterfacePage()
+    return page
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric6/Preferences/ConfigurationPages/WebBrowserInterfacePage.ui	Sat Feb 29 18:23:39 2020 +0100
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WebBrowserInterfacePage</class>
+ <widget class="QWidget" name="WebBrowserInterfacePage">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>557</width>
+    <height>152</height>
+   </rect>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QLabel" name="headerLabel">
+     <property name="text">
+      <string>&lt;b&gt;Configure User Interface&lt;/b&gt;</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="Line" name="line9">
+     <property name="frameShape">
+      <enum>QFrame::HLine</enum>
+     </property>
+     <property name="frameShadow">
+      <enum>QFrame::Sunken</enum>
+     </property>
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="label_2">
+       <property name="text">
+        <string>Style:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QComboBox" name="styleComboBox">
+       <property name="toolTip">
+        <string>Select the interface style</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="label_3">
+       <property name="text">
+        <string>Style Sheet:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="E5PathPicker" name="styleSheetPicker" native="true">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="focusPolicy">
+        <enum>Qt::StrongFocus</enum>
+       </property>
+       <property name="toolTip">
+        <string>Enter the path of the style sheet file</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <spacer>
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>537</width>
+       <height>41</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>E5PathPicker</class>
+   <extends>QWidget</extends>
+   <header>E5Gui/E5PathPicker.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <tabstops>
+  <tabstop>styleComboBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>

eric ide

mercurial