mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
Don't hide "use customization" when editing settings
Previously, if you clicked "edit settings" in the "use customisation" msgbox then the flow got a bit confusing, when you saved settings the "use customisation" msgbox would have disappeared and you had to click "next" and go back through again. Instead, keep the "use customisation" msgbox open when editing settings so when you save settings you are back where you left it. Also: - Make "use customisation" modal so you can't click other things while it's open - Separate windows in QtQuick can't be modal so we can't stop the user interacting with the main window while "edit settings" is open. This could get confusing, so if they close the "use customisation" modal in the main window then close the settings window. - Fix a bug where saved settings weren't recognised on startup, only after being saved during the session
This commit is contained in:
parent
338b71112e
commit
4ad4276154
2 changed files with 21 additions and 9 deletions
|
@ -17,6 +17,7 @@ Popup {
|
||||||
height: msgpopupbody.implicitHeight+150
|
height: msgpopupbody.implicitHeight+150
|
||||||
padding: 0
|
padding: 0
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||||
|
modal: true
|
||||||
|
|
||||||
property bool hasSavedSettings: false
|
property bool hasSavedSettings: false
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@ Popup {
|
||||||
signal no()
|
signal no()
|
||||||
signal noClearSettings()
|
signal noClearSettings()
|
||||||
signal editSettings()
|
signal editSettings()
|
||||||
|
signal closeSettings()
|
||||||
|
|
||||||
// background of title
|
// background of title
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -99,7 +101,11 @@ Popup {
|
||||||
ImButton {
|
ImButton {
|
||||||
text: qsTr("EDIT SETTINGS")
|
text: qsTr("EDIT SETTINGS")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
msgpopup.close()
|
// Don't close this dialog when "edit settings" is
|
||||||
|
// clicked, as we don't want the user to fall back to the
|
||||||
|
// start of the flow. After editing the settings we want
|
||||||
|
// then to once again have the choice about whether to use
|
||||||
|
// customisation or not.
|
||||||
msgpopup.editSettings()
|
msgpopup.editSettings()
|
||||||
}
|
}
|
||||||
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
|
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
|
||||||
|
@ -115,7 +121,7 @@ Popup {
|
||||||
}
|
}
|
||||||
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
|
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
|
||||||
Material.background: "#c51a4a"
|
Material.background: "#c51a4a"
|
||||||
enabled: false
|
enabled: hasSavedSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
ImButton {
|
ImButton {
|
||||||
|
@ -127,7 +133,7 @@ Popup {
|
||||||
}
|
}
|
||||||
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
|
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
|
||||||
Material.background: "#c51a4a"
|
Material.background: "#c51a4a"
|
||||||
enabled: false
|
enabled: hasSavedSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
ImButton {
|
ImButton {
|
||||||
|
@ -146,17 +152,20 @@ Popup {
|
||||||
|
|
||||||
function openPopup() {
|
function openPopup() {
|
||||||
open()
|
open()
|
||||||
if (hasSavedSettings) {
|
if (imageWriter.hasSavedCustomizationSettings()) {
|
||||||
/* HACK: Bizarrely, the button enabled characteristics are not re-evaluated on open.
|
/* HACK: Bizarrely, the button enabled characteristics are not re-evaluated on open.
|
||||||
* So, let's manually _force_ these buttons to be enabled */
|
* So, let's manually _force_ these buttons to be enabled */
|
||||||
yesButton.enabled = true
|
hasSavedSettings = 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()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onClosed: {
|
||||||
|
// Close the advanced options window if this msgbox is dismissed,
|
||||||
|
// in order to prevent the user from starting writing while the
|
||||||
|
// advanced options window is open.
|
||||||
|
closeSettings()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1208,6 +1208,9 @@ ApplicationWindow {
|
||||||
onEditSettings: {
|
onEditSettings: {
|
||||||
optionspopup.openPopup()
|
optionspopup.openPopup()
|
||||||
}
|
}
|
||||||
|
onCloseSettings: {
|
||||||
|
optionspopup.close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Utility functions */
|
/* Utility functions */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue