Index: gedit/gedit-file.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-file.c,v
retrieving revision 1.59
diff -u -p -r1.59 gedit-file.c
--- gedit/gedit-file.c	31 Dec 2003 00:44:22 -0000	1.59
+++ gedit/gedit-file.c	7 Jan 2004 11:58:32 -0000
@@ -37,11 +37,13 @@
 #include <libgnomevfs/gnome-vfs.h>
 
 #include <eel/eel-vfs-extensions.h>
+#include <eel/eel-alert-dialog.h>
 #include <eel/eel-string.h>
 
 #include "gedit2.h"
 #include "gedit-file.h"
 #include "gedit-debug.h"
+#include "gedit-document.h"
 #include "gedit-utils.h"
 #include "gedit-mdi.h"
 #include "gedit-recent.h" 
@@ -51,6 +53,8 @@
 #include "gedit-prefs-manager-app.h"
 #include "gedit-metadata-manager.h"
 
+#include "dialogs/gedit-dialogs.h"
+
 static gchar 	*get_dirname_from_uri 		(const char *uri);
 static gboolean  gedit_file_open_real 		(const gchar* file_name, 
 						 const GeditEncoding *encoding,
@@ -80,7 +84,6 @@ get_dirname_from_uri (const char *uri)
 	return name;
 }
 
-
 void 
 gedit_file_new (void)
 {
@@ -549,13 +552,14 @@ gedit_file_save_as_real (const gchar* fi
 	}
 }
 
-
 gboolean
 gedit_file_close_all (void)
 {
 	gboolean ret;
 	gedit_debug (DEBUG_FILE, "");
 
+	gedit_close_all_confirmation_dialog (gedit_mdi);
+
 	ret = bonobo_mdi_remove_all (BONOBO_MDI (gedit_mdi), FALSE);
 
 	if (bonobo_mdi_get_active_child (BONOBO_MDI (gedit_mdi)) == NULL)
Index: gedit/gedit-mdi.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-mdi.c,v
retrieving revision 1.77
diff -u -p -r1.77 gedit-mdi.c
--- gedit/gedit-mdi.c	6 Jan 2004 18:31:56 -0000	1.77
+++ gedit/gedit-mdi.c	7 Jan 2004 11:58:32 -0000
@@ -59,8 +59,7 @@
 #include "recent-files/egg-recent-view-gtk.h"
 #include "recent-files/egg-recent-model.h"
 #include "gedit-languages-manager.h"
-
-#include <eel/eel-alert-dialog.h>
+#include "dialogs/gedit-dialogs.h"
 
 #include <bonobo/bonobo-ui-util.h>
 #include <bonobo/bonobo-control.h>
@@ -958,6 +957,9 @@ gedit_mdi_remove_child_handler (BonoboMD
 	doc = GEDIT_MDI_CHILD (child)->document;
 
 	if (gedit_document_get_modified (doc) || gedit_document_get_deleted (doc))
+		close = gedit_close_confirmation_dialog (GEDIT_MDI (mdi),
+							 GEDIT_MDI_CHILD (child));
+#if 0
 	{
 		GtkWidget *msgbox, *w;
 		gchar *fname = NULL; 
@@ -1004,7 +1006,7 @@ gedit_mdi_remove_child_handler (BonoboMD
 		g_free (msg);
 		g_free (fname);
 
-#if 0		
+		
 		if (exiting)
 			gedit_dialog_add_button (GTK_DIALOG (msgbox),
 					_("_Don't quit"), GTK_STOCK_NO,
@@ -1013,7 +1015,6 @@ gedit_mdi_remove_child_handler (BonoboMD
 			gedit_dialog_add_button (GTK_DIALOG (msgbox),
 					_("_Don't close"), GTK_STOCK_NO,
                 	             	GTK_RESPONSE_NO);
-#endif
 		gedit_dialog_add_button (GTK_DIALOG (msgbox),
 				_("Do_n't save"), GTK_STOCK_NO,
 				GTK_RESPONSE_NO);
@@ -1045,7 +1046,7 @@ gedit_mdi_remove_child_handler (BonoboMD
 
 		gedit_debug (DEBUG_MDI, "CLOSE: %s", close ? "TRUE" : "FALSE");
 	}
-	
+#endif	
 	/* FIXME: there is a bug if you "close all" >1 docs, don't save the document
 	 * and then don't close the last one.
 	 */
Index: gedit/dialogs/Makefile.am
===================================================================
RCS file: /cvs/gnome/gedit/gedit/dialogs/Makefile.am,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile.am
--- gedit/dialogs/Makefile.am	23 Nov 2003 23:01:51 -0000	1.34
+++ gedit/dialogs/Makefile.am	7 Jan 2004 11:58:32 -0000
@@ -16,7 +16,7 @@ endif
 
 noinst_LTLIBRARIES = libdialogs.la
 
-libdialogs_la_SOURCES = 			\
+libdialogs_la_SOURCES = 		\
 	gedit-dialog-uri.c		\
 	gedit-dialog-goto-line.c	\
 	gedit-dialog-replace.c		\
@@ -33,6 +33,7 @@ libdialogs_la_SOURCES = 			\
 	gedit-encodings-dialog.h	\
 	gedit-page-setup-dialog.c	\
 	gedit-page-setup-dialog.h	\
+	gedit-close-confirmation-dialog.c \
 	gedit-dialogs.h		
 
 glade_DATA =				\
Index: gedit/dialogs/gedit-dialogs.h
===================================================================
RCS file: /cvs/gnome/gedit/gedit/dialogs/gedit-dialogs.h,v
retrieving revision 1.8
diff -u -p -r1.8 gedit-dialogs.h
--- gedit/dialogs/gedit-dialogs.h	26 Sep 2003 15:19:23 -0000	1.8
+++ gedit/dialogs/gedit-dialogs.h	7 Jan 2004 11:58:32 -0000
@@ -33,6 +33,8 @@
 #define __GEDIT_DIALOGS_H__
 
 #include <gtk/gtkwindow.h>
+#include "gedit-mdi.h"
+#include "gedit-mdi-child.h"
 
 GQuark gedit_was_wrap_around_quark (void);
 
@@ -48,4 +50,8 @@ gchar *gedit_plugin_program_location_dia
 					     const gchar *gconf_key,
 					     const gchar *help_id);
 
+gboolean gedit_close_confirmation_dialog (GeditMDI *mdi, GeditMDIChild *child);
+gboolean gedit_close_all_confirmation_dialog (GeditMDI *mdi);
+
+
 #endif /* __GEDIT_DIALOGS_H__ */
