From ba4058667a21a278a394054fea70595358ac41f2 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Thu, 12 Oct 2017 09:43:40 +0200 Subject: mobile: enable switching BT on/off during session. This commit implements possible switching BT on and off during a session, so not needing a restart of the app when the user forgot to switch it on when starting the app. For this, the following needed to be done: 1) create a handler that reacts on local BT device status changes. 2) repopulate the connection list in the download screen when a BT status change is detected. Notice the subtile change of the Q_INVOKABLE btEnabled() function to a Q_PROPERTY. This gives a nice dynamic behaviour when switching BT on/off with the app open. Fixes: #556 Signed-off-by: Jan Mulder --- mobile-widgets/qml/DownloadFromDiveComputer.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index 9ff0494c0..b7857f871 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -17,8 +17,8 @@ Kirigami.Page { property alias dcImportModel: importModel property bool divesDownloaded: false - property bool btEnabled: manager.btEnabled() - property string btMessage: manager.btEnabled() ? "" : qsTr("Bluetooth is not enabled") + property bool btEnabled: manager.btEnabled + property string btMessage: manager.btEnabled ? "" : qsTr("Bluetooth is not enabled") DCDownloadThread { id: downloadThread -- cgit v1.2.3-70-g09d2