Mobile/download DC: simplify startup

Since we now store the last used DCs in out preferences we can use the information
to pre-populate the DC selector.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
Jocke 2018-09-23 11:47:22 +02:00 committed by Jan Mulder
parent 0a3130cd86
commit 69cead138b

View file

@ -348,13 +348,8 @@ Kirigami.Page {
onVisibleChanged: {
comboVendor.currentIndex = comboProduct.currentIndex = comboConnection.currentIndex = -1
if (visible) {
comboVendor.currentIndex = manager.getDetectedVendorIndex()
comboProduct.currentIndex = manager.getDetectedProductIndex(comboVendor.currentText)
comboConnection.currentIndex = manager.getMatchingAddress(comboVendor.currentText, comboProduct.currentText)
manager.DC_vendor = comboVendor.currentText
manager.DC_product = comboProduct.currentText
manager.DC_devName = comboConnection.currentText
if (visible && PrefDiveComputer.vendor !== "" ) {
rememberedDCsGrid.setDC(PrefDiveComputer.vendor1, PrefDiveComputer.product1, PrefDiveComputer.device1)
}
}
}