Merge pull request #677 from tdewey-rpi/dev/shared/os-customization

OS customization rebrand, consistency
This commit is contained in:
Tom Dewey 2023-10-18 10:36:19 +01:00 committed by GitHub
commit 338b71112e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 193 additions and 144 deletions

View file

@ -197,8 +197,8 @@ On macOS, disable it by editing the property list for the application:
defaults write org.raspberrypi.Imager.plist telemetry -bool NO defaults write org.raspberrypi.Imager.plist telemetry -bool NO
``` ```
### Advanced options ### OS Customization
When using the app, press <kbd>CTRL</kbd> + <kbd>SHIFT</kbd> + <kbd>X</kbd> to reveal the **Advanced options** dialog. When using the app, press <kbd>CTRL</kbd> + <kbd>SHIFT</kbd> + <kbd>X</kbd> to reveal the **OS Customization** dialog.
In here, you can specify several things you would otherwise set in the boot configuration files. For example, you can enable SSH, set the Wi-Fi login, and specify your locale settings for the system image. In here, you can specify several things you would otherwise set in the boot configuration files. For example, you can enable SSH, set the Wi-Fi login, and specify your locale settings for the system image.

View file

@ -24,6 +24,6 @@ index 568d1cd..9e36607 100644
+ function raise() { } + function raise() { }
+ /* */ + /* */
+ +
title: qsTr("Advanced options") title: qsTr("OS Customization")
property bool initialized: false property bool initialized: false

View file

@ -17,7 +17,7 @@ Window {
maximumWidth: width maximumWidth: width
minimumHeight: 125 minimumHeight: 125
height: Math.min(750, cl.implicitHeight) height: Math.min(750, cl.implicitHeight)
title: qsTr("Advanced options") title: qsTr("OS Customization")
property bool initialized: false property bool initialized: false
property bool hasSavedSettings: false property bool hasSavedSettings: false
@ -29,6 +29,8 @@ Window {
property string cloudinitwrite property string cloudinitwrite
property string cloudinitnetwork property string cloudinitnetwork
signal saveSettingsSignal(var settings)
ColumnLayout { ColumnLayout {
id: cl id: cl
spacing: 10 spacing: 10
@ -46,23 +48,6 @@ Window {
//ScrollBar.vertical.policy: ScrollBar.AlwaysOn //ScrollBar.vertical.policy: ScrollBar.AlwaysOn
ColumnLayout { ColumnLayout {
RowLayout {
Label {
text: qsTr("Image customization options")
}
ComboBox {
id: comboSaveSettings
model: {
[qsTr("for this session only"),
qsTr("to always use")]
}
Layout.minimumWidth: 250
Layout.maximumHeight: 40
enabled: !imageWriter.isEmbeddedMode()
}
}
TabBar { TabBar {
id: bar id: bar
Layout.fillWidth: true Layout.fillWidth: true
@ -453,7 +438,6 @@ Window {
fieldKeyboardLayout.model = imageWriter.getKeymapLayoutList() fieldKeyboardLayout.model = imageWriter.getKeymapLayoutList()
if (Object.keys(settings).length) { if (Object.keys(settings).length) {
comboSaveSettings.currentIndex = 1
hasSavedSettings = true hasSavedSettings = true
} }
if ('hostname' in settings) { if ('hostname' in settings) {
@ -539,7 +523,7 @@ Window {
/* Lacking an easy cross-platform to fetch keyboard layout /* Lacking an easy cross-platform to fetch keyboard layout
from host system, just default to "gb" for people in from host system, just default to "gb" for people in
UK time zone for now, and "us" for everyone else */ UK time zone for now, and "us" for everyone else */
if (tz == "Europe/London") { if (tz === "Europe/London") {
fieldKeyboardLayout.currentIndex = fieldKeyboardLayout.find("gb") fieldKeyboardLayout.currentIndex = fieldKeyboardLayout.find("gb")
} else { } else {
fieldKeyboardLayout.currentIndex = fieldKeyboardLayout.find("us") fieldKeyboardLayout.currentIndex = fieldKeyboardLayout.find("us")
@ -807,43 +791,85 @@ Window {
function saveSettings() function saveSettings()
{ {
if (comboSaveSettings.currentIndex == 1) { var settings = { };
hasSavedSettings = true if (chkHostname.checked && fieldHostname.length) {
var settings = { }; settings.hostname = fieldHostname.text
if (chkHostname.checked && fieldHostname.length) { }
settings.hostname = fieldHostname.text if (chkSetUser.checked) {
} settings.sshUserName = fieldUserName.text
if (chkSetUser.checked) { settings.sshUserPassword = fieldUserPassword.alreadyCrypted ? fieldUserPassword.text : imageWriter.crypt(fieldUserPassword.text)
settings.sshUserName = fieldUserName.text }
settings.sshUserPassword = fieldUserPassword.alreadyCrypted ? fieldUserPassword.text : imageWriter.crypt(fieldUserPassword.text)
}
settings.sshEnabled = chkSSH.checked settings.sshEnabled = chkSSH.checked
if (chkSSH.checked && radioPubKeyAuthentication.checked) { if (chkSSH.checked && radioPubKeyAuthentication.checked) {
settings.sshAuthorizedKeys = fieldPublicKey.text settings.sshAuthorizedKeys = fieldPublicKey.text
}
if (chkWifi.checked) {
settings.wifiSSID = fieldWifiSSID.text
if (chkWifiSSIDHidden.checked) {
settings.wifiSSIDHidden = true
} }
if (chkWifi.checked) { settings.wifiPassword = fieldWifiPassword.text.length == 64 ? fieldWifiPassword.text : imageWriter.pbkdf2(fieldWifiPassword.text, fieldWifiSSID.text)
settings.wifiSSID = fieldWifiSSID.text settings.wifiCountry = fieldWifiCountry.editText
if (chkWifiSSIDHidden.checked) { }
settings.wifiSSIDHidden = true if (chkLocale.checked) {
} settings.timezone = fieldTimezone.editText
settings.wifiPassword = fieldWifiPassword.text.length == 64 ? fieldWifiPassword.text : imageWriter.pbkdf2(fieldWifiPassword.text, fieldWifiSSID.text) settings.keyboardLayout = fieldKeyboardLayout.editText
settings.wifiCountry = fieldWifiCountry.editText
}
if (chkLocale.checked) {
settings.timezone = fieldTimezone.editText
settings.keyboardLayout = fieldKeyboardLayout.editText
}
imageWriter.setSavedCustomizationSettings(settings)
} else if (hasSavedSettings) {
imageWriter.clearSavedCustomizationSettings()
hasSavedSettings = false
} }
imageWriter.setSetting("beep", chkBeep.checked) imageWriter.setSetting("beep", chkBeep.checked)
imageWriter.setSetting("eject", chkEject.checked) imageWriter.setSetting("eject", chkEject.checked)
imageWriter.setSetting("telemetry", chkTelemtry.checked) imageWriter.setSetting("telemetry", chkTelemtry.checked)
if (chkHostname.checked || chkSetUser.checked || chkSSH.checked || chkWifi.checked || chkLocale.checked) {
/* OS customization to be applied. */
hasSavedSettings = true
saveSettingsSignal(settings)
}
}
function clearCustomizationFields()
{
/* Bind copies of the lists */
fieldTimezone.model = imageWriter.getTimezoneList()
fieldKeyboardLayout.model = imageWriter.getKeymapLayoutList()
fieldWifiCountry.model = imageWriter.getCountryList()
fieldHostname.text = "raspberrypi"
fieldUserName.text = imageWriter.getCurrentUser()
fieldUserPassword.clear()
radioPubKeyAuthentication.checked = false
radioPasswordAuthentication.checked = false
fieldPublicKey.clear()
/* Timezone Settings*/
fieldTimezone.currentIndex = fieldTimezone.find(imageWriter.getTimezone())
/* Lacking an easy cross-platform to fetch keyboard layout
from host system, just default to "gb" for people in
UK time zone for now, and "us" for everyone else */
if (imageWriter.getTimezone() === "Europe/London") {
fieldKeyboardLayout.currentIndex = fieldKeyboardLayout.find("gb")
} else {
fieldKeyboardLayout.currentIndex = fieldKeyboardLayout.find("us")
}
chkSetUser.checked = false
chkSSH.checked = false
chkLocale.checked = false
chkWifiSSIDHidden.checked = false
chkHostname.checked = false
/* WiFi Settings */
fieldWifiSSID.text = imageWriter.getSSID()
if (fieldWifiSSID.text.length) {
fieldWifiPassword.text = imageWriter.getPSK()
if (fieldWifiPassword.text.length) {
chkShowPassword.checked = false
if (Qt.platform.os == "osx") {
/* User indicated wifi must be prefilled */
chkWifi.checked = true
}
}
}
} }
} }

View file

@ -18,6 +18,8 @@ Popup {
padding: 0 padding: 0
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
property bool hasSavedSettings: false
signal yes() signal yes()
signal no() signal no()
signal noClearSettings() signal noClearSettings()
@ -70,7 +72,7 @@ Popup {
Layout.topMargin: 10 Layout.topMargin: 10
font.family: roboto.name font.family: roboto.name
font.bold: true font.bold: true
text: qsTr("Use image customisation?") text: qsTr("Use OS customization?")
} }
Text { Text {
@ -85,7 +87,7 @@ Popup {
Layout.topMargin: 25 Layout.topMargin: 25
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Accessible.name: text.replace(/<\/?[^>]+(>|$)/g, "") Accessible.name: text.replace(/<\/?[^>]+(>|$)/g, "")
text: qsTr("Would you like to apply image customization settings?") text: qsTr("Would you like to apply OS customization settings?")
} }
RowLayout { RowLayout {
@ -94,38 +96,6 @@ Popup {
spacing: 20 spacing: 20
id: buttons id: buttons
ImButton {
text: qsTr("NO")
onClicked: {
msgpopup.close()
msgpopup.no()
}
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
Material.background: "#c51a4a"
}
ImButton {
text: qsTr("NO, CLEAR SETTINGS")
onClicked: {
msgpopup.close()
msgpopup.noClearSettings()
}
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
Material.background: "#c51a4a"
enabled: imageWriter.hasSavedCustomizationSettings() ? true : false
}
ImButton {
text: qsTr("YES")
onClicked: {
msgpopup.close()
msgpopup.yes()
}
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
Material.background: "#c51a4a"
enabled: imageWriter.hasSavedCustomizationSettings() ? true : false
}
ImButton { ImButton {
text: qsTr("EDIT SETTINGS") text: qsTr("EDIT SETTINGS")
onClicked: { onClicked: {
@ -136,12 +106,56 @@ Popup {
Material.background: "#c51a4a" Material.background: "#c51a4a"
} }
ImButton {
id: noAndClearButton
text: qsTr("NO, CLEAR SETTINGS")
onClicked: {
msgpopup.close()
msgpopup.noClearSettings()
}
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
Material.background: "#c51a4a"
enabled: false
}
ImButton {
id: yesButton
text: qsTr("YES")
onClicked: {
msgpopup.close()
msgpopup.yes()
}
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
Material.background: "#c51a4a"
enabled: false
}
ImButton {
text: qsTr("NO")
onClicked: {
msgpopup.close()
msgpopup.no()
}
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
Material.background: "#c51a4a"
}
Text { text: " " } Text { text: " " }
} }
} }
function openPopup() { function openPopup() {
open() open()
if (hasSavedSettings) {
/* HACK: Bizarrely, the button enabled characteristics are not re-evaluated on open.
* So, let's manually _force_ these buttons to be enabled */
yesButton.enabled = true
noAndClearButton.enabled = true
} else {
yesButton.enabled = false
noAndClearButton.enabled = false
}
// trigger screen reader to speak out message // trigger screen reader to speak out message
msgpopupbody.forceActiveFocus() msgpopupbody.forceActiveFocus()
} }

View file

@ -282,13 +282,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation>Opcions avançades</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation>Opcions de personalització de les imatges</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -319,13 +319,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation>Erweiterte Optionen</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation>OS-Modifizierungen</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -278,12 +278,12 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>

View file

@ -282,13 +282,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation>Opciones avanzadas</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation>Opciones de personalización de imagen</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -318,13 +318,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation>Réglages avancés</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation>Options de personnalisation de l&apos;image</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -319,13 +319,13 @@ Aggiungi sia &apos;rpi-imager.exe&apos; che &apos;fat32format.exe&apos; all&apos
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation>Opzioni avanzate</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation>Opzioni personalizzazione immagine</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -318,13 +318,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -318,13 +318,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation> </translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation> </translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -318,13 +318,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation>Geavanceerde instellingen</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation>Image instellingen</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -318,13 +318,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation>Дополнительные параметры</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation>Параметры настройки образа</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -318,13 +318,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation>Pokročilé možnosti</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation>Možnosti úprav obrazu</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -318,13 +318,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation>Napredne možnosti</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation>Uporabi opcije prilagoditve slike diska</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -290,12 +290,12 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>

View file

@ -282,13 +282,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation>Розширені налаштування</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation>Налаштування образу</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -306,13 +306,13 @@
<name>OptionsPopup</name> <name>OptionsPopup</name>
<message> <message>
<location filename="../OptionsPopup.qml" line="20"/> <location filename="../OptionsPopup.qml" line="20"/>
<source>Advanced options</source> <source>OS customization</source>
<translation></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="52"/> <location filename="../OptionsPopup.qml" line="52"/>
<source>Image customization options</source> <source>OS customization options</source>
<translation></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../OptionsPopup.qml" line="57"/> <location filename="../OptionsPopup.qml" line="57"/>

View file

@ -1039,6 +1039,7 @@ void ImageWriter::setSavedCustomizationSettings(const QVariantMap &map)
_settings.setValue(key, map.value(key)); _settings.setValue(key, map.value(key));
} }
_settings.endGroup(); _settings.endGroup();
_settings.sync();
} }
QVariantMap ImageWriter::getSavedCustomizationSettings() QVariantMap ImageWriter::getSavedCustomizationSettings()
@ -1060,10 +1061,12 @@ void ImageWriter::clearSavedCustomizationSettings()
_settings.beginGroup("imagecustomization"); _settings.beginGroup("imagecustomization");
_settings.remove(""); _settings.remove("");
_settings.endGroup(); _settings.endGroup();
_settings.sync();
} }
bool ImageWriter::hasSavedCustomizationSettings() bool ImageWriter::hasSavedCustomizationSettings()
{ {
_settings.sync();
_settings.beginGroup("imagecustomization"); _settings.beginGroup("imagecustomization");
bool result = !_settings.childKeys().isEmpty(); bool result = !_settings.childKeys().isEmpty();
_settings.endGroup(); _settings.endGroup();

View file

@ -1183,6 +1183,10 @@ ApplicationWindow {
OptionsPopup { OptionsPopup {
id: optionspopup id: optionspopup
onSaveSettingsSignal: {
imageWriter.setSavedCustomizationSettings(settings)
usesavedsettingspopup.hasSavedSettings = true
}
} }
UseSavedSettingsPopup { UseSavedSettingsPopup {
@ -1196,6 +1200,8 @@ ApplicationWindow {
confirmwritepopup.askForConfirmation() confirmwritepopup.askForConfirmation()
} }
onNoClearSettings: { onNoClearSettings: {
hasSavedSettings = false
optionspopup.clearCustomizationFields()
imageWriter.clearSavedCustomizationSettings() imageWriter.clearSavedCustomizationSettings()
confirmwritepopup.askForConfirmation() confirmwritepopup.askForConfirmation()
} }