GlosSIConfig: ShortcutProps: Fix config not resetting on cancel

pull/183/head
Peter Repukat 2 years ago
parent 1bd3f075c1
commit e175b7046a

@ -67,13 +67,17 @@ Item {
} }
onShortcutInfoChanged: function() { onShortcutInfoChanged: function() {
nameInput.text = shortcutInfo.name || "" if (!shortcutInfo) {
if (extendedLogging) { return;
extendedLogging.checked = shortcutInfo.extendedLogging || false
} }
if (nameInput) { // basic info (not in collapsible container)
nameInput.text = shortcutInfo.name || ""
launchApp.checked = shortcutInfo.launch.launch launchApp.checked = shortcutInfo.launch.launch
pathInput.text = shortcutInfo.launch.launchPath || "" pathInput.text = shortcutInfo.launch.launchPath || ""
argsInput.text = shortcutInfo.launch.launchAppArgs || "" argsInput.text = shortcutInfo.launch.launchAppArgs || ""
}
if (extendedLogging) { // advanced settings (collapsible container)
extendedLogging.checked = shortcutInfo.extendedLogging || false
closeOnExit.checked = shortcutInfo.launch.closeOnExit closeOnExit.checked = shortcutInfo.launch.closeOnExit
waitForChildren.checked = shortcutInfo.launch.waitForChildProcs waitForChildren.checked = shortcutInfo.launch.waitForChildProcs
hideDevices.checked = shortcutInfo.devices.hideDevices hideDevices.checked = shortcutInfo.devices.hideDevices
@ -86,6 +90,7 @@ Item {
allowDesktopConfig.checked = shortcutInfo.controller.allowDesktopConfig allowDesktopConfig.checked = shortcutInfo.controller.allowDesktopConfig
emulateDS4.checked = shortcutInfo.controller.emulateDS4 emulateDS4.checked = shortcutInfo.controller.emulateDS4
} }
}
Flickable { Flickable {
id: flickable id: flickable
@ -157,7 +162,7 @@ Item {
CheckBox { CheckBox {
id: launchApp id: launchApp
text: qsTr("Launch app") text: qsTr("Launch app")
checked: shortcutInfo.launch.launch checked: shortcutInfo ? shortcutInfo.launch.launch : false
onCheckedChanged: function() { onCheckedChanged: function() {
shortcutInfo.launch.launch = checked shortcutInfo.launch.launch = checked
if (checked) { if (checked) {
@ -748,6 +753,7 @@ Item {
Button { Button {
text: qsTr("Cancel") text: qsTr("Cancel")
onClicked: function() { onClicked: function() {
resetInfo();
cancel() cancel()
} }
} }

Loading…
Cancel
Save