Index: nautilus-file-operations.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file-operations.c,v
retrieving revision 1.152
diff -u -p -r1.152 nautilus-file-operations.c
--- nautilus-file-operations.c	13 May 2002 17:44:14 -0000	1.152
+++ nautilus-file-operations.c	8 Jul 2002 19:39:38 -0000
@@ -2202,35 +2202,81 @@ do_empty_trash (GtkWidget *parent_view)
 	gnome_vfs_uri_list_free (trash_dir_list);
 }
 
-static gboolean
+static void
+confirm_empty_trash_cb (GtkWidget *dialog,
+			gint response_id,
+			GtkWidget *parent_view)
+{
+	gtk_object_destroy (GTK_OBJECT (dialog));
+
+	if (response_id == GTK_RESPONSE_YES)
+		do_empty_trash (parent_view);
+}
+
+static void
 confirm_empty_trash (GtkWidget *parent_view)
 {
-	GtkDialog *dialog;
+	GtkWidget *dialog;
 	GtkWindow *parent_window;
-	int response;
+	GtkWidget *hbox, *image, *label, *button, *align;
 
-	/* Just Say Yes if the preference says not to confirm. */
-	if (!eel_preferences_get_boolean (NAUTILUS_PREFERENCES_CONFIRM_TRASH)) {
-		return TRUE;
-	}
-	
 	parent_window = GTK_WINDOW (gtk_widget_get_toplevel (parent_view));
 
-	dialog = eel_show_yes_no_dialog (
-		_("Are you sure you want to permanently delete "
-		  "all of the items in the Trash?"),
-		_("Empty Trash?"),
-		_("Empty"),
-		GTK_STOCK_CANCEL,
-		parent_window);
-
-	gtk_dialog_set_default_response (dialog, GTK_RESPONSE_CANCEL);
-
-	response = gtk_dialog_run (dialog);
-
-	gtk_object_destroy (GTK_OBJECT (dialog));
+	dialog = gtk_dialog_new ();
+	gtk_window_set_title (GTK_WINDOW (dialog), _("Empty Trash"));
+	gtk_window_set_wmclass (GTK_WINDOW (dialog), "empty_trash",
+				"Nautilus");
+	gtk_window_set_transient_for (GTK_WINDOW (dialog),
+				      GTK_WINDOW (parent_window));
+
+	hbox = gtk_hbox_new (FALSE, 6);
+	gtk_widget_show (hbox);
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
+			    FALSE, FALSE, 0);
+
+	image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION,
+					  GTK_ICON_SIZE_DIALOG);
+	gtk_widget_show (image);
+	gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+
+	label = gtk_label_new (_("Are you sure you want to permanently delete "
+				 "all of the items in the Trash?"));
+	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+	gtk_widget_show (label);
+	gtk_box_pack_start (GTK_BOX (hbox), label,
+			    TRUE, TRUE, 0);
+
+	gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL,
+			       GTK_RESPONSE_CANCEL);
+
+	/* Create the "Empty" button using the stock Delete icon. GTK+ doesn't
+	   have an easy way to do this yet, so this is mainly copied from
+	   gtk_button_construct_child(). */
+	button = gtk_button_new ();
+	GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+	label = gtk_label_new_with_mnemonic (_("_Empty"));
+	gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (button));
+	image = gtk_image_new_from_stock (GTK_STOCK_DELETE,
+					  GTK_ICON_SIZE_BUTTON);
+	hbox = gtk_hbox_new (FALSE, 2);
+	align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+	gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+	gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+	gtk_container_add (GTK_CONTAINER (button), align);
+	gtk_container_add (GTK_CONTAINER (align), hbox);
+	gtk_widget_show_all (button);
+
+	gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button,
+				      GTK_RESPONSE_YES);
+
+	gtk_dialog_set_default_response (GTK_DIALOG (dialog),
+					 GTK_RESPONSE_YES);
+
+	g_signal_connect (dialog, "response",
+			  G_CALLBACK (confirm_empty_trash_cb),
+			  parent_view);
 
-	return response == GTK_RESPONSE_YES;
+	gtk_widget_show (dialog);
 }
 
 void 
@@ -2238,19 +2284,9 @@ nautilus_file_operations_empty_trash (Gt
 {
 	g_return_if_fail (parent_view != NULL);
 
-	/* 
-	 * I chose to use a modal confirmation dialog here. 
-	 * If we used a modeless dialog, we'd have to do work to
-	 * make sure that no more than one appears on screen at
-	 * a time. That one probably couldn't be parented, because
-	 * otherwise you'd get into weird layer-shifting problems
-	 * selecting "Empty Trash" from one window when there was
-	 * already a modeless "Empty Trash" dialog parented on a 
-	 * different window. And if the dialog were not parented, it
-	 * might show up in some weird place since window manager
-	 * placement is unreliable (i.e., sucks). So modal it is.
-	 */
-	if (confirm_empty_trash (parent_view)) {
+	if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_CONFIRM_TRASH)) {
+		confirm_empty_trash (parent_view);
+	} else {
 		do_empty_trash (parent_view);
 	}
 }
