Set the initial right sidebar widget to be the help viewer. eric7

Mon, 03 Apr 2023 12:11:56 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 03 Apr 2023 12:11:56 +0200
branch
eric7
changeset 9966
27f2437e6eea
parent 9964
a298db96ba65
child 9969
a9cbdb9d7073

Set the initial right sidebar widget to be the help viewer.

src/eric7/APIs/Python3/eric7.api file | annotate | diff | comparison | revisions
src/eric7/Documentation/Help/source.qch file | annotate | diff | comparison | revisions
src/eric7/Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
src/eric7/Documentation/Source/eric7.UI.CodeDocumentationViewer.html file | annotate | diff | comparison | revisions
src/eric7/UI/CodeDocumentationViewer.py file | annotate | diff | comparison | revisions
src/eric7/UI/UserInterface.py file | annotate | diff | comparison | revisions
--- a/src/eric7/APIs/Python3/eric7.api	Mon Apr 03 11:36:16 2023 +0200
+++ b/src/eric7/APIs/Python3/eric7.api	Mon Apr 03 12:11:56 2023 +0200
@@ -10369,6 +10369,7 @@
 eric7.UI.CodeDocumentationViewer.CodeDocumentationViewer.documentationReady?4(documentationInfo, isWarning=False, isDocWarning=False)
 eric7.UI.CodeDocumentationViewer.CodeDocumentationViewer.finalizeSetup?4()
 eric7.UI.CodeDocumentationViewer.CodeDocumentationViewer.getProviders?4()
+eric7.UI.CodeDocumentationViewer.CodeDocumentationViewer.isEnabled?4()
 eric7.UI.CodeDocumentationViewer.CodeDocumentationViewer.isSupportedLanguage?4(language)
 eric7.UI.CodeDocumentationViewer.CodeDocumentationViewer.on_providerComboBox_currentIndexChanged?4(index)
 eric7.UI.CodeDocumentationViewer.CodeDocumentationViewer.preferencesChanged?4()
Binary file src/eric7/Documentation/Help/source.qch has changed
--- a/src/eric7/Documentation/Help/source.qhp	Mon Apr 03 11:36:16 2023 +0200
+++ b/src/eric7/Documentation/Help/source.qhp	Mon Apr 03 12:11:56 2023 +0200
@@ -3023,6 +3023,7 @@
       <keyword name="CodeDocumentationViewer.documentationReady" id="CodeDocumentationViewer.documentationReady" ref="eric7.UI.CodeDocumentationViewer.html#CodeDocumentationViewer.documentationReady" />
       <keyword name="CodeDocumentationViewer.finalizeSetup" id="CodeDocumentationViewer.finalizeSetup" ref="eric7.UI.CodeDocumentationViewer.html#CodeDocumentationViewer.finalizeSetup" />
       <keyword name="CodeDocumentationViewer.getProviders" id="CodeDocumentationViewer.getProviders" ref="eric7.UI.CodeDocumentationViewer.html#CodeDocumentationViewer.getProviders" />
+      <keyword name="CodeDocumentationViewer.isEnabled" id="CodeDocumentationViewer.isEnabled" ref="eric7.UI.CodeDocumentationViewer.html#CodeDocumentationViewer.isEnabled" />
       <keyword name="CodeDocumentationViewer.isSupportedLanguage" id="CodeDocumentationViewer.isSupportedLanguage" ref="eric7.UI.CodeDocumentationViewer.html#CodeDocumentationViewer.isSupportedLanguage" />
       <keyword name="CodeDocumentationViewer.on_providerComboBox_currentIndexChanged" id="CodeDocumentationViewer.on_providerComboBox_currentIndexChanged" ref="eric7.UI.CodeDocumentationViewer.html#CodeDocumentationViewer.on_providerComboBox_currentIndexChanged" />
       <keyword name="CodeDocumentationViewer.preferencesChanged" id="CodeDocumentationViewer.preferencesChanged" ref="eric7.UI.CodeDocumentationViewer.html#CodeDocumentationViewer.preferencesChanged" />
--- a/src/eric7/Documentation/Source/eric7.UI.CodeDocumentationViewer.html	Mon Apr 03 11:36:16 2023 +0200
+++ b/src/eric7/Documentation/Source/eric7.UI.CodeDocumentationViewer.html	Mon Apr 03 12:11:56 2023 +0200
@@ -106,6 +106,10 @@
 <td>Public method to get a list of providers and their visible strings.</td>
 </tr>
 <tr>
+<td><a href="#CodeDocumentationViewer.isEnabled">isEnabled</a></td>
+<td>Public method to check, if the code documentation viewer is enabled.</td>
+</tr>
+<tr>
 <td><a href="#CodeDocumentationViewer.isSupportedLanguage">isSupportedLanguage</a></td>
 <td>Public method to check, if the given language is supported by the selected provider.</td>
 </tr>
@@ -249,6 +253,25 @@
 list of tuple of (str,str)
 </dd>
 </dl>
+<a NAME="CodeDocumentationViewer.isEnabled" ID="CodeDocumentationViewer.isEnabled"></a>
+<h4>CodeDocumentationViewer.isEnabled</h4>
+<b>isEnabled</b>(<i></i>)
+
+<p>
+        Public method to check, if the code documentation viewer is enabled.
+</p>
+<dl>
+<dt>Return:</dt>
+<dd>
+flag indicating the enabled state
+</dd>
+</dl>
+<dl>
+<dt>Return Type:</dt>
+<dd>
+bool
+</dd>
+</dl>
 <a NAME="CodeDocumentationViewer.isSupportedLanguage" ID="CodeDocumentationViewer.isSupportedLanguage"></a>
 <h4>CodeDocumentationViewer.isSupportedLanguage</h4>
 <b>isSupportedLanguage</b>(<i>language</i>)
--- a/src/eric7/UI/CodeDocumentationViewer.py	Mon Apr 03 11:36:16 2023 +0200
+++ b/src/eric7/UI/CodeDocumentationViewer.py	Mon Apr 03 12:11:56 2023 +0200
@@ -496,3 +496,13 @@
             if index < 0:
                 index = 0
             self.providerComboBox.setCurrentIndex(index)
+
+    def isEnabled(self):
+        """
+        Public method to check, if the code documentation viewer is enabled.
+
+        @return flag indicating the enabled state
+        @rtype bool
+        """
+        provider = self.providerComboBox.currentData()
+        return provider != self.__disabledProvider
--- a/src/eric7/UI/UserInterface.py	Mon Apr 03 11:36:16 2023 +0200
+++ b/src/eric7/UI/UserInterface.py	Mon Apr 03 12:11:56 2023 +0200
@@ -1445,7 +1445,10 @@
 
         self.leftSidebar.setCurrentIndex(0)
         if self.rightSidebar:
-            self.rightSidebar.setCurrentIndex(0)
+            if self.__helpViewerWidget is not None:
+                self.rightSidebar.setCurrentWidget(self.__helpViewerWidget)
+            else:
+                self.rightSidebar.setCurrentIndex(0)
         self.bottomSidebar.setCurrentIndex(0)
 
         # create the central widget
@@ -5798,7 +5801,9 @@
         @param switchFocus flag indicating to transfer the input focus
         @type bool
         """
-        if self.codeDocumentationViewer is not None:
+        if self.codeDocumentationViewer is not None and (
+            switchFocus or self.codeDocumentationViewer.isEnabled()
+        ):
             if self.__layoutType == "Toolboxes":
                 self.rToolboxDock.show()
                 self.rToolbox.setCurrentWidget(self.codeDocumentationViewer)

eric ide

mercurial