QML UI: when triggering download page, set up vendor/product/connection

This only works if the USB device contains enough information to do so.
We need to collect more information to understand what information we
get if those get plugged in. Maybe we'll get only the vendor and need to
leave it to the user to set the product (which we can do by passing an
index of -1 for product).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-08-08 06:08:15 -07:00
parent 593978a473
commit e19944ce14

View file

@ -617,7 +617,13 @@ if you have network connectivity and want to sync your data to cloud storage."),
console.log("Download page requested by Android Intent, but adding/editing dive; no action taken")
} else {
console.log("Show download page for device " + pluggedInDeviceName)
diveList.showDownloadPage()
/* if we recognized the device, we'll pass in a triple of ComboBox indeces as "vendor;product;connection" */
var vendorProductConnection = pluggedInDeviceName.split(';')
if (vendorProductConnection.length === 3)
diveList.showDownloadPage(vendorProductConnection[0], vendorProductConnection[1], vendorProductConnection[2])
else
diveList.showDownloadPage()
console.log("done showing download page")
}
}