[gnome-maps/wip/contacts: 73/81] mainWindow: Add markBusy method



commit a7254c1a45c38681075bbb484320fc3441347f7b
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Tue Dec 16 04:37:58 2014 -0500

    mainWindow: Add markBusy method
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741591

 src/mainWindow.js |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 6b91412..106c17a 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -29,6 +29,7 @@ const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 
 const Application = imports.application;
+const BusyMarker = imports.busyMarker;
 const ContextMenu = imports.contextMenu;
 const FavoritesPopover = imports.favoritesPopover;
 const Geoclue = imports.geoclue;
@@ -84,12 +85,16 @@ const MainWindow = new Lang.Class({
         this._toggleSidebarButton = ui.toggleSidebarButton;
         this._layersButton = ui.layersButton;
         this._favoritesButton = ui.favoritesButton;
+        this._busy = new BusyMarker.BusyMarker();
+        this._overlay.add_overlay(this._busy);
 
         this._initHeaderbar();
         this._initActions();
         this._initSignals();
         this._restoreWindowGeometry();
 
+        this._busySignalId = 0;
+
         ui.grid.attach(this._sidebar, 1, 0, 1, 1);
 
         ui.grid.show_all();
@@ -371,5 +376,25 @@ const MainWindow = new Lang.Class({
         aboutDialog.show();
         aboutDialog.connect('response',
                             aboutDialog.destroy.bind(aboutDialog));
+    },
+
+    markBusy: function() {
+        if (this._busySignalId !== 0)
+            return;
+
+        this._busy.show();
+
+        let stage = this.mapView.view.get_stage();
+        this._busySignalId = stage.connect('captured-event', function() {
+            return true;
+        });
+    },
+
+    unmarkBusy: function() {
+        this._busy.hide();
+
+        let stage = this.mapView.view.get_stage();
+        stage.disconnect(this._busySignalId);
+        this._busySignalId = 0;
     }
 });


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