[gnome-weather] Application: delay showing the window until the model is fully loaded
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather] Application: delay showing the window until the model is fully loaded
- Date: Sun, 8 Sep 2013 16:53:45 +0000 (UTC)
commit 56c0f2e96a0b89df556230bdf02e4f414614d862
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Sun Sep 8 18:48:28 2013 +0200
Application: delay showing the window until the model is fully loaded
This way we avoid showing refresh icons every startup.
src/main.js | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/main.js b/src/main.js
index bf708fb..c1f8683 100644
--- a/src/main.js
+++ b/src/main.js
@@ -120,7 +120,16 @@ const Application = new Lang.Class({
},
vfunc_activate: function() {
- (new Window.MainWindow({ application: this })).show();
+ let win = new Window.MainWindow({ application: this });
+
+ if (this.model.loading) {
+ let id = this.model.connect('notify::loading', function(model) {
+ model.disconnect(id);
+ win.show();
+ });
+ } else {
+ win.show();
+ }
},
vfunc_shutdown: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]