--- a/src/eric7/MicroPython/MicroPythonWidget.py Sat Mar 11 15:28:47 2023 +0100 +++ b/src/eric7/MicroPython/MicroPythonWidget.py Sun Mar 12 14:56:04 2023 +0100 @@ -43,6 +43,7 @@ from . import Devices, UF2FlashDialog from .BluetoothDialogs.BluetoothController import BluetoothController +from .EthernetDialogs.EthernetController import EthernetController from .MicroPythonFileManager import MicroPythonFileManager from .MicroPythonFileManagerWidget import MicroPythonFileManagerWidget from .Ui_MicroPythonWidget import Ui_MicroPythonWidget @@ -235,6 +236,9 @@ self.__bluetoothController = BluetoothController(self, self) self.__btMenu = None + self.__ethernetController = EthernetController(self, self) + self.__ethernetMenu = None + self.__superMenu = QMenu(self) self.__superMenu.aboutToShow.connect(self.__aboutToShowSuperMenu) @@ -1510,6 +1514,18 @@ else: self.__btMenu = None + # prepare the Ethernet menu + if ( + self.__device + and self.__connected + and self.__device.getDeviceData("ethernet") + ): + if self.__ethernetMenu is not None: + self.__ethernetMenu.deleteLater() + self.__ethernetMenu = self.__ethernetController.createMenu(self.__superMenu) + else: + self.__ethernetMenu = None + # populate the super menu hasTime = self.__device.hasTimeCommands() if self.__device else False @@ -1565,7 +1581,13 @@ self.__superMenu.addMenu(self.__wifiMenu) if self.__btMenu is not None: self.__superMenu.addMenu(self.__btMenu) - if self.__wifiMenu is not None or self.__btMenu is not None: + if self.__ethernetMenu is not None: + self.__superMenu.addMenu(self.__ethernetMenu) + if ( + self.__wifiMenu is not None + or self.__btMenu is not None + or self.__ethernetMenu is not None + ): self.__superMenu.addSeparator() if downloadMenu is None: # generic download action