QML UI: add internal admin for virtual vendor

Added a list of paired BT devices for the "Paired BT Devices" vendor. The
devices under this vendor represent all BT devces that can be found
from the local BT interface. Some special processing is required, as
the BT provided data is (obviously) missing the specific data needed
to open a BT device using libdc code. This processing is not in
this commit, but will follow. This commit is preparation for that.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Jan Mulder 2017-06-10 10:09:56 +02:00 committed by Dirk Hohndel
parent c7a3509800
commit 790c0dcfc8
5 changed files with 75 additions and 21 deletions

View file

@ -57,11 +57,11 @@ Kirigami.Page {
id: comboVendor
Layout.fillWidth: true
model: vendorList
currentIndex: downloadThread.data().getDetectedVendorIndex()
currentIndex: downloadThread.data().getDetectedVendorIndex(currentText)
onCurrentTextChanged: {
comboProduct.model = downloadThread.data().getProductListFromVendor(comboVendor.currentText)
if (currentIndex == downloadThread.data().getDetectedVendorIndex())
comboProduct.currentIndex = downloadThread.data().getDetectedProductIndex()
if (currentIndex == downloadThread.data().getDetectedVendorIndex(currentText))
comboProduct.currentIndex = downloadThread.data().getDetectedProductIndex(currentText, comboProduct.currentText)
}
}
Kirigami.Label { text: qsTr(" Dive Computer:") }
@ -74,7 +74,7 @@ Kirigami.Page {
Kirigami.Label { text: qsTr("Bluetooth download:") }
CheckBox {
id: isBluetooth
checked: downloadThread.data().getDetectedVendorIndex() != -1
checked: downloadThread.data().getDetectedVendorIndex(ComboBox.currentText) != -1
}
}
@ -89,7 +89,8 @@ Kirigami.Page {
onClicked: {
text: qsTr("Retry")
if (downloadThread.deviceData.bluetoothMode) {
var addr = downloadThread.data().getDetectedDeviceAddress()
var addr = downloadThread.data().getDetectedDeviceAddress(comboVendor.currentText,
comboProduct.currentText)
if (addr !== "")
downloadThread.deviceData.devName = addr
}