diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2014-12-22 13:05:18 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2014-12-22 14:20:04 +0100 |
commit | 6634ff02232e306547bcff4c2a405a2d36f2b139 (patch) | |
tree | 32ad158e08a4bbed2412ad782cc2a4231119afdd /examples/bluetooth/chat/chat.qml | |
parent | 8eafcc2d6960390d6784a1c5bb075d6314041fdf (diff) |
Make chat example more error tolerant
It becomes more obvious on platforms which do not support Bluetooth
that the example will not work.
Change-Id: Ia6d249a4a891f93abf29910500ba164662308889
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'examples/bluetooth/chat/chat.qml')
-rw-r--r-- | examples/bluetooth/chat/chat.qml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/bluetooth/chat/chat.qml b/examples/bluetooth/chat/chat.qml index 6614d53c..6a2830ad 100644 --- a/examples/bluetooth/chat/chat.qml +++ b/examples/bluetooth/chat/chat.qml @@ -57,10 +57,18 @@ Item { //! [BtDiscoveryModel-1] onRunningChanged : { if (!btModel.running && top.state == "begin" && !serviceFound) { + searchBox.animationRunning = false; searchBox.appendText("\nNo service found. \n\nPlease start server\nand restart app.") } } + onErrorChanged: { + if (error != BluetoothDiscoveryModel.NoError && !btModel.running) { + searchBox.animationRunning = false + searchBox.appendText("\n\nDiscovery failed.\nPlease ensure Bluetooth is available.") + } + } + //! [BtDiscoveryModel-2] onServiceDiscovered: { if (serviceFound) |