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>
This commit is contained in:
Dirk Hohndel 2017-07-17 06:36:44 -07:00
parent ec1b22b487
commit 695be281c0

View file

@ -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")}