aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-11-01 18:36:56 -0700
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2019-04-05 15:29:08 +0900
commite856f2ffb7bb982f6cce5a40be1277001369865f (patch)
treef9ab11c91d529349d19d20e2eff28530e053395f
parentdb6cb3b82fe3441e0237da3e7578c17c17744902 (diff)
homescreen: bluetooth: switch bluetooth power status
Don't turn on/off bluetooth icon on homescreen when a device is connected, but when the adapter is powered on/off. This is the common functionality for most UIs Change-Id: If26d84da31433c461d06c157832f7b6bd744ef39 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--homescreen/qml/StatusArea.qml22
1 files changed, 3 insertions, 19 deletions
diff --git a/homescreen/qml/StatusArea.qml b/homescreen/qml/StatusArea.qml
index 8d01ea3..c7ad598 100644
--- a/homescreen/qml/StatusArea.qml
+++ b/homescreen/qml/StatusArea.qml
@@ -138,25 +138,9 @@ Item {
property bool connStatus: false
Connections {
target: bluetooth
- onConnectionEvent: {
- console.log("onConnectionEvent", data.Status)
- if (data.Status === "connected") {
- bt_icon.connStatus = true
- } else if (data.Status === "disconnected") {
- bt_icon.connStatus = false
- }
- }
- onDeviceUpdateEvent: {
- console.log("onConnectionEvent", data.Paired)
- if (data.Paired === "True" && data.Connected === "True") {
- bt_icon.deviceName = data.name
- bt_icon.connStatus = true
- } else {
- if(bt_icon.deviceName === data.Name)
- {
- bt_icon.connStatus = false
- }
- }
+
+ onPowerChanged: {
+ bt_icon.connStatus = state
}
}
}