QML UI: correctly set up the divecomputer for download

If we find a paired BT divecomputer, this will populate vendor and product
correctly for that device.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2017-06-05 09:18:17 -07:00
parent bde73f05d4
commit 8faf33eac6

View file

@ -58,13 +58,18 @@ Kirigami.Page {
Layout.fillWidth: true Layout.fillWidth: true
model: vendorList model: vendorList
currentIndex: manager.getVendorIndex() currentIndex: manager.getVendorIndex()
onCurrentTextChanged: {
comboProduct.model = manager.getDCListFromVendor(comboVendor.currentText)
if (currentIndex == manager.getVendorIndex())
comboProduct.currentIndex = manager.getProductIndex()
}
} }
Kirigami.Label { text: qsTr(" Dive Computer:") } Kirigami.Label { text: qsTr(" Dive Computer:") }
ComboBox { ComboBox {
id: comboProduct id: comboProduct
Layout.fillWidth: true Layout.fillWidth: true
model: manager.getDCListFromVendor(comboVendor.currentText) model: null
currentIndex: manager.getProductIndex() currentIndex: -1
} }
Kirigami.Label { text: qsTr("Bluetooth download:") } Kirigami.Label { text: qsTr("Bluetooth download:") }
CheckBox { CheckBox {