Added a configuration option to not show the internal help viewer. eric7

Sat, 23 Oct 2021 18:58:16 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 23 Oct 2021 18:58:16 +0200
branch
eric7
changeset 8714
85deb98a0a6c
parent 8713
c2a124c2ecbb
child 8716
7bd161e50995

Added a configuration option to not show the internal help viewer.

eric7/Preferences/ConfigurationPages/InterfacePage.py file | annotate | diff | comparison | revisions
eric7/Preferences/ConfigurationPages/InterfacePage.ui file | annotate | diff | comparison | revisions
eric7/Preferences/__init__.py file | annotate | diff | comparison | revisions
eric7/UI/UserInterface.py file | annotate | diff | comparison | revisions
--- a/eric7/Preferences/ConfigurationPages/InterfacePage.py	Sat Oct 23 12:19:47 2021 +0200
+++ b/eric7/Preferences/ConfigurationPages/InterfacePage.py	Sat Oct 23 18:58:16 2021 +0200
@@ -90,16 +90,18 @@
         # right side
         self.codeDocumentationViewerCheckBox.setChecked(
             Preferences.getUI("ShowCodeDocumentationViewer"))
-        self.microPythonCheckBox.setChecked(
-            Preferences.getUI("ShowMicroPython"))
+        self.helpViewerCheckBox.setChecked(
+            Preferences.getUI("ShowInternalHelpViewer"))
+        self.condaCheckBox.setChecked(
+            Preferences.getUI("ShowCondaPackageManager"))
         self.pypiCheckBox.setChecked(
             Preferences.getUI("ShowPyPIPackageManager"))
-        self.condaCheckBox.setChecked(
-            Preferences.getUI("ShowCondaPackageManager"))
         self.cooperationCheckBox.setChecked(
             Preferences.getUI("ShowCooperation"))
         self.ircCheckBox.setChecked(
             Preferences.getUI("ShowIrc"))
+        self.microPythonCheckBox.setChecked(
+            Preferences.getUI("ShowMicroPython"))
         # bottom side
         self.numbersCheckBox.setChecked(
             Preferences.getUI("ShowNumbersViewer"))
@@ -188,20 +190,23 @@
             "ShowCodeDocumentationViewer",
             self.codeDocumentationViewerCheckBox.isChecked())
         Preferences.setUI(
-            "ShowMicroPython",
-            self.microPythonCheckBox.isChecked())
+            "ShowInternalHelpViewer",
+            self.helpViewerCheckBox.isChecked())
+        Preferences.setUI(
+            "ShowCondaPackageManager",
+            self.condaCheckBox.isChecked())
         Preferences.setUI(
             "ShowPyPIPackageManager",
             self.pypiCheckBox.isChecked())
         Preferences.setUI(
-            "ShowCondaPackageManager",
-            self.condaCheckBox.isChecked())
-        Preferences.setUI(
             "ShowCooperation",
             self.cooperationCheckBox.isChecked())
         Preferences.setUI(
             "ShowIrc",
             self.ircCheckBox.isChecked())
+        Preferences.setUI(
+            "ShowMicroPython",
+            self.microPythonCheckBox.isChecked())
         # bottom side
         Preferences.setUI(
             "ShowNumbersViewer",
--- a/eric7/Preferences/ConfigurationPages/InterfacePage.ui	Sat Oct 23 12:19:47 2021 +0200
+++ b/eric7/Preferences/ConfigurationPages/InterfacePage.ui	Sat Oct 23 18:58:16 2021 +0200
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>550</width>
-    <height>992</height>
+    <height>1048</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -439,7 +439,27 @@
            </property>
           </widget>
          </item>
+         <item row="0" column="1">
+          <widget class="QCheckBox" name="helpViewerCheckBox">
+           <property name="toolTip">
+            <string>Select to activate the Help Viewer widget</string>
+           </property>
+           <property name="text">
+            <string>Help Viewer</string>
+           </property>
+          </widget>
+         </item>
          <item row="1" column="0">
+          <widget class="QCheckBox" name="condaCheckBox">
+           <property name="toolTip">
+            <string>Select to activate the conda package manager widget</string>
+           </property>
+           <property name="text">
+            <string>Conda Package Manager</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
           <widget class="QCheckBox" name="pypiCheckBox">
            <property name="toolTip">
             <string>Select to activate the PyPI package manager widget</string>
@@ -449,16 +469,6 @@
            </property>
           </widget>
          </item>
-         <item row="1" column="1">
-          <widget class="QCheckBox" name="condaCheckBox">
-           <property name="toolTip">
-            <string>Select to activate the conda package manager widget</string>
-           </property>
-           <property name="text">
-            <string>Conda Package Manager</string>
-           </property>
-          </widget>
-         </item>
          <item row="2" column="0">
           <widget class="QCheckBox" name="cooperationCheckBox">
            <property name="toolTip">
@@ -479,7 +489,7 @@
            </property>
           </widget>
          </item>
-         <item row="0" column="1">
+         <item row="3" column="0">
           <widget class="QCheckBox" name="microPythonCheckBox">
            <property name="toolTip">
             <string>Select to activate the MicroPython widget</string>
@@ -515,11 +525,41 @@
     </widget>
    </item>
    <item>
-    <widget class="QPushButton" name="resetLayoutButton">
-     <property name="text">
-      <string>Reset layout to factory defaults</string>
-     </property>
-    </widget>
+    <layout class="QHBoxLayout" name="horizontalLayout_3">
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="resetLayoutButton">
+       <property name="text">
+        <string>Reset layout to factory defaults</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_3">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
    </item>
    <item>
     <spacer name="verticalSpacer">
@@ -563,11 +603,12 @@
   <tabstop>fileBrowserCheckBox</tabstop>
   <tabstop>symbolsCheckBox</tabstop>
   <tabstop>codeDocumentationViewerCheckBox</tabstop>
-  <tabstop>microPythonCheckBox</tabstop>
+  <tabstop>helpViewerCheckBox</tabstop>
+  <tabstop>condaCheckBox</tabstop>
   <tabstop>pypiCheckBox</tabstop>
-  <tabstop>condaCheckBox</tabstop>
   <tabstop>cooperationCheckBox</tabstop>
   <tabstop>ircCheckBox</tabstop>
+  <tabstop>microPythonCheckBox</tabstop>
   <tabstop>numbersCheckBox</tabstop>
   <tabstop>resetLayoutButton</tabstop>
  </tabstops>
--- a/eric7/Preferences/__init__.py	Sat Oct 23 12:19:47 2021 +0200
+++ b/eric7/Preferences/__init__.py	Sat Oct 23 18:58:16 2021 +0200
@@ -147,6 +147,7 @@
         "ShowCooperation": True,                # right side
         "ShowIrc": True,                        # right side
         "ShowMicroPython": True,                # right side
+        "ShowInternalHelpViewer": True,         # right side
         "ShowNumbersViewer": True,              # bottom side
         "ViewProfiles": {
             "edit": [
--- a/eric7/UI/UserInterface.py	Sat Oct 23 12:19:47 2021 +0200
+++ b/eric7/UI/UserInterface.py	Sat Oct 23 18:58:16 2021 +0200
@@ -975,9 +975,17 @@
         self.__vcsStatusWidget = StatusWidget(
             self.project, self.viewmanager, self)
         
-        # Create the embedded help viewer
-        from HelpViewer.HelpViewerWidget import HelpViewerWidget
-        self.__helpViewerWidget = HelpViewerWidget(self)
+        if (
+            Preferences.getUI("ShowInternalHelpViewer") or
+            Preferences.getHelp("HelpViewerType") == 0
+        ):
+            # Create the embedded help viewer
+            logging.debug("Creating Internal Help Viewer...")
+            from HelpViewer.HelpViewerWidget import HelpViewerWidget
+            self.__helpViewerWidget = HelpViewerWidget(self)
+        else:
+            logging.debug("Internal Help Viewer disabled...")
+            self.__helpViewerWidget = None
     
     def __createLayout(self):
         """
@@ -1110,9 +1118,10 @@
                                   UI.PixmapCache.getIcon("codeDocuViewer"),
                                   self.tr("Code Documentation Viewer"))
         
-        self.rToolbox.addItem(self.__helpViewerWidget,
-                              UI.PixmapCache.getIcon("help"),
-                              self.tr("Help Viewer"))
+        if self.__helpViewerWidget:
+            self.rToolbox.addItem(self.__helpViewerWidget,
+                                  UI.PixmapCache.getIcon("help"),
+                                  self.tr("Help Viewer"))
         
         self.rToolbox.addItem(self.pluginRepositoryViewer,
                               UI.PixmapCache.getIcon("pluginRepository"),
@@ -1272,10 +1281,11 @@
                 UI.PixmapCache.getIcon("sbCodeDocuViewer96"),
                 self.tr("Code Documentation Viewer"))
         
-        self.rightSidebar.addTab(
-            self.__helpViewerWidget,
-            UI.PixmapCache.getIcon("sbHelpViewer96"),
-            self.tr("Help Viewer"))
+        if self.__helpViewerWidget:
+            self.rightSidebar.addTab(
+                self.__helpViewerWidget,
+                UI.PixmapCache.getIcon("sbHelpViewer96"),
+                self.tr("Help Viewer"))
         
         self.rightSidebar.addTab(
             self.pluginRepositoryViewer,
@@ -7048,29 +7058,30 @@
         @param urlStr URL to be shown
         @type str
         """
-        if self.__layoutType == "Toolboxes":
-            self.rToolboxDock.show()
-            self.rToolbox.setCurrentWidget(self.__helpViewerWidget)
-        elif self.__layoutType == "Sidebars":
-            self.rightSidebar.show()
-            self.rightSidebar.setCurrentWidget(self.__helpViewerWidget)
-        self.__helpViewerWidget.setFocus(
-            Qt.FocusReason.ActiveWindowFocusReason)
-        
-        url = None
-        searchWord = None
-        
-        if urlStr:
-            url = QUrl(urlStr)
-            if not url.isValid():
-                url = None
-        
-        if url is None:
-            searchWord = self.viewmanager.textForFind(False)
-            if searchWord == "":
-                searchWord = None
-        
-        self.__helpViewerWidget.activate(searchWord=searchWord, url=url)
+        if self.__helpViewerWidget is not None:
+            if self.__layoutType == "Toolboxes":
+                self.rToolboxDock.show()
+                self.rToolbox.setCurrentWidget(self.__helpViewerWidget)
+            elif self.__layoutType == "Sidebars":
+                self.rightSidebar.show()
+                self.rightSidebar.setCurrentWidget(self.__helpViewerWidget)
+            self.__helpViewerWidget.setFocus(
+                Qt.FocusReason.ActiveWindowFocusReason)
+            
+            url = None
+            searchWord = None
+            
+            if urlStr:
+                url = QUrl(urlStr)
+                if not url.isValid():
+                    url = None
+            
+            if url is None:
+                searchWord = self.viewmanager.textForFind(False)
+                if searchWord == "":
+                    searchWord = None
+            
+            self.__helpViewerWidget.activate(searchWord=searchWord, url=url)
     
     ##########################################################
     ## Below are slots to handle StdOut and StdErr

eric ide

mercurial