mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
ec1b22b487
commit
695be281c0
1 changed files with 8 additions and 0 deletions
|
@ -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")}
|
||||
|
|
Loading…
Add table
Reference in a new issue