Add wait for child procs config UI

main
Peter Repukat 3 years ago
parent 8d9771f0ee
commit dac5694aa9

@ -76,6 +76,7 @@ void UIModel::readConfigs()
json["launchPath"] = filejson["launch"]["launchPath"];
json["launchAppArgs"] = filejson["launch"]["launchAppArgs"];
json["closeOnExit"] = filejson["launch"]["closeOnExit"];
json["waitForChildProcs"] = filejson["launch"]["waitForChildProcs"];
json["hideDevices"] = filejson["devices"]["hideDevices"];
json["windowMode"] = filejson["window"]["windowMode"];
json["maxFps"] = filejson["window"]["maxFps"];
@ -263,6 +264,7 @@ void UIModel::writeTarget(const QJsonObject& json, const QString& name)
launchObject["launchPath"] = json["launchPath"];
launchObject["launchAppArgs"] = json["launchAppArgs"];
launchObject["closeOnExit"] = json["closeOnExit"];
launchObject["waitForChildProcs"] = json["waitForChildProcs"];
fileJson["launch"] = launchObject;
QJsonObject devicesObject;

@ -86,14 +86,14 @@ GridView {
anchors.top: parent.top
anchors.left: parent.left
id: maybeIcon
source: modelData.icon
source: !!modelData.icon
? modelData.icon.endsWith(".exe")
? "image://exe/" + modelData.icon
: "file:///" + modelData.icon
: null
width: 48
height: 48
visible: modelData.icon
visible: !!modelData.icon
}
Label {
@ -116,10 +116,10 @@ GridView {
spacing: 8
Row {
spacing: 8
visible: modelData.launchPath && modelData.launchPath.length > 0
visible: !!modelData.launchPath && modelData.launchPath.length > 0
Label {
id: typeLabel
text: uiModel.isWindows && modelData.launchPath
text: uiModel.isWindows && !!modelData.launchPath
? modelData.launchPath.replace(/^.{1,3}:/, "").length < modelData.launchPath.length
? "Win32"
: "UWP"

@ -36,6 +36,7 @@ Item {
launchPath: null,
launchAppArgs: null,
closeOnExit: true,
waitForChildProcs: false,
hideDevices: true,
windowMode: false,
maxFps: null,
@ -51,6 +52,7 @@ Item {
launchPath: null,
launchAppArgs: null,
closeOnExit: true,
waitForChildProcs: false,
hideDevices: true,
windowMode: false,
maxFps: null,
@ -65,6 +67,7 @@ Item {
pathInput.text = shortcutInfo.launchPath || ""
argsInput.text = shortcutInfo.launchAppArgs || ""
closeOnExit.checked = shortcutInfo.closeOnExit || false
waitForChildren.checked = shortcutInfo.waitForChildProcs || false
hideDevices.checked = shortcutInfo.hideDevices || false
windowMode.checked = shortcutInfo.windowMode || false
}
@ -127,6 +130,20 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
}
CheckBox {
id: waitForChildren
text: qsTr("Close when all children processes quit")
checked: shortcutInfo.waitForChildProcs
onCheckedChanged: function(){
shortcutInfo.waitForChildProcs = checked
if (checked) {
closeOnExit.checked = true;
closeOnExit.enabled = false;
} else {
closeOnExit.enabled = true;
}
}
}
}
}
RowLayout {

Loading…
Cancel
Save