Corrected an issue in the CircuitPython device causing a torn off menu to remain visible after a device disconnect. mpy_network

Tue, 21 Feb 2023 10:53:46 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 21 Feb 2023 10:53:46 +0100
branch
mpy_network
changeset 9783
5f84d5eeee9e
parent 9782
67414f28db68
child 9787
163511257f24

Corrected an issue in the CircuitPython device causing a torn off menu to remain visible after a device disconnect.

src/eric7/MicroPython/Devices/CircuitPythonDevices.py file | annotate | diff | comparison | revisions
--- a/src/eric7/MicroPython/Devices/CircuitPythonDevices.py	Mon Feb 20 16:02:02 2023 +0100
+++ b/src/eric7/MicroPython/Devices/CircuitPythonDevices.py	Tue Feb 21 10:53:46 2023 +0100
@@ -57,6 +57,18 @@
 
         self.__createCPyMenu()
 
+    def setConnected(self, connected):
+        """
+        Public method to set the connection state.
+
+        @param connected connection state
+        @type bool
+        """
+        if not connected and self.__libraryMenu.isTearOffMenuVisible():
+            self.__libraryMenu.hideTearOffMenu()
+
+        super().setConnected(connected)
+
     def setButtons(self):
         """
         Public method to enable the supported action buttons.

eric ide

mercurial