Re: [PATCH] bug 75212: empty trash dialog is modal

On Sat, 18 May 2002, Simon South wrote:

> I've posted a new patch for this bug on Bugzilla (and attached it to
> this e-mail) which fixes a problem in the original: closing the
> confirmation dialog's parent window before the dialog itself would cause
> a crash, as the parent_view pointer would be invald.
> The new patch does two things over the old one:
> 1.) Marks the confirmation dialog to be deleted along with its parent, and
> 2.) Catches the "delete" signal from the confirmation dialog, to make
> sure the dialog pointer is set to NULL when the dialog (or its parent)
> is closed.
> This seems to work fine now, but I wonder if a better strategy would be
> simply to always create the "Empty Trash?" dialog as a child of the root
> window.  I think that would mean the progress dialog would also have to
> be a child of the root, though... I'm sure there's a reason why it was
> written the way it was.

Having it transient for some window makes sure that the window manager 
places it in a semi-sane place.
Index: nautilus-file-operations.c
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file-operations.c,v
retrieving revision 1.152
diff -u -r1.152 nautilus-file-operations.c
--- nautilus-file-operations.c	2002/05/13 17:44:14	1.152
+++ nautilus-file-operations.c	2002/05/18 23:25:09
@@ -2202,56 +2205,79 @@
 	gnome_vfs_uri_list_free (trash_dir_list);
-static gboolean
-confirm_empty_trash (GtkWidget *parent_view)
+static void
+confirm_empty_trash_dialog_response_callback (GtkDialog *dialog,
+					      int response,
+					      GtkWidget *parent_view)
-	GtkDialog *dialog;
-	GtkWindow *parent_window;
-	int response;
+	g_assert (dialog == confirm_empty_trash_dialog);
+	g_assert (confirm_empty_trash_dialog != NULL);
-	/* Just Say Yes if the preference says not to confirm. */
-	if (!eel_preferences_get_boolean (NAUTILUS_PREFERENCES_CONFIRM_TRASH)) {
-		return TRUE;
+	if (response == GTK_RESPONSE_YES) {
+		do_empty_trash(parent_view);

Missing a space before the parenthesis here.

Otherwise it looks ok.

Do you want me to check it in?

 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a leather-clad albino Green Beret haunted by an iconic dead American 
confidante She's a pregnant motormouth lawyer with the soul of a mighty 
warrior. They fight crime! 

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