Implement auto-connect feature (#915)
* Auto connect * Move setting for auto usb to the applcation autostart --------- Co-authored-by: HttpAnimations <shawndouglasyt@gmail.com>
This commit is contained in:
co-authored by
HttpAnimations
parent
f3ebe5798e
commit
9dfb821853
@@ -76,5 +76,9 @@ Kirigami.MenuDialog {
|
||||
select_usb_device.connected_headset_count = nb_found;
|
||||
if (nb_found != 1)
|
||||
select_usb_device.connected_headset_serial = "";
|
||||
|
||||
if (DashboardSettings.auto_connect_usb && nb_found == 1 && !WivrnServer.headsetConnected) {
|
||||
Adb.startUsbConnection(select_usb_device.connected_headset_serial, WivrnServer.pin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,7 @@ Settings {
|
||||
|
||||
property bool adb_custom: false
|
||||
property string adb_location: ""
|
||||
|
||||
property bool auto_connect_usb: false
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,11 @@ Kirigami.ScrollablePage {
|
||||
Kirigami.FormData.label: i18n("Autostart application:")
|
||||
}
|
||||
|
||||
Controls.CheckBox {
|
||||
id: auto_connect_usb
|
||||
text: i18n("Auto connect from USB")
|
||||
}
|
||||
|
||||
Kirigami.Separator {
|
||||
Kirigami.FormData.isSection: true
|
||||
}
|
||||
@@ -285,6 +290,8 @@ Kirigami.ScrollablePage {
|
||||
Settings.debugGui = debug_gui.checked;
|
||||
Settings.steamVrLh = steamvr_lh.checked;
|
||||
Settings.hidForwarding = hid_forwarding.checked;
|
||||
|
||||
DashboardSettings.auto_connect_usb = auto_connect_usb.checked;
|
||||
}
|
||||
|
||||
function load() {
|
||||
@@ -293,6 +300,8 @@ Kirigami.ScrollablePage {
|
||||
steamvr_lh.checked = Settings.steamVrLh;
|
||||
hid_forwarding.checked = Settings.hidForwarding;
|
||||
|
||||
auto_connect_usb.checked = DashboardSettings.auto_connect_usb;
|
||||
|
||||
openvr_combobox.load()
|
||||
|
||||
adb_custom.checked = DashboardSettings.adb_custom;
|
||||
|
||||
Reference in New Issue
Block a user