[gnome-maps] layersPopover: Do not use dialog.run()



commit acc36734ea499921ae91fa829718de223e8d91ce
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Fri Mar 11 19:13:10 2016 +0100

    layersPopover: Do not use dialog.run()
    
    This can create situation where we can not interact with
    the map. Use asynchronous way instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763469

 src/layersPopover.js |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/layersPopover.js b/src/layersPopover.js
index 81bcede..f37109f 100644
--- a/src/layersPopover.js
+++ b/src/layersPopover.js
@@ -122,12 +122,14 @@ const LayersPopover = new Lang.Class({
             transient_for: this.get_parent(),
         });
 
-        if (fileChooser.run() === Gtk.ResponseType.OK) {
-            this._mapView.openShapeLayers(fileChooser.get_files());
-            this.hide();
-        }
-
-        fileChooser.destroy();
+        fileChooser.connect('response', (function(widget, response) {
+            if (response === Gtk.ResponseType.OK) {
+                this._mapView.openShapeLayers(fileChooser.get_files());
+                this.hide();
+            }
+            fileChooser.destroy();
+        }).bind(this));
+        fileChooser.show();
     },
 
     _listBoxCreateWidget: function(shapeLayer) {


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