[PATCH] Fix for #164080, focus problem with the new url dnd stuff



Hi,

Here's a patch fixing #164080, "when dropping from mozilla, confirmation
dialog is under the browser's window". We need to call
gtk_window_set_focus_on_map to make sure the dnd action question window
gets put on top. For this I had to replace eel_run_simple_dialog with
code to create a stock GtkMessageDialog, but this should not change the
UI.

Cheers,
Jorn
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.655
diff -u -r1.655 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	23 Jan 2005 19:03:56 -0000	1.655
+++ src/file-manager/fm-directory-view.c	25 Jan 2005 17:19:55 -0000
@@ -7742,26 +7742,42 @@
 {
 	int button_pressed;
 	GdkDragAction result;
-	GtkWidget *parent_window;
+	GtkWindow *parent_window;
+	GtkWidget *dialog;
 
 	parent_window = NULL;
 
 	/* Don't use desktop window as parent, since that means
 	   we show up an all desktops etc */
 	if (! FM_IS_DESKTOP_ICON_VIEW (view)) {
-		parent_window = GTK_WIDGET (fm_directory_view_get_containing_window (view));
+		parent_window = GTK_WINDOW (fm_directory_view_get_containing_window (view));
 	}
-	
-	button_pressed = eel_run_simple_dialog (parent_window,
-			                        TRUE,
-			                        GTK_MESSAGE_QUESTION,
-                                                _("Download location?"),
-                                                _("You can download it or make a link to it."),
-                                                NULL, /* as per HIG */
-                                                _("Make a _Link"),
-                                                GTK_STOCK_CANCEL,
-                                                _("_Download"),
-                                                NULL);
+
+	dialog = gtk_message_dialog_new (parent_window,
+					 GTK_DIALOG_DESTROY_WITH_PARENT,
+					 GTK_MESSAGE_QUESTION,
+					 GTK_BUTTONS_NONE,
+					 _("Download location?"));
+
+	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+						  _("You can download it or make a link to it."));
+
+	gtk_dialog_add_button (GTK_DIALOG (dialog),
+			       _("Make a _Link"), 0);
+	gtk_dialog_add_button (GTK_DIALOG (dialog),
+			       GTK_STOCK_CANCEL, 1);
+	gtk_dialog_add_button (GTK_DIALOG (dialog),
+			       _("_Download"), 2);
+
+	gtk_window_set_title (GTK_WINDOW (dialog), ""); /* as per HIG */
+	gtk_window_set_focus_on_map (GTK_WINDOW (dialog), TRUE);
+	gtk_dialog_set_default_response (GTK_DIALOG (dialog), 2);
+
+	gtk_window_present (GTK_WINDOW (dialog));
+
+	button_pressed = gtk_dialog_run (GTK_DIALOG (dialog));
+
+	gtk_widget_destroy (dialog);
 
 	switch (button_pressed) {
 	case 0:


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