src/eric7/Preferences/ConfigurationPages/MicroPythonPage.py

branch
mpy_network
changeset 9782
67414f28db68
parent 9779
8d3c7c991085
child 9797
3be7b2326e2c
--- a/src/eric7/Preferences/ConfigurationPages/MicroPythonPage.py	Mon Feb 20 11:42:45 2023 +0100
+++ b/src/eric7/Preferences/ConfigurationPages/MicroPythonPage.py	Mon Feb 20 16:02:02 2023 +0100
@@ -42,6 +42,7 @@
         self.setObjectName("MicroPythonPage")
 
         self.showPasswordButton.setIcon(EricPixmapCache.getIcon("showPassword"))
+        self.apShowPasswordButton.setIcon(EricPixmapCache.getIcon("showPassword"))
 
         self.workspacePicker.setMode(EricPathPickerModes.DIRECTORY_MODE)
 
@@ -83,6 +84,16 @@
         self.dfuUtilPathPicker.setMode(EricPathPickerModes.OPEN_FILE_MODE)
         self.dfuUtilPathPicker.setFilters(self.tr("All Files (*)"))
 
+        # populate the WiFi security mode combo box
+        self.apSecurityComboBox.addItem(self.tr("open"), 0)
+        self.apSecurityComboBox.addItem("WEP", 1)
+        self.apSecurityComboBox.addItem("WPA", 2)
+        self.apSecurityComboBox.addItem("WPA2", 3)
+        self.apSecurityComboBox.addItem("WPA/WPA2", 4)
+        self.apSecurityComboBox.addItem("WPA2 (CCMP)", 5)
+        self.apSecurityComboBox.addItem("WPA3", 6)
+        self.apSecurityComboBox.addItem("WPA2/WPA3", 7)
+
         # set initial values
         # workspace
         self.workspacePicker.setText(
@@ -125,6 +136,12 @@
         self.passwordEdit.setText(Preferences.getMicroPython("WifiPassword"))
         self.apSsidEdit.setText(Preferences.getMicroPython("WifiApName"))
         self.apPasswordEdit.setText(Preferences.getMicroPython("WifiApPassword"))
+        index = self.apSecurityComboBox.findData(
+            Preferences.getMicroPython("WifiApAuthMode")
+        )
+        if index == -1:
+            index = 5  # default it to WPA/WPA2 in case of an issue
+        self.apSecurityComboBox.setCurrentIndex(index)
 
         # MPY Cross Compiler
         self.mpyCrossPicker.setText(Preferences.getMicroPython("MpyCrossCompiler"))
@@ -212,6 +229,9 @@
         Preferences.setMicroPython("WifiPassword", self.passwordEdit.text())
         Preferences.setMicroPython("WifiApName", self.apSsidEdit.text())
         Preferences.setMicroPython("WifiApPassword", self.apPasswordEdit.text())
+        Preferences.setMicroPython(
+            "WifiApAuthMode", self.apSecurityComboBox.currentData()
+        )
 
         # MPY Cross Compiler
         Preferences.setMicroPython("MpyCrossCompiler", self.mpyCrossPicker.text())

eric ide

mercurial