--- a/src/eric7/MicroPython/WifiDialogs/WifiController.py Sun Feb 19 14:45:16 2023 +0100 +++ b/src/eric7/MicroPython/WifiDialogs/WifiController.py Mon Feb 20 11:42:45 2023 +0100 @@ -55,15 +55,18 @@ wifiMenu.addAction(self.tr("Remove WiFi Credentials"), self.__removeCredentials) wifiMenu.addSeparator() wifiMenu.addAction(self.tr("Start WiFi Access Point"), self.__startAccessPoint) + wifiMenu.addAction( + self.tr("Show Connected Clients"), self.__showConnectedClients + ) wifiMenu.addAction(self.tr("Stop WiFi Access Point"), self.__stopAccessPoint) wifiMenu.addSeparator() wifiMenu.addAction( self.tr("Deactivate Client Interface"), - lambda: self.__deactivateInterface("STA") + lambda: self.__deactivateInterface("STA"), ) wifiMenu.addAction( self.tr("Deactivate Access Point Interface"), - lambda: self.__deactivateInterface("AP") + lambda: self.__deactivateInterface("AP"), ) # add device specific entries (if there are any) @@ -129,17 +132,14 @@ EricMessageBox.information( None, self.tr("Disconnect WiFi"), - self.tr( - "<p>The device was disconnected from the WiFi network.</p>" - ), + self.tr("<p>The device was disconnected from the WiFi network.</p>"), ) else: EricMessageBox.critical( None, self.tr("Disconnect WiFi"), self.tr( - "<p>The device could not be disconnected.</p>" - "<p>Reason: {0}</p>" + "<p>The device could not be disconnected.</p><p>Reason: {0}</p>" ).format(error if error else self.tr("unknown")), ) @@ -148,16 +148,37 @@ """ Private slot to check the availability of an internet connection. """ - # TODO: not implemented yet - pass + success, error = self.__mpy.getDevice().checkInternet() + if not error: + msg = ( + self.tr("<p>The internet connection is <b>available</b>.</p>") + if success + else self.tr("<p>The internet connection is <b>not available</b>.</p>") + ) + EricMessageBox.information( + None, + self.tr("Check Internet Connection"), + msg, + ) + else: + EricMessageBox.critical( + None, + self.tr("Check Internet Connection"), + self.tr( + "<p>The internet is not available.</p><p>Reason: {0}</p>" + ).format(error if error else self.tr("unknown")), + ) @pyqtSlot() def __scanNetwork(self): """ Private slot to scan for visible WiFi networks. """ - # TODO: not implemented yet - pass + from .WifiNetworksWindow import WifiNetworksWindow + + win = WifiNetworksWindow(self.__mpy.getDevice(), self.__mpy) + win.show() + win.scanNetworks() @pyqtSlot() def __writeCredentials(self): @@ -196,6 +217,15 @@ # TODO: not implemented yet pass + @pyqtSlot() + def __showConnectedClients(self): + """ + Private slot to show a list of WiFi clients connected to the Access Point + interface. + """ + # TODO: not implemented yet + pass + def __deactivateInterface(self, interface): """ Private method to deactivate a given WiFi interface of the connected device. @@ -206,4 +236,3 @@ """ # TODO: not implemented yet pass -