[nautilus] always pass the parent window to the file operations



commit 73445a7927b31b09d4a8f44e856f35d178cce2ce
Author: William Jon McCann <jmccann redhat com>
Date:   Mon Jul 16 14:22:36 2012 -0400

    always pass the parent window to the file operations
    
    So that we can properly place resulting dialogs.

 libnautilus-private/nautilus-file-operations.c |    5 ++++-
 src/nautilus-places-sidebar.c                  |    5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c
index a4090ac..58e787f 100644
--- a/libnautilus-private/nautilus-file-operations.c
+++ b/libnautilus-private/nautilus-file-operations.c
@@ -2352,13 +2352,16 @@ volume_mount_cb (GObject *source_object,
 	if (!g_volume_mount_finish (G_VOLUME (source_object), res, &error)) {
 		if (error->code != G_IO_ERROR_FAILED_HANDLED &&
                     error->code != G_IO_ERROR_ALREADY_MOUNTED) {
+			GtkWindow *parent;
+
+			parent = gtk_mount_operation_get_parent (GTK_MOUNT_OPERATION (mount_op));
 			name = g_volume_get_name (G_VOLUME (source_object));
 			primary = g_strdup_printf (_("Unable to access %s"), name);
 			g_free (name);
 			success = FALSE;
 			eel_show_error_dialog (primary,
 					       error->message,
-					       NULL);
+					       parent);
 			g_free (primary);
 		}
 		g_error_free (error);
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index d0c1e9d..1298137 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -1795,7 +1795,8 @@ open_selected_bookmark (NautilusPlacesSidebar *sidebar,
 
 			sidebar->go_to_after_mount_flags = flags;
 
-			nautilus_file_operations_mount_volume_full (NULL, volume,
+			nautilus_file_operations_mount_volume_full (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (sidebar))),
+								    volume,
 								    volume_mounted_cb,
 								    G_OBJECT (sidebar));
 		} else if (volume == NULL && drive != NULL &&
@@ -1981,7 +1982,7 @@ mount_shortcut_cb (GtkMenuItem           *item,
 			    -1);
 
 	if (volume != NULL) {
-		nautilus_file_operations_mount_volume (NULL, volume);
+		nautilus_file_operations_mount_volume (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (sidebar))), volume);
 		g_object_unref (volume);
 	}
 }



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