Add directory picker for OpenVR library

This commit is contained in:
Patrick Nicolas
2026-04-11 08:03:42 +02:00
parent 6db5b8aeb3
commit 2180ec5784
+17
View File
@@ -187,6 +187,14 @@ Kirigami.ScrollablePage {
}
}
Dialogs.FolderDialog{
id: openvr_browse
onAccepted: {
currentFolder = selectedFolder
openvr_text.text = WivrnServer.host_path(new URL(selectedFolder).pathname);
openvr_text.text = openvr_text.text.replace(/\/linux64$/, "").replace(/\/bin$/, "")
}
}
RowLayout {
Kirigami.FormData.label: i18n("OpenVR compatibility library:")
Layout.fillWidth: true
@@ -211,6 +219,10 @@ Kirigami.ScrollablePage {
}
}
}
onActivated: index => {
if (openvr_libs.get(index).is_custom && openvr_text.text == "")
openvr_browse.open()
}
}
Controls.TextField {
id: openvr_text
@@ -218,6 +230,11 @@ Kirigami.ScrollablePage {
visible: !!openvr_combobox.model.get(openvr_combobox.currentIndex)?.is_custom
Layout.fillWidth: true
}
Controls.Button {
text: i18nc("browse to choose the OpenVR compatility to use", "Browse")
visible: openvr_text.visible
onClicked: openvr_browse.open()
}
}
}