[gnome-maps: 2/3] contextMenu: Make OSM edit and export view dialogs modal



commit 396612f842705cf51e6ee046cec9cb89b7dab077
Author: Marcus Lundblad <ml update uu se>
Date:   Sun Aug 6 21:34:15 2017 +0200

    contextMenu: Make OSM edit and export view dialogs modal
    
    Also add a property carrying the main window (for tracking
    dialog modality).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769604

 src/contextMenu.js |   10 +++++++---
 src/mainWindow.js  |    3 ++-
 2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/contextMenu.js b/src/contextMenu.js
index d803dca..e3a24a7 100644
--- a/src/contextMenu.js
+++ b/src/contextMenu.js
@@ -50,6 +50,9 @@ const ContextMenu = new Lang.Class({
         this._mapView = params.mapView;
         delete params.mapView;
 
+        this._mainWindow = params.mainWindow;
+        delete params.mainWindow;
+
         this.parent(params);
 
         this._mapView.connect('button-release-event',
@@ -147,7 +150,7 @@ const ContextMenu = new Lang.Class({
         let osmEdit = Application.osmEdit;
         /* if the user is not alread signed in, show the account dialog */
         if (!osmEdit.isSignedIn) {
-            let dialog = osmEdit.createAccountDialog(this.get_toplevel(), true);
+            let dialog = osmEdit.createAccountDialog(this._mainWindow, true);
 
             dialog.show();
             dialog.connect('response', (function(dialog, response) {
@@ -175,7 +178,7 @@ const ContextMenu = new Lang.Class({
         }
 
         let dialog =
-            osmEdit.createEditNewDialog(this.get_toplevel(),
+            osmEdit.createEditNewDialog(this._mainWindow,
                                       this._latitude, this._longitude);
 
         dialog.show();
@@ -195,7 +198,8 @@ const ContextMenu = new Lang.Class({
         let [latitude, longitude] = bbox.get_center();
 
         let dialog = new ExportViewDialog.ExportViewDialog({
-            transient_for: this.get_toplevel(),
+            transient_for: this._mainWindow,
+            modal: true,
             surface: surface,
             latitude: latitude,
             longitude: longitude,
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 671725c..164b0ef 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -107,7 +107,8 @@ const MainWindow = new Lang.Class({
 
         this._sidebar = this._createSidebar();
 
-        this._contextMenu = new ContextMenu.ContextMenu({ mapView: this._mapView });
+        this._contextMenu = new ContextMenu.ContextMenu({ mapView: this._mapView,
+                                                          mainWindow: this });
 
         this.layersPopover = new LayersPopover.LayersPopover({
             mapView: this._mapView


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