mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 04:03:24 +00:00
android/usb: refresh USB device list on entering download from DC
The usbRescan() code is smart enough not to duplicate entries that might already be there. And with this the user doesn't have to manually tap rescan if they didn't open Subsurface-mobile via the intent after a device was plugged in. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ae537fc400
commit
4619b4932e
1 changed files with 4 additions and 0 deletions
|
@ -481,9 +481,13 @@ Kirigami.Page {
|
|||
comboVendor.currentIndex = comboProduct.currentIndex = comboConnection.currentIndex = -1
|
||||
dc1.enabled = dc2.enabled = dc3.enabled = dc4.enabled = true
|
||||
if (visible) {
|
||||
// we started the BT/BLE scan when Subsurface-mobile started, let's see if
|
||||
// that found something
|
||||
comboVendor.currentIndex = manager.getDetectedVendorIndex()
|
||||
comboProduct.currentIndex = manager.getDetectedProductIndex(comboVendor.currentText)
|
||||
comboConnection.currentIndex = manager.getMatchingAddress(comboVendor.currentText, comboProduct.currentText)
|
||||
// also check if there are USB devices (this only has an effect on Android)
|
||||
manager.usbRescan()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue