Fixed an issue causing an exception on computers with a small screen or when the `Combined Sidebars` option is selected. eric7

Thu, 01 Aug 2024 11:14:29 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 01 Aug 2024 11:14:29 +0200
branch
eric7
changeset 145
3f8e91170c37
parent 144
48501744f7d0
child 146
37794b4f407d

Fixed an issue causing an exception on computers with a small screen or when the `Combined Sidebars` option is selected.

ChangeLog file | annotate | diff | comparison | revisions
MqttMonitor/ConfigurationPage/MqttPage.py file | annotate | diff | comparison | revisions
MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.MqttMonitor.ConfigurationPage.MqttPage.html file | annotate | diff | comparison | revisions
MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.PluginMqttMonitor.html file | annotate | diff | comparison | revisions
PluginMqttMonitor.epj file | annotate | diff | comparison | revisions
PluginMqttMonitor.py file | annotate | diff | comparison | revisions
PluginMqttMonitor.zip file | annotate | diff | comparison | revisions
--- a/ChangeLog	Fri Apr 19 15:15:28 2024 +0200
+++ b/ChangeLog	Thu Aug 01 11:14:29 2024 +0200
@@ -1,5 +1,10 @@
 ChangeLog
 ---------
+
+Version 11.0.1:
+- Fixed an issue causing an exception on computers with a small screen or when
+  the `Combined Sidebars` option is selected.
+
 Version 11.0.0:
 - modified the plugin for 'paho-mqtt' >=2.0.0
 
--- a/MqttMonitor/ConfigurationPage/MqttPage.py	Fri Apr 19 15:15:28 2024 +0200
+++ b/MqttMonitor/ConfigurationPage/MqttPage.py	Thu Aug 01 11:14:29 2024 +0200
@@ -25,7 +25,7 @@
         Constructor
 
         @param plugin reference to the plugin object
-        @type RefactoringRopePlugin
+        @type MqttMonitorPlugin
         """
         ConfigurationPageBase.__init__(self)
         self.setupUi(self)
@@ -47,7 +47,7 @@
 
     def save(self):
         """
-        Public slot to save the Rope Autocompletion configuration.
+        Public slot to save the MQTT Monitor configuration.
         """
         if self.mqttv31Button.isChecked():
             protocol = MqttProtocols.MQTTv31
--- a/MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.MqttMonitor.ConfigurationPage.MqttPage.html	Fri Apr 19 15:15:28 2024 +0200
+++ b/MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.MqttMonitor.ConfigurationPage.MqttPage.html	Thu Aug 01 11:14:29 2024 +0200
@@ -57,7 +57,7 @@
 </tr>
 <tr>
 <td><a href="#MqttPage.save">save</a></td>
-<td>Public slot to save the Rope Autocompletion configuration.</td>
+<td>Public slot to save the MQTT Monitor configuration.</td>
 </tr>
 </table>
 
@@ -76,7 +76,7 @@
 
 <dl>
 
-<dt><i>plugin</i> (RefactoringRopePlugin)</dt>
+<dt><i>plugin</i> (MqttMonitorPlugin)</dt>
 <dd>
 reference to the plugin object
 </dd>
@@ -85,7 +85,7 @@
 <h4>MqttPage.save</h4>
 <b>save</b>(<i></i>)
 <p>
-        Public slot to save the Rope Autocompletion configuration.
+        Public slot to save the MQTT Monitor configuration.
 </p>
 
 <div align="right"><a href="#top">Up</a></div>
--- a/MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.PluginMqttMonitor.html	Fri Apr 19 15:15:28 2024 +0200
+++ b/MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.PluginMqttMonitor.html	Thu Aug 01 11:14:29 2024 +0200
@@ -88,6 +88,10 @@
 <td>Constructor</td>
 </tr>
 <tr>
+<td><a href="#MqttMonitorPlugin.__activateLeftRightSidebarWidget">__activateLeftRightSidebarWidget</a></td>
+<td>Private method to activate the given widget in the left or right sidebar.</td>
+</tr>
+<tr>
 <td><a href="#MqttMonitorPlugin.__activateWidget">__activateWidget</a></td>
 <td>Private slot to handle the activation of the MQTT Monitor.</td>
 </tr>
@@ -137,6 +141,21 @@
 reference to the user interface object
 </dd>
 </dl>
+<a NAME="MqttMonitorPlugin.__activateLeftRightSidebarWidget" ID="MqttMonitorPlugin.__activateLeftRightSidebarWidget"></a>
+<h4>MqttMonitorPlugin.__activateLeftRightSidebarWidget</h4>
+<b>__activateLeftRightSidebarWidget</b>(<i>widget</i>)
+<p>
+        Private method to activate the given widget in the left or right
+        sidebar.
+</p>
+
+<dl>
+
+<dt><i>widget</i> (QWidget)</dt>
+<dd>
+reference to the widget to be activated
+</dd>
+</dl>
 <a NAME="MqttMonitorPlugin.__activateWidget" ID="MqttMonitorPlugin.__activateWidget"></a>
 <h4>MqttMonitorPlugin.__activateWidget</h4>
 <b>__activateWidget</b>(<i></i>)
--- a/PluginMqttMonitor.epj	Fri Apr 19 15:15:28 2024 +0200
+++ b/PluginMqttMonitor.epj	Thu Aug 01 11:14:29 2024 +0200
@@ -147,6 +147,10 @@
           "IgnoreVariadicNames": false
         },
         "ValidEncodings": "latin-1, utf-8"
+      },
+      "SyntaxChecker": {
+        "AdditionalBuiltins": "",
+        "ExcludeFiles": ""
       }
     },
     "DESCRIPTION": "Plug-in implementing a tool to connect to a MQTT broker, subscribe to topics, present received messages and publish messages.\n\nNote: The paho-mqtt Python package must be installed. ",
--- a/PluginMqttMonitor.py	Fri Apr 19 15:15:28 2024 +0200
+++ b/PluginMqttMonitor.py	Thu Aug 01 11:14:29 2024 +0200
@@ -39,7 +39,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "11.0.0"
+version = "11.0.1"
 className = "MqttMonitorPlugin"
 packageName = "MqttMonitor"
 shortDescription = "Plug-in implementing a tool to connect to a MQTT broker"
@@ -280,8 +280,10 @@
             self.__ui.rToolboxDock.show()
             self.__ui.rToolbox.setCurrentWidget(self.__widget)
         elif uiLayoutType == "Sidebars":
-            self.__ui.rightSidebar.show()
-            self.__ui.rightSidebar.setCurrentWidget(self.__widget)
+            try:
+                self.__ui.activateLeftRightSidebarWidget(self.__widget)
+            except AttributeError:
+                self.__activateLeftRightSidebarWidget(self.__widget)
         else:
             self.__widget.show()
         self.__widget.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
@@ -354,6 +356,27 @@
         else:
             Preferences.Prefs.settings.setValue(self.PreferencesKey + "/" + key, value)
 
+    ############################################################################
+    ## Methods for backward compatibility with eric-ide < 24.9
+    ############################################################################
+
+    def __activateLeftRightSidebarWidget(self, widget):
+        """
+        Private method to activate the given widget in the left or right
+        sidebar.
+
+        @param widget reference to the widget to be activated
+        @type QWidget
+        """
+        # This is for backward compatibility with eric-ide < 24.9.
+        sidebar = (
+            self.__ui.leftSidebar
+            if Preferences.getUI("CombinedLeftRightSidebar")
+            else self.__ui.rightSidebar
+        )
+        sidebar.show()
+        sidebar.setCurrentWidget(widget)
+
 
 def installDependencies(pipInstall):
     """
Binary file PluginMqttMonitor.zip has changed

eric ide

mercurial