src/eric7/Preferences/__init__.py

branch
mpy_network
changeset 9776
210bf87ae5c7
parent 9707
717f95e35ca8
child 9779
8d3c7c991085
--- a/src/eric7/Preferences/__init__.py	Sat Feb 18 10:11:44 2023 +0100
+++ b/src/eric7/Preferences/__init__.py	Sat Feb 18 18:12:32 2023 +0100
@@ -1576,6 +1576,8 @@
         "DfuUtilPath": "",  # path of the dfu-util flashing tool
         "IgnoredUnknownDevices": "[]",  # empty list encoded as JSON
         "ManualDevices": "[]",  # empty list encoded as JSON
+        "WifiName": "",
+        "WifiPassword": "",
         # MicroPython URLs
         "MicroPythonDocuUrl": "https://docs.micropython.org/en/latest/",
         "MicroPythonFirmwareUrl": "http://micropython.org/download/",
@@ -3799,6 +3801,12 @@
             return json.loads(jsonStr)
         else:
             return None
+    elif key == "WifiPassword":
+        return pwConvert(
+            Prefs.settings.value(
+                "MicroPython/" + key, Prefs.microPythonDefaults[key]
+            ), encode=False
+        )
     else:
         return Prefs.settings.value(
             "MicroPython/" + key, Prefs.microPythonDefaults[key]
@@ -3814,6 +3822,8 @@
     """
     if key in ["IgnoredUnknownDevices", "ManualDevices"]:
         Prefs.settings.setValue("MicroPython/" + key, json.dumps(value))
+    elif key == "WifiPassword":
+        Prefs.settings.setValue("MicroPython/" + key, pwConvert(value, encode=True))
     else:
         Prefs.settings.setValue("MicroPython/" + key, value)
 

eric ide

mercurial