mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-01-31 02:01:19 +00:00
Fix issue with custom command not saving on exit
If the user directly closes the settings window without triggering the custom command Textfield's onEditingFinished (via unfocus or pressing enter), the custom command may not save. This change adds a listener to the Textfield so that if the settings window closes, the change will always be recorded.
This commit is contained in:
parent
cc57fbdcd5
commit
e94801ee02
@ -171,7 +171,7 @@ Tab{
|
||||
checked: appSettings.useCustomCommand
|
||||
onCheckedChanged: appSettings.useCustomCommand = checked
|
||||
}
|
||||
// workaround for QTBUG-31627 for pre 5.3.0
|
||||
// Workaround for QTBUG-31627 for pre 5.3.0
|
||||
Binding{
|
||||
target: useCustomCommand
|
||||
property: "checked"
|
||||
@ -179,10 +179,16 @@ Tab{
|
||||
}
|
||||
TextField{
|
||||
id: customCommand
|
||||
anchors {left: parent.left; right: parent.right}
|
||||
text: appSettings.customCommand
|
||||
enabled: useCustomCommand.checked
|
||||
onEditingFinished: appSettings.customCommand = text
|
||||
anchors {left: parent.left; right: parent.right}
|
||||
|
||||
// Save text even if user forgets to press enter or unfocus
|
||||
function saveSetting() {
|
||||
appSettings.customCommand = text;
|
||||
}
|
||||
Component.onCompleted: settings_window.closing.connect(saveSetting)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user