30 @type QObject (optional) |
30 @type QObject (optional) |
31 """ |
31 """ |
32 super().__init__(parent) |
32 super().__init__(parent) |
33 |
33 |
34 self.__mpy = microPython |
34 self.__mpy = microPython |
|
35 |
|
36 self.__wifiStatusDialog = None |
35 |
37 |
36 def createMenu(self, menu): |
38 def createMenu(self, menu): |
37 """ |
39 """ |
38 Public method to create the WiFi submenu. |
40 Public method to create the WiFi submenu. |
39 |
41 |
88 """ |
90 """ |
89 Private slot to show a dialog with the WiFi status of the current device. |
91 Private slot to show a dialog with the WiFi status of the current device. |
90 """ |
92 """ |
91 from .WifiStatusDialog import WifiStatusDialog |
93 from .WifiStatusDialog import WifiStatusDialog |
92 |
94 |
93 try: |
95 if self.__wifiStatusDialog is not None: |
94 clientStatus, apStatus, overallStatus = self.__mpy.getDevice().getWifiData() |
96 self.__wifiStatusDialog.deleteLater() |
95 |
97 self.__wifiStatusDialog = None |
96 dlg = WifiStatusDialog( |
98 |
97 clientStatus, apStatus, overallStatus, parent=self.__mpy |
99 self.__wifiStatusDialog = WifiStatusDialog( |
98 ) |
100 microPython=self.__mpy, parent=self.__mpy |
99 dlg.exec() |
101 ) |
100 except Exception as exc: |
102 self.__wifiStatusDialog.show() |
101 self.__mpy.showError("getWifiData()", str(exc)) |
|
102 |
103 |
103 @pyqtSlot() |
104 @pyqtSlot() |
104 def __connectWifi(self): |
105 def __connectWifi(self): |
105 """ |
106 """ |
106 Private slot to connect the current device to a WiFi network. |
107 Private slot to connect the current device to a WiFi network. |