summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DownloadFromDiveComputer.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-12 04:16:37 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-12 04:16:39 -0700
commitb7b2e813ad21cb4c8d59a7a7940110c346e3bead (patch)
tree1e8befba1a89a75afb10b08da1eae24e13c3c325 /mobile-widgets/qml/DownloadFromDiveComputer.qml
parent2c111bb4cc368a3ff1faed38e0d6fade3912d201 (diff)
downloadsubsurface-b7b2e813ad21cb4c8d59a7a7940110c346e3bead.tar.gz
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>
Diffstat (limited to 'mobile-widgets/qml/DownloadFromDiveComputer.qml')
-rw-r--r--mobile-widgets/qml/DownloadFromDiveComputer.qml18
1 files changed, 10 insertions, 8 deletions
diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml
index c7f9de5f2..b7f000a46 100644
--- a/mobile-widgets/qml/DownloadFromDiveComputer.qml
+++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml
@@ -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
}
}
}