Skip to content

Commit

Permalink
Fix advanced settings not working if wifiSSIDHidden is not in setting…
Browse files Browse the repository at this point in the history
…s file

- Fix advanced settings not working if users has wifi settings saved
  with previous version of Imager, and user selected "use always"

Ref #343

- Also fix problem where "SSH enabled" is not saved on Mac OS X due
  to the check assuming QSettings stores settings as strings, while
  with the plist stuff on Mac OS X it is stored as boolean.
  • Loading branch information
maxnet committed Feb 3, 2022
1 parent b822291 commit d91f8d9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -9,8 +9,8 @@ endif()
project(rpi-imager LANGUAGES CXX C)
set(IMAGER_VERSION_MAJOR 1)
set(IMAGER_VERSION_MINOR 7)
set(IMAGER_VERSION_STR "${IMAGER_VERSION_MAJOR}.${IMAGER_VERSION_MINOR}")
set(IMAGER_VERSION_CSV "${IMAGER_VERSION_MAJOR},${IMAGER_VERSION_MINOR},0,0")
set(IMAGER_VERSION_STR "${IMAGER_VERSION_MAJOR}.${IMAGER_VERSION_MINOR}.1")
set(IMAGER_VERSION_CSV "${IMAGER_VERSION_MAJOR},${IMAGER_VERSION_MINOR},1,0")
add_definitions(-DIMAGER_VERSION_STR="${IMAGER_VERSION_STR}")
add_definitions(-DIMAGER_VERSION_CSV=${IMAGER_VERSION_CSV})

Expand Down
10 changes: 7 additions & 3 deletions OptionsPopup.qml
Expand Up @@ -469,7 +469,7 @@ Popup {
chkSetUser.checked = true
/* Older imager versions did not have a sshEnabled setting.
Assume it is true if it does not exists and sshUserPassword is set */
if (!('sshEnabled' in settings) || settings.sshEnabled === "true") {
if (!('sshEnabled' in settings) || settings.sshEnabled === "true" || settings.sshEnabled === true) {
chkSSH.checked = true
radioPasswordAuthentication.checked = true
}
Expand All @@ -485,7 +485,9 @@ Popup {
}
if ('wifiSSID' in settings) {
fieldWifiSSID.text = settings.wifiSSID
chkWifiSSIDHidden.checked = settings.wifiSSIDHidden
if ('wifiSSIDHidden' in settings && settings.wifiSSIDHidden) {
chkWifiSSIDHidden.checked = true
}
chkShowPassword.checked = false
fieldWifiPassword.text = settings.wifiPassword
fieldWifiCountry.currentIndex = fieldWifiCountry.find(settings.wifiCountry)
Expand Down Expand Up @@ -798,7 +800,9 @@ Popup {
}
if (chkWifi.checked) {
settings.wifiSSID = fieldWifiSSID.text
settings.wifiSSIDHidden = chkWifiSSIDHidden.checked
if (chkWifiSSIDHidden.checked) {
settings.wifiSSIDHidden = true
}
settings.wifiPassword = fieldWifiPassword.text
settings.wifiCountry = fieldWifiCountry.editText
}
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
@@ -1,3 +1,10 @@
rpi-imager (1.7.1) unstable; urgency=medium

* Fix advanced settings being broken if there are saved wifi
settings and wifiSSIDHidden is not present

-- Floris Bos <bos@je-eigen-domein.nl> Thu, 03 Feb 2022 18:38:15 +0100

rpi-imager (1.7.0) unstable; urgency=medium

* Only apply advanced settings if the operating system indicates it
Expand Down

0 comments on commit d91f8d9

Please sign in to comment.