[gnome-weather] Mark the application busy when the model is loading



commit 25f4afca2f3e2307cd71fcae842c0c3dd018f471
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun Sep 8 18:46:50 2013 +0200

    Mark the application busy when the model is loading
    
    In theory, this should show a spinner next to the app menu while
    loading. In practice, it doesn't quite work...

 src/main.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/main.js b/src/main.js
index 33f1d74..bf708fb 100644
--- a/src/main.js
+++ b/src/main.js
@@ -94,6 +94,15 @@ const Application = new Lang.Class({
         this.world = GWeather.Location.get_world();
         this.model = new World.WorldModel(this.world);
 
+        this.model.connect('notify::loading', Lang.bind(this, function() {
+            if (this.model.loading)
+                this.mark_busy();
+            else
+                this.unmark_busy();
+        }));
+        if (this.model.loading)
+            this.mark_busy();
+
         Util.initActions(this,
                          [{ name: 'quit',
                             activate: this._onQuit }]);


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