diff options
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r-- | mobile-widgets/qml/DownloadFromDiveComputer.qml | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index b7f000a46..9086a2e0f 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -26,7 +26,7 @@ Kirigami.Page { deviceData.product : comboProduct.currentText //TODO: make this dynamic? - deviceData.devName : "/tmp/ttyS1" + deviceData.devName : comboConnection.currentText //TODO: Make this the default on the C++ deviceData.bluetoothMode : isBluetooth.checked @@ -82,10 +82,32 @@ Kirigami.Page { Layout.fillWidth: true model: null currentIndex: productidx + onCurrentTextChanged: { + var newIdx = downloadThread.data().getMatchingAddress(comboVendor.currentText, currentText) + if (newIdx != -1) + comboConnection.currentIndex = newIdx + } + onModelChanged: { currentIndex = productidx } } + Kirigami.Label { text: qsTr(" Connection:") } + ComboBox { + id: comboConnection + Layout.fillWidth: true + model: connectionListModel + currentIndex: -1 + onCurrentTextChanged: { + // pattern that matches BT addresses + var btAddr = /[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]/ ; + if (btAddr.test(currentText)) + isBluetooth.checked = true + else + isBluetooth.checked = false + } + } + Kirigami.Label { text: btEnabled ? qsTr("Bluetooth download:") : qsTr("No Bluetooth support detected")} CheckBox { id: isBluetooth |