Add directory picker for OpenVR library
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user