[BluetoothChat] updated BluetoothChat sources
authorPiotr Dabrowski <p.dabrowski2@samsung.com>
Fri, 26 Jul 2013 13:10:20 +0000 (15:10 +0200)
committerPiotr Dabrowski <p.dabrowski2@samsung.com>
Fri, 26 Jul 2013 13:10:20 +0000 (15:10 +0200)
Change-Id: Ie4376102eda50bc9959d81e8b595bef14c9bf05d

index.html
js/app.js
js/app.ui.events.js
templates/visibility_popup.tpl

index 5f32098..6ea618f 100644 (file)
@@ -27,7 +27,7 @@
                                <div data-role="button" class="ui-btn-start" id="serverButton" style="display: none;">Create server</div>
                                <div data-role="button" class="ui-btn-start" id="clientButton" style="display: none;">Join server</div>
                                <div id="start-monit" style="display: none;">
-                                       <p>Waiting for Bluetooth radio...</p>
+                                       <p>Waiting for Bluetooth...</p>
                                </div>
                        </div>
                </div>
index 3c44ada..c02479e 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -180,6 +180,10 @@ var App = null;
                        }
                },
 
+               isBluetoothVisible: function App_isBluetoothVisible() {
+                       return this.model.adapter.visible;
+               },
+
                clearListOfServers: function App_clearListOfServers() {
                        this.ui.clearListOfServers();
                },
index 0d0088f..b92f846 100644 (file)
@@ -127,8 +127,8 @@ function UiEvents(parent) {
                        });
 
                        $('#chat').on('pageshow', function () {
-                               if (app.getApplicationMode() === 'server') {
-                                       setTimeout(function () { app.ui.showVisibilityPopup(); }, 100);
+                               if (app.getApplicationMode() === 'server' && !app.isBluetoothVisible()) {
+                                       setTimeout(function () { app.ui.showVisibilityPopup(); }, 500);
                                }
                        });
 
index 7616d86..037ef98 100644 (file)
@@ -1,6 +1,6 @@
 <div id="visibilityPopup" data-role="popup" class="center_basic_2btn">
        <div class="ui-popup-text">
-               Make your bluetooth radio visible
+               Please make your Bluetooth visible in Settings.
        </div>
        <div class="ui-popup-button-bg">
                <a data-role="button" data-inline="true" id="visibilityOK">OK</a>