src/eric7/MicroPython/EthernetDialogs/EthernetController.py

branch
eric7
changeset 11263
28f0ead11a82
parent 11090
f5f5f5803935
diff -r 07d9cc8d773c -r 28f0ead11a82 src/eric7/MicroPython/EthernetDialogs/EthernetController.py
--- a/src/eric7/MicroPython/EthernetDialogs/EthernetController.py	Mon May 05 10:17:49 2025 +0200
+++ b/src/eric7/MicroPython/EthernetDialogs/EthernetController.py	Mon May 05 17:40:08 2025 +0200
@@ -32,6 +32,8 @@
 
         self.__mpy = microPython
 
+        self.__ethernetStatusDialog = None
+
     def createMenu(self, menu):
         """
         Public method to create the Ethernet submenu.
@@ -81,15 +83,14 @@
         """
         from .EthernetStatusDialog import EthernetStatusDialog
 
-        try:
-            with EricOverrideCursor():
-                status = self.__mpy.getDevice().getEthernetStatus()
-                # status is a list of user labels and associated values
+        if self.__ethernetStatusDialog is not None:
+            self.__ethernetStatusDialog.deleteLater()
+            self.__ethernetStatusDialog = None
 
-            dlg = EthernetStatusDialog(status, parent=self.__mpy)
-            dlg.exec()
-        except Exception as exc:
-            self.__mpy.showError("getEthernetStatus()", str(exc))
+        self.__ethernetStatusDialog = EthernetStatusDialog(
+            microPython=self.__mpy, parent=self.__mpy
+        )
+        self.__ethernetStatusDialog.show()
 
     @pyqtSlot()
     def __connectLanDhcp(self):

eric ide

mercurial