[chrome-gnome-shell] Show information message while initializing extension



commit f1821b849befccd8723d85cd3407b6ae4ee07f14
Author: Yuri Konotopov <ykonotopov gmail com>
Date:   Sat Jul 16 19:12:14 2016 +0300

    Show information message while initializing extension

 extension/_locales/en/messages.json |    3 +++
 extension/include/constants.js      |    1 +
 extension/include/sweettooth-api.js |    7 +++++++
 3 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/extension/_locales/en/messages.json b/extension/_locales/en/messages.json
index e966c85..5e127d8 100644
--- a/extension/_locales/en/messages.json
+++ b/extension/_locales/en/messages.json
@@ -108,6 +108,9 @@
                "message": "Save"
        },
 
+       "connecting_host_app": {
+               "message": "Connecting to native host application…"
+       },
        "error_extension_response": {
                "message": "Wrong extension response received"
        },
diff --git a/extension/include/constants.js b/extension/include/constants.js
index c61e328..d18cbb8 100644
--- a/extension/include/constants.js
+++ b/extension/include/constants.js
@@ -28,6 +28,7 @@ DEFAULT_OPTIONS                               = {
 };
 
 EXTERNAL_MESSAGES = [
+       "connecting_host_app",
        "error_extension_response",
        "no_host_connector",
        "older_connector",
diff --git a/extension/include/sweettooth-api.js b/extension/include/sweettooth-api.js
index 263666e..1c08cbb 100644
--- a/extension/include/sweettooth-api.js
+++ b/extension/include/sweettooth-api.js
@@ -256,6 +256,9 @@ define('versions/common/common', ['jquery', 'dbus!API'], function($, API) {
 
 gs_chrome_initialized = true;
 require(['jquery', 'messages', 'gs-chrome'], function($, messages){
+       var connectingInfo = GSC.getMessage('connecting_host_app');
+       messages.addInfo(connectingInfo);
+
        SweetTooth.initialize(function(response) {
                SweetTooth.shellVersion                 = response.shellVersion;
                SweetTooth.versionValidationEnabled     = response.versionValidationEnabled;
@@ -269,6 +272,10 @@ require(['jquery', 'messages', 'gs-chrome'], function($, messages){
 
                        messages.addWarning(GSC.getMessage('warning_versions_mismatch', 
GSC.getMessage('version', GS_CHROME_VERSION), response.connectorVersion));
                }
+
+               $('#message_container')
+                       .find('.message:contains("' + connectingInfo + '")')
+                       .remove();
        }, function(message) {
                messages.addWarning(message ? message : GSC.getMessage('no_host_connector'));
        }, function() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]