Renamed the generic interface configuration page. eric7

Wed, 29 Dec 2021 16:53:04 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 29 Dec 2021 16:53:04 +0100
branch
eric7
changeset 8876
2001accf55b3
parent 8875
67c3ea933787
child 8877
548d45c3f571

Renamed the generic interface configuration page.

eric7.epj file | annotate | diff | comparison | revisions
eric7/Documentation/Source/eric7.Preferences.ConfigurationPages.InterfaceLightPage.html file | annotate | diff | comparison | revisions
eric7/Documentation/Source/eric7.Preferences.ConfigurationPages.WebBrowserInterfacePage.html file | annotate | diff | comparison | revisions
eric7/Preferences/ConfigurationDialog.py file | annotate | diff | comparison | revisions
eric7/Preferences/ConfigurationPages/InterfaceLightPage.py file | annotate | diff | comparison | revisions
eric7/Preferences/ConfigurationPages/InterfaceLightPage.ui file | annotate | diff | comparison | revisions
eric7/Preferences/ConfigurationPages/WebBrowserInterfacePage.py file | annotate | diff | comparison | revisions
eric7/Preferences/ConfigurationPages/WebBrowserInterfacePage.ui file | annotate | diff | comparison | revisions
--- a/eric7.epj	Wed Dec 29 16:38:32 2021 +0100
+++ b/eric7.epj	Wed Dec 29 16:53:04 2021 +0100
@@ -561,7 +561,6 @@
       "eric7/Preferences/ConfigurationPages/VcsPage.ui",
       "eric7/Preferences/ConfigurationPages/ViewmanagerPage.ui",
       "eric7/Preferences/ConfigurationPages/WebBrowserAppearancePage.ui",
-      "eric7/Preferences/ConfigurationPages/WebBrowserInterfacePage.ui",
       "eric7/Preferences/ConfigurationPages/WebBrowserPage.ui",
       "eric7/Preferences/ConfigurationPages/WebBrowserSpellCheckingPage.ui",
       "eric7/Preferences/ConfigurationPages/WebBrowserVirusTotalPage.ui",
@@ -715,7 +714,8 @@
       "eric7/UI/FindFileWidget.ui",
       "eric7/UI/FindLocationWidget.ui",
       "eric7/JediInterface/RefactoringPreviewDialog.ui",
-      "eric7/QScintilla/EditorOutlineSizesDialog.ui"
+      "eric7/QScintilla/EditorOutlineSizesDialog.ui",
+      "eric7/Preferences/ConfigurationPages/InterfaceLightPage.ui"
     ],
     "HASH": "df7daa8781250f7664e6ecaeaf1361fa2efd39ee",
     "IDLPARAMS": {
@@ -1614,7 +1614,6 @@
       "eric7/Preferences/ConfigurationPages/VcsPage.py",
       "eric7/Preferences/ConfigurationPages/ViewmanagerPage.py",
       "eric7/Preferences/ConfigurationPages/WebBrowserAppearancePage.py",
-      "eric7/Preferences/ConfigurationPages/WebBrowserInterfacePage.py",
       "eric7/Preferences/ConfigurationPages/WebBrowserPage.py",
       "eric7/Preferences/ConfigurationPages/WebBrowserSpellCheckingPage.py",
       "eric7/Preferences/ConfigurationPages/WebBrowserVirusTotalPage.py",
@@ -2305,7 +2304,8 @@
       "eric7/Plugins/CheckerPlugins/CodeStyleChecker/Imports/LocalImportVisitor.py",
       "eric7/Plugins/CheckerPlugins/CodeStyleChecker/Imports/ImportsEnums.py",
       "eric7/Plugins/CheckerPlugins/CodeStyleChecker/Imports/ImportNode.py",
-      "eric7/Preferences/ThemeManager.py"
+      "eric7/Preferences/ThemeManager.py",
+      "eric7/Preferences/ConfigurationPages/InterfaceLightPage.py"
     ],
     "SPELLEXCLUDES": "Dictionaries/excludes.dic",
     "SPELLLANGUAGE": "en_US",
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric7/Documentation/Source/eric7.Preferences.ConfigurationPages.InterfaceLightPage.html	Wed Dec 29 16:53:04 2021 +0100
@@ -0,0 +1,127 @@
+<!DOCTYPE html>
+<html><head>
+<title>eric7.Preferences.ConfigurationPages.WebBrowserInterfacePage</title>
+<meta charset="UTF-8">
+<link rel="stylesheet" href="styles.css">
+</head>
+<body>
+<a NAME="top" ID="top"></a>
+<h1>eric7.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>Return:</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/eric7/Documentation/Source/eric7.Preferences.ConfigurationPages.WebBrowserInterfacePage.html	Wed Dec 29 16:38:32 2021 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-<!DOCTYPE html>
-<html><head>
-<title>eric7.Preferences.ConfigurationPages.WebBrowserInterfacePage</title>
-<meta charset="UTF-8">
-<link rel="stylesheet" href="styles.css">
-</head>
-<body>
-<a NAME="top" ID="top"></a>
-<h1>eric7.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>Return:</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/eric7/Preferences/ConfigurationDialog.py	Wed Dec 29 16:38:32 2021 +0100
+++ b/eric7/Preferences/ConfigurationDialog.py	Wed Dec 29 16:53:04 2021 +0100
@@ -380,6 +380,8 @@
             self.configItems.update(
                 ericApp().getObject("PluginManager").getPluginConfigData())
         
+        # TODO: add mode for Mini Editor (?)
+        
         elif displayMode == ConfigurationMode.WEBBROWSERMODE:
             self.configItems = {
                 # key : [display string, pixmap name, dialog module name or
@@ -390,7 +392,7 @@
                 # 'save' to save the settings.
                 "interfacePage":
                 [self.tr("Interface"), "preferences-interface",
-                 "WebBrowserInterfacePage", None, None],
+                 "InterfaceLightPage", None, None],
                 "networkPage":
                 [self.tr("Network"), "preferences-network",
                  "NetworkPage", None, None],
@@ -446,14 +448,12 @@
                 # 'save' to save the settings.
                 "interfacePage":
                 [self.tr("Interface"), "preferences-interface",
-                 "WebBrowserInterfacePage", None, None],
+                 "InterfaceLightPage", None, None],
                 "hexEditorPage":
                 [self.tr("Hex Editor"), "hexEditor",
                  "HexEditorPage", None, None],
             }
         
-        # TODO: add mode for Mini Editor
-        
         else:
             # display mode for generic use
             self.configItems = {
@@ -465,7 +465,7 @@
                 # 'save' to save the settings.
                 "interfacePage":
                 [self.tr("Interface"), "preferences-interface",
-                 "WebBrowserInterfacePage", None, None],
+                 "InterfaceLightPage", None, None],
             }
         
         # generate the list entries
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric7/Preferences/ConfigurationPages/InterfaceLightPage.py	Wed Dec 29 16:53:04 2021 +0100
@@ -0,0 +1,149 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2006 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing the Interface configuration page (variant for web browser).
+"""
+
+import glob
+import os
+
+from PyQt6.QtCore import QTranslator
+from PyQt6.QtWidgets import QStyleFactory
+
+from EricWidgets.EricPathPicker import EricPathPickerModes
+from EricWidgets.EricApplication import ericApp
+
+from .ConfigurationPageBase import ConfigurationPageBase
+from .Ui_InterfaceLightPage import Ui_InterfaceLightPage
+
+import Preferences
+import Utilities
+
+from eric7config import getConfig
+
+
+class InterfaceLightPage(ConfigurationPageBase, Ui_InterfaceLightPage):
+    """
+    Class implementing the Interface configuration page (variant for generic
+    use).
+    """
+    def __init__(self):
+        """
+        Constructor
+        """
+        super().__init__()
+        self.setupUi(self)
+        self.setObjectName("InterfacePage")
+        
+        self.styleSheetPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE)
+        self.styleSheetPicker.setFilters(self.tr(
+            "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;"
+            "All files (*)"))
+        self.styleSheetPicker.setDefaultDirectory(getConfig("ericStylesDir"))
+        
+        styleIconsPath = ericApp().getStyleIconsPath()
+        self.styleIconsPathPicker.setMode(
+            EricPathPickerModes.DIRECTORY_SHOW_FILES_MODE)
+        self.styleIconsPathPicker.setDefaultDirectory(styleIconsPath)
+        
+        # set initial values
+        self.__populateStyleCombo()
+        self.__populateLanguageCombo()
+        
+        self.styleSheetPicker.setText(Preferences.getUI("StyleSheet"))
+        self.styleIconsPathPicker.setText(Preferences.getUI("StyleIconsPath"))
+    
+    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())
+        Preferences.setUI(
+            "StyleIconsPath",
+            self.styleIconsPathPicker.text())
+        
+        # save the language settings
+        uiLanguageIndex = self.languageComboBox.currentIndex()
+        uiLanguage = (
+            self.languageComboBox.itemData(uiLanguageIndex)
+            if uiLanguageIndex else
+            None
+        )
+        Preferences.setUILanguage(uiLanguage)
+    
+    def __populateStyleCombo(self):
+        """
+        Private method to populate the style combo box.
+        """
+        curStyle = Preferences.getUI("Style")
+        styles = sorted(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 __populateLanguageCombo(self):
+        """
+        Private method to initialize the language combo box.
+        """
+        self.languageComboBox.clear()
+        
+        fnlist = (
+            glob.glob("eric7_*.qm") +
+            glob.glob(os.path.join(
+                getConfig('ericTranslationsDir'), "eric7_*.qm")) +
+            glob.glob(os.path.join(Utilities.getConfigDir(), "eric7_*.qm"))
+        )
+        locales = {}
+        for fn in fnlist:
+            locale = os.path.basename(fn)[6:-3]
+            if locale not in locales:
+                translator = QTranslator()
+                translator.load(fn)
+                locales[locale] = (
+                    translator.translate(
+                        "InterfacePage", "English",
+                        "Translate this with your language") +
+                    " ({0})".format(locale)
+                )
+        localeList = sorted(locales.keys())
+        try:
+            uiLanguage = Preferences.getUILanguage()
+            if uiLanguage == "None" or uiLanguage is None:
+                currentIndex = 0
+            elif uiLanguage == "System":
+                currentIndex = 1
+            else:
+                currentIndex = localeList.index(uiLanguage) + 2
+        except ValueError:
+            currentIndex = 0
+        self.languageComboBox.clear()
+        
+        self.languageComboBox.addItem("English (default)", "None")
+        self.languageComboBox.addItem(self.tr('System'), "System")
+        for locale in localeList:
+            self.languageComboBox.addItem(locales[locale], locale)
+        self.languageComboBox.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 = InterfaceLightPage()
+    return page
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eric7/Preferences/ConfigurationPages/InterfaceLightPage.ui	Wed Dec 29 16:53:04 2021 +0100
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>InterfaceLightPage</class>
+ <widget class="QWidget" name="InterfaceLightPage">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>555</width>
+    <height>365</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="EricPathPicker" 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>
+     <item row="2" column="0">
+      <widget class="QLabel" name="label_6">
+       <property name="text">
+        <string>Style Icons Path:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1">
+      <widget class="EricPathPicker" name="styleIconsPathPicker" 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 to the icons used within the style sheet (empty for default)</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="Line" name="line9_2">
+     <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>
+    <widget class="QLabel" name="TextLabel1_2_2_2">
+     <property name="text">
+      <string>&lt;font color=&quot;#FF0000&quot;&gt;&lt;b&gt;Note:&lt;/b&gt; All settings below are activated at the next startup of the application.&lt;/font&gt;</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QLabel" name="languageLabel">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="text">
+        <string>Language:</string>
+       </property>
+       <property name="buddy">
+        <cstring>languageComboBox</cstring>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QComboBox" name="languageComboBox">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="toolTip">
+        <string>Select the interface language.</string>
+       </property>
+       <property name="whatsThis">
+        <string>The interface language can be selected from this list. If &quot;system&quot; is selected, the interface language is determined by the system. The selection of &quot;none&quot; means, that the default language will be used.</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>EricPathPicker</class>
+   <extends>QWidget</extends>
+   <header>EricWidgets/EricPathPicker.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <tabstops>
+  <tabstop>styleComboBox</tabstop>
+  <tabstop>styleSheetPicker</tabstop>
+  <tabstop>styleIconsPathPicker</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
--- a/eric7/Preferences/ConfigurationPages/WebBrowserInterfacePage.py	Wed Dec 29 16:38:32 2021 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Copyright (c) 2006 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
-#
-
-"""
-Module implementing the Interface configuration page (variant for web browser).
-"""
-
-import glob
-import os
-
-from PyQt6.QtCore import QTranslator
-from PyQt6.QtWidgets import QStyleFactory
-
-from EricWidgets.EricPathPicker import EricPathPickerModes
-from EricWidgets.EricApplication import ericApp
-
-from .ConfigurationPageBase import ConfigurationPageBase
-from .Ui_WebBrowserInterfacePage import Ui_WebBrowserInterfacePage
-
-import Preferences
-import Utilities
-
-from eric7config import getConfig
-
-
-class WebBrowserInterfacePage(ConfigurationPageBase,
-                              Ui_WebBrowserInterfacePage):
-    """
-    Class implementing the Interface configuration page (variant for web
-    browser).
-    """
-    def __init__(self):
-        """
-        Constructor
-        """
-        super().__init__()
-        self.setupUi(self)
-        self.setObjectName("InterfacePage")
-        
-        self.styleSheetPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE)
-        self.styleSheetPicker.setFilters(self.tr(
-            "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;"
-            "All files (*)"))
-        self.styleSheetPicker.setDefaultDirectory(getConfig("ericStylesDir"))
-        
-        styleIconsPath = ericApp().getStyleIconsPath()
-        self.styleIconsPathPicker.setMode(
-            EricPathPickerModes.DIRECTORY_SHOW_FILES_MODE)
-        self.styleIconsPathPicker.setDefaultDirectory(styleIconsPath)
-        
-        # set initial values
-        self.__populateStyleCombo()
-        self.__populateLanguageCombo()
-        
-        self.styleSheetPicker.setText(Preferences.getUI("StyleSheet"))
-        self.styleIconsPathPicker.setText(Preferences.getUI("StyleIconsPath"))
-    
-    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())
-        Preferences.setUI(
-            "StyleIconsPath",
-            self.styleIconsPathPicker.text())
-        
-        # save the language settings
-        uiLanguageIndex = self.languageComboBox.currentIndex()
-        uiLanguage = (
-            self.languageComboBox.itemData(uiLanguageIndex)
-            if uiLanguageIndex else
-            None
-        )
-        Preferences.setUILanguage(uiLanguage)
-    
-    def __populateStyleCombo(self):
-        """
-        Private method to populate the style combo box.
-        """
-        curStyle = Preferences.getUI("Style")
-        styles = sorted(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 __populateLanguageCombo(self):
-        """
-        Private method to initialize the language combo box.
-        """
-        self.languageComboBox.clear()
-        
-        fnlist = (
-            glob.glob("eric7_*.qm") +
-            glob.glob(os.path.join(
-                getConfig('ericTranslationsDir'), "eric7_*.qm")) +
-            glob.glob(os.path.join(Utilities.getConfigDir(), "eric7_*.qm"))
-        )
-        locales = {}
-        for fn in fnlist:
-            locale = os.path.basename(fn)[6:-3]
-            if locale not in locales:
-                translator = QTranslator()
-                translator.load(fn)
-                locales[locale] = (
-                    translator.translate(
-                        "InterfacePage", "English",
-                        "Translate this with your language") +
-                    " ({0})".format(locale)
-                )
-        localeList = sorted(locales.keys())
-        try:
-            uiLanguage = Preferences.getUILanguage()
-            if uiLanguage == "None" or uiLanguage is None:
-                currentIndex = 0
-            elif uiLanguage == "System":
-                currentIndex = 1
-            else:
-                currentIndex = localeList.index(uiLanguage) + 2
-        except ValueError:
-            currentIndex = 0
-        self.languageComboBox.clear()
-        
-        self.languageComboBox.addItem("English (default)", "None")
-        self.languageComboBox.addItem(self.tr('System'), "System")
-        for locale in localeList:
-            self.languageComboBox.addItem(locales[locale], locale)
-        self.languageComboBox.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
--- a/eric7/Preferences/ConfigurationPages/WebBrowserInterfacePage.ui	Wed Dec 29 16:38:32 2021 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-<?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>555</width>
-    <height>365</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="EricPathPicker" 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>
-     <item row="2" column="0">
-      <widget class="QLabel" name="label_6">
-       <property name="text">
-        <string>Style Icons Path:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="1">
-      <widget class="EricPathPicker" name="styleIconsPathPicker" 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 to the icons used within the style sheet (empty for default)</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="Line" name="line9_2">
-     <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>
-    <widget class="QLabel" name="TextLabel1_2_2_2">
-     <property name="text">
-      <string>&lt;font color=&quot;#FF0000&quot;&gt;&lt;b&gt;Note:&lt;/b&gt; All settings below are activated at the next startup of the application.&lt;/font&gt;</string>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <widget class="QLabel" name="languageLabel">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string>Language:</string>
-       </property>
-       <property name="buddy">
-        <cstring>languageComboBox</cstring>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QComboBox" name="languageComboBox">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="toolTip">
-        <string>Select the interface language.</string>
-       </property>
-       <property name="whatsThis">
-        <string>The interface language can be selected from this list. If &quot;system&quot; is selected, the interface language is determined by the system. The selection of &quot;none&quot; means, that the default language will be used.</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>EricPathPicker</class>
-   <extends>QWidget</extends>
-   <header>EricWidgets/EricPathPicker.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <tabstops>
-  <tabstop>styleComboBox</tabstop>
-  <tabstop>styleSheetPicker</tabstop>
-  <tabstop>styleIconsPathPicker</tabstop>
- </tabstops>
- <resources/>
- <connections/>
-</ui>

eric ide

mercurial