diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-09-01 13:46:59 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-09-02 13:58:14 +0200 |
commit | 6837d143b456eb1f253b68704a5ff1b48bef4de4 (patch) | |
tree | 55d900db5b034498f9690aa508696dfc8978d736 /examples/bluetooth/lowenergyscanner/assets | |
parent | ffbe7708f87aea5e7919e7ca1029bfa24ce13bcd (diff) |
Add support for random vs public address selection to lowenergyscanner
Change-Id: I963f47f0089d072249b73bdfb0c715d43186b08d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'examples/bluetooth/lowenergyscanner/assets')
-rw-r--r-- | examples/bluetooth/lowenergyscanner/assets/Characteristics.qml | 9 | ||||
-rw-r--r-- | examples/bluetooth/lowenergyscanner/assets/Dialog.qml | 22 | ||||
-rw-r--r-- | examples/bluetooth/lowenergyscanner/assets/busy_dark.png | bin | 0 -> 1130 bytes | |||
-rw-r--r-- | examples/bluetooth/lowenergyscanner/assets/main.qml | 20 |
4 files changed, 45 insertions, 6 deletions
diff --git a/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml b/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml index 4a7db471..ac3b7151 100644 --- a/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml +++ b/examples/bluetooth/lowenergyscanner/assets/Characteristics.qml @@ -62,10 +62,13 @@ Rectangle { target: device onCharacteristicsUpdated: { menu.menuText = "Back" - if (characteristicview.count === 0) + if (characteristicview.count === 0) { info.dialogText = "No characteristic found" - else - info.visible = false; + info.busyImage = false + } else { + info.visible = false + info.busyImage = true + } } onDisconnected: { diff --git a/examples/bluetooth/lowenergyscanner/assets/Dialog.qml b/examples/bluetooth/lowenergyscanner/assets/Dialog.qml index be5388b5..2b8580f3 100644 --- a/examples/bluetooth/lowenergyscanner/assets/Dialog.qml +++ b/examples/bluetooth/lowenergyscanner/assets/Dialog.qml @@ -41,21 +41,39 @@ import QtQuick 2.0 Rectangle { - width: parent.width/2 + width: parent.width/3*2 height: 62 z: 50 property string dialogText: "" + property bool busyImage: true border.width: 1 border.color: "#363636" radius: 10 Text { + id: dialogTextId horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - anchors.fill: parent + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top; + anchors.topMargin: 10 + elide: Text.ElideMiddle text: dialogText color: "#363636" wrapMode: Text.Wrap } + + Image { + id: background + + width:20 + height:20 + anchors.top: dialogTextId.bottom + anchors.horizontalCenter: dialogTextId.horizontalCenter + visible: parent.busyImage + source: "busy_dark.png" + fillMode: Image.PreserveAspectFit + NumberAnimation on rotation { duration: 3000; from:0; to: 360; loops: Animation.Infinite} + } } diff --git a/examples/bluetooth/lowenergyscanner/assets/busy_dark.png b/examples/bluetooth/lowenergyscanner/assets/busy_dark.png Binary files differnew file mode 100644 index 00000000..3a105953 --- /dev/null +++ b/examples/bluetooth/lowenergyscanner/assets/busy_dark.png diff --git a/examples/bluetooth/lowenergyscanner/assets/main.qml b/examples/bluetooth/lowenergyscanner/assets/main.qml index 9f0395d5..e135d699 100644 --- a/examples/bluetooth/lowenergyscanner/assets/main.qml +++ b/examples/bluetooth/lowenergyscanner/assets/main.qml @@ -69,7 +69,7 @@ Rectangle { clip: true anchors.top: header.bottom - anchors.bottom: menu.top + anchors.bottom: connectToggle.top model: device.devicesList delegate: Rectangle { @@ -112,6 +112,24 @@ Rectangle { } Menu { + id: connectToggle + + menuWidth: parent.width + anchors.bottom: menu.top + menuText: { if (device.devicesList.length) + visible = true + else + visible = false + if (device.useRandomAddress) + "Address type: Random" + else + "Address type: Public" + } + + onButtonClick: device.useRandomAddress = !device.useRandomAddress; + } + + Menu { id: menu anchors.bottom: parent.bottom menuWidth: parent.width |