src/eric7/MicroPython/WifiDialogs/WifiController.py

branch
eric7
changeset 10153
ffe7432f716b
parent 10022
a95800b414b7
child 10230
1311cd5d117e
--- a/src/eric7/MicroPython/WifiDialogs/WifiController.py	Wed Aug 02 17:22:20 2023 +0200
+++ b/src/eric7/MicroPython/WifiDialogs/WifiController.py	Thu Aug 03 17:33:07 2023 +0200
@@ -107,8 +107,10 @@
 
         dlg = WifiConnectionDialog()
         if dlg.exec() == QDialog.DialogCode.Accepted:
-            ssid, password = dlg.getConnectionParameters()
-            success, error = self.__mpy.getDevice().connectWifi(ssid, password)
+            ssid, password, hostname = dlg.getConnectionParameters()
+            success, error = self.__mpy.getDevice().connectWifi(
+                ssid, password, hostname
+            )
             if success:
                 EricMessageBox.information(
                     None,
@@ -194,10 +196,13 @@
         """
         from .WifiConnectionDialog import WifiConnectionDialog
 
-        dlg = WifiConnectionDialog()
+        dlg = WifiConnectionDialog(withCountry=self.__mpy.getDevice().hasWifiCountry())
         if dlg.exec() == QDialog.DialogCode.Accepted:
-            ssid, password = dlg.getConnectionParameters()
-            success, error = self.__mpy.getDevice().writeCredentials(ssid, password)
+            ssid, password, hostname = dlg.getConnectionParameters()
+            country = dlg.getCountryCode()
+            success, error = self.__mpy.getDevice().writeCredentials(
+                ssid, password, hostname, country
+            )
             if success:
                 if self.__mpy.getDevice().hasCircuitPython():
                     # CircuitPython will reset for the REPL, so no auto-connect
@@ -293,12 +298,13 @@
 
         dlg = WifiApConfigDialog(withIP=withIP)
         if dlg.exec() == QDialog.DialogCode.Accepted:
-            ssid, password, security, ifconfig = dlg.getApConfig()
+            ssid, password, security, hostname, ifconfig = dlg.getApConfig()
 
             ok, err = self.__mpy.getDevice().startAccessPoint(
                 ssid,
                 security=security,
                 password=password,
+                hostname=hostname,
                 ifconfig=ifconfig if withIP else None,
             )
             if ok:

eric ide

mercurial