src/eric7/MicroPython/WifiDialogs/WifiApConfigDialog.py

branch
mpy_network
changeset 9868
467288cffee2
parent 9798
4402d76c5fa9
child 10153
ffe7432f716b
--- a/src/eric7/MicroPython/WifiDialogs/WifiApConfigDialog.py	Thu Mar 09 16:59:39 2023 +0100
+++ b/src/eric7/MicroPython/WifiDialogs/WifiApConfigDialog.py	Fri Mar 10 18:04:06 2023 +0100
@@ -119,13 +119,33 @@
             self.apShowPasswordButton.setIcon(EricPixmapCache.getIcon("showPassword"))
             self.apShowPasswordButton.setToolTip(self.tr("Press to show the password"))
 
+    @pyqtSlot()
+    def accept(self):
+        """
+        Public slot accepting the dialog.
+        """
+        if self.rememberCheckBox.isChecked():
+            Preferences.setMicroPython("WifiApName", self.apSsidEdit.text())
+            Preferences.setMicroPython("WifiApPassword", self.apPasswordEdit.text())
+            Preferences.setMicroPython(
+                "WifiApAuthMode", self.apSecurityComboBox.currentData()
+            )
+            if self.__withIP:
+                Preferences.setMicroPython("WifiApAddress", self.addressEdit.text())
+                Preferences.setMicroPython("WifiApNetmask", self.netmaskEdit.text())
+                Preferences.setMicroPython("WifiApGateway", self.gatewayEdit.text())
+                Preferences.setMicroPython("WifiApDNS", self.dnsEdit.text())
+
+        super().accept()
+
     def getApConfig(self):
         """
         Public method to get the entered access point configuration data.
 
         @return tuple containing the SSID, the password, the selected security mode
-            and a flag indicating to save the parameters to the settings
-        @rtype tuple of (str, str, int, bool)
+            and a tuple with the IPv4 address, the netmask, the gateway address and
+            the resolver address
+        @rtype tuple of (str, str, int, (str, str, str, str))
         """
         ifconfig = (
             (
@@ -142,6 +162,5 @@
             self.apSsidEdit.text(),
             self.apPasswordEdit.text(),
             self.apSecurityComboBox.currentData(),
-            self.rememberCheckBox.isChecked(),
             ifconfig,
         )

eric ide

mercurial