From 23df5938172cb1e76c5f154caf10a2d462916cfc Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Mon, 12 Jun 2017 10:38:24 +0200 Subject: Mobile: wrap up fixes for BT download on Android Major functional change in this commit is the addition of found static BT devices to the internal administration (on Android), in a way that is equivalent to mobile-on-desktop. So, in both cases, the list of devices in the app are as in the list of devices on the host OS (Linux or Android). To minimize code duplication, the btDeviceDiscovered slot is split in two parts, the part to act as slot for the Qt BT discovery agent (Linux, so mobile-on-desktop), and the part only needed for Android. Remaining to be fixed: the correct handling of the QML UI selection of vendor/product. The first default dive computer is correctly detected, all paired devices from the virtual vendow can be selected, but clicking through vendors results in non logical selections. It is obvious why this is, but a fix is not straigforward at this point. Signed-off-by: Jan Mulder Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DownloadFromDiveComputer.qml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index 66504c866..05a549227 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -53,13 +53,14 @@ Kirigami.Page { GridLayout { columns: 2 Kirigami.Label { text: qsTr(" Vendor name: ") } + property var vendoridx: downloadThread.data().getDetectedVendorIndex("") ComboBox { id: comboVendor Layout.fillWidth: true model: vendorList - currentIndex: downloadThread.data().getDetectedVendorIndex(currentText) + currentIndex: parent.vendoridx onCurrentTextChanged: { - comboProduct.model = downloadThread.data().getProductListFromVendor(comboVendor.currentText) + comboProduct.model = downloadThread.data().getProductListFromVendor(currentText) if (currentIndex == downloadThread.data().getDetectedVendorIndex(currentText)) comboProduct.currentIndex = downloadThread.data().getDetectedProductIndex(currentText, comboProduct.currentText) } @@ -67,9 +68,13 @@ Kirigami.Page { Kirigami.Label { text: qsTr(" Dive Computer:") } ComboBox { id: comboProduct + property var productidx: downloadThread.data().getDetectedProductIndex(comboVendor.currentText, currentText) Layout.fillWidth: true model: null - currentIndex: -1 + currentIndex: productidx + onModelChanged: { + currentIndex = productidx + } } Kirigami.Label { text: qsTr("Bluetooth download:") } CheckBox { -- cgit v1.2.3-70-g09d2