summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DownloadFromDiveComputer.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-17 06:36:44 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-17 07:36:44 -0700
commit695be281c0eac76b6a11a08e620376ce5dcab54e (patch)
tree44eaf5d53735d14c8475f6bf45dc6ba98650a31e /mobile-widgets/qml/DownloadFromDiveComputer.qml
parentec1b22b4871338cf74066a97811731b97e44277b (diff)
downloadsubsurface-695be281c0eac76b6a11a08e620376ce5dcab54e.tar.gz
QML UI: automatically set the Bluetooth checkbox
I wonder if we even need this anymore at all as the connection clearly determines whether this is a BT download or not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/DownloadFromDiveComputer.qml')
-rw-r--r--mobile-widgets/qml/DownloadFromDiveComputer.qml8
1 files changed, 8 insertions, 0 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml
index a4db5ef51..9086a2e0f 100644
--- a/mobile-widgets/qml/DownloadFromDiveComputer.qml
+++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml
@@ -98,6 +98,14 @@ Kirigami.Page {
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")}