mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
Added option to specify SSID is hidden.
This commit is contained in:
parent
be40f05b50
commit
dcf93bd5e8
1 changed files with 15 additions and 0 deletions
|
@ -278,6 +278,13 @@ Popup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CheckBox {
|
||||||
|
id: chkWifiSSIDHidden
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
text: qsTr("Hidden SSID")
|
||||||
|
checked: false
|
||||||
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: qsTr("Password:")
|
text: qsTr("Password:")
|
||||||
color: parent.enabled ? (fieldWifiPassword.indicateError ? "red" : "black") : "grey"
|
color: parent.enabled ? (fieldWifiPassword.indicateError ? "red" : "black") : "grey"
|
||||||
|
@ -461,6 +468,7 @@ Popup {
|
||||||
}
|
}
|
||||||
if ('wifiSSID' in settings) {
|
if ('wifiSSID' in settings) {
|
||||||
fieldWifiSSID.text = settings.wifiSSID
|
fieldWifiSSID.text = settings.wifiSSID
|
||||||
|
chkWifiSSIDHidden.checked = settings.wifiSSIDHidden
|
||||||
chkShowPassword.checked = false
|
chkShowPassword.checked = false
|
||||||
fieldWifiPassword.text = settings.wifiPassword
|
fieldWifiPassword.text = settings.wifiPassword
|
||||||
fieldWifiCountry.currentIndex = fieldWifiCountry.find(settings.wifiCountry)
|
fieldWifiCountry.currentIndex = fieldWifiCountry.find(settings.wifiCountry)
|
||||||
|
@ -647,6 +655,9 @@ Popup {
|
||||||
wpaconfig += "ap_scan=1\n\n"
|
wpaconfig += "ap_scan=1\n\n"
|
||||||
wpaconfig += "update_config=1\n"
|
wpaconfig += "update_config=1\n"
|
||||||
wpaconfig += "network={\n"
|
wpaconfig += "network={\n"
|
||||||
|
if (chkWifiSSIDHidden.checked) {
|
||||||
|
wpaconfig += "\tscan_ssid=1\n"
|
||||||
|
}
|
||||||
wpaconfig += "\tssid=\""+fieldWifiSSID.text+"\"\n"
|
wpaconfig += "\tssid=\""+fieldWifiSSID.text+"\"\n"
|
||||||
var cryptedPsk = fieldWifiPassword.text.length == 64 ? fieldWifiPassword.text : imageWriter.pbkdf2(fieldWifiPassword.text, fieldWifiSSID.text)
|
var cryptedPsk = fieldWifiPassword.text.length == 64 ? fieldWifiPassword.text : imageWriter.pbkdf2(fieldWifiPassword.text, fieldWifiSSID.text)
|
||||||
wpaconfig += "\tpsk="+cryptedPsk+"\n"
|
wpaconfig += "\tpsk="+cryptedPsk+"\n"
|
||||||
|
@ -670,6 +681,9 @@ Popup {
|
||||||
cloudinitnetwork += " access-points:\n"
|
cloudinitnetwork += " access-points:\n"
|
||||||
cloudinitnetwork += " \""+fieldWifiSSID.text+"\":\n"
|
cloudinitnetwork += " \""+fieldWifiSSID.text+"\":\n"
|
||||||
cloudinitnetwork += " password: \""+cryptedPsk+"\"\n"
|
cloudinitnetwork += " password: \""+cryptedPsk+"\"\n"
|
||||||
|
if (chkWifiSSIDHidden.checked) {
|
||||||
|
cloudinitnetwork += " hidden: true\n"
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: setting wifi country code broken on Ubuntu
|
/* FIXME: setting wifi country code broken on Ubuntu
|
||||||
For unknown reasons udev does not trigger setregdomain automatically and as a result
|
For unknown reasons udev does not trigger setregdomain automatically and as a result
|
||||||
|
@ -744,6 +758,7 @@ Popup {
|
||||||
}
|
}
|
||||||
if (chkWifi.checked) {
|
if (chkWifi.checked) {
|
||||||
settings.wifiSSID = fieldWifiSSID.text
|
settings.wifiSSID = fieldWifiSSID.text
|
||||||
|
settings.wifiSSIDHidden = chkWifiSSIDHidden.checked
|
||||||
settings.wifiPassword = fieldWifiPassword.text
|
settings.wifiPassword = fieldWifiPassword.text
|
||||||
settings.wifiCountry = fieldWifiCountry.editText
|
settings.wifiCountry = fieldWifiCountry.editText
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue