mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
QML UI: only offer BT checkbox if BT is available
Right now we need to restart Subsurface-mobile in order to detect Bluetooth devices - so simply turning on BT after Subsurface-mobile was started is not sufficient. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2c111bb4cc
commit
b7b2e813ad
1 changed files with 10 additions and 8 deletions
|
@ -18,6 +18,7 @@ Kirigami.Page {
|
|||
property bool selectAll : false
|
||||
property alias dcImportModel: importModel
|
||||
property bool divesDownloaded: false
|
||||
property bool btEnabled: manager.btEnabled()
|
||||
|
||||
DCDownloadThread {
|
||||
id: downloadThread
|
||||
|
@ -85,11 +86,12 @@ Kirigami.Page {
|
|||
currentIndex = productidx
|
||||
}
|
||||
}
|
||||
Kirigami.Label { text: qsTr("Bluetooth download:") }
|
||||
Kirigami.Label { text: btEnabled ? qsTr("Bluetooth download:") : qsTr("No Bluetooth support detected")}
|
||||
CheckBox {
|
||||
id: isBluetooth
|
||||
checked: downloadThread.data().getDetectedVendorIndex(ComboBox.currentText) != -1
|
||||
indicator: Rectangle {
|
||||
visible: btEnabled
|
||||
implicitWidth: 20
|
||||
implicitHeight: 20
|
||||
x: isBluetooth.leftPadding
|
||||
|
@ -99,13 +101,13 @@ Kirigami.Page {
|
|||
color: subsurfaceTheme.backgroundColor
|
||||
|
||||
Rectangle {
|
||||
width: 12
|
||||
height: 12
|
||||
x: 4
|
||||
y: 4
|
||||
radius: 3
|
||||
color: isBluetooth.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
|
||||
visible: isBluetooth.checked
|
||||
width: 12
|
||||
height: 12
|
||||
x: 4
|
||||
y: 4
|
||||
radius: 3
|
||||
color: isBluetooth.down ? subsurfaceTheme.PrimaryColor : subsurfaceTheme.darkerPrimaryColor
|
||||
visible: btEnabled && isBluetooth.checked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue