Index: app/actions/file-actions.c
===================================================================
RCS file: /cvs/gnome/gimp/app/actions/file-actions.c,v
retrieving revision 1.22
diff -u -p -r1.22 file-actions.c
--- app/actions/file-actions.c	15 Jun 2005 21:37:59 -0000	1.22
+++ app/actions/file-actions.c	24 Sep 2005 14:58:08 -0000
@@ -110,7 +110,12 @@ static GimpActionEntry file_actions[] =
   { "file-quit", GTK_STOCK_QUIT,
     N_("_Quit"), "<control>Q", NULL,
     G_CALLBACK (file_quit_cmd_callback),
-    GIMP_HELP_FILE_QUIT }
+    GIMP_HELP_FILE_QUIT },
+
+  { "file-close-all", NULL,
+    N_("Close all"), NULL, NULL,
+    G_CALLBACK (file_close_all_cmd_callback),
+    GIMP_HELP_FILE_CLOSE_ALL }
 };
 
 
Index: app/actions/file-commands.c
===================================================================
RCS file: /cvs/gnome/gimp/app/actions/file-commands.c,v
retrieving revision 1.92
diff -u -p -r1.92 file-commands.c
--- app/actions/file-commands.c	18 May 2005 21:01:51 -0000	1.92
+++ app/actions/file-commands.c	24 Sep 2005 14:58:11 -0000
@@ -369,6 +369,27 @@ file_quit_cmd_callback (GtkAction *actio
 }
 
 void
+file_close_all_cmd_callback (GtkAction *action,
+                             gpointer   data)
+{
+  Gimp *gimp;
+
+  return_if_no_gimp (gimp, data);
+
+  if (! gimp_displays_dirty (gimp))
+    gimp_displays_delete (gimp);
+  else
+    {
+      GtkWidget *widget;
+
+      return_if_no_widget (widget, data);
+      gimp_dialog_factory_dialog_raise (global_dialog_factory,
+                                        gtk_widget_get_screen (widget),
+                                        "gimp-close-all-dialog", -1);
+    }
+}
+
+void
 file_file_open_dialog (Gimp        *gimp,
                        const gchar *uri,
                        GtkWidget   *parent)
Index: app/actions/file-commands.h
===================================================================
RCS file: /cvs/gnome/gimp/app/actions/file-commands.h,v
retrieving revision 1.17
diff -u -p -r1.17 file-commands.h
--- app/actions/file-commands.h	21 Sep 2004 12:08:30 -0000	1.17
+++ app/actions/file-commands.h	24 Sep 2005 14:58:11 -0000
@@ -45,6 +45,8 @@ void   file_revert_cmd_callback         
                                           gpointer     data);
 void   file_quit_cmd_callback            (GtkAction   *action,
                                           gpointer     data);
+void   file_close_all_cmd_callback       (GtkAction   *action,
+                                          gpointer     data);
 
 void   file_file_open_dialog             (Gimp        *gimp,
                                           const gchar *uri,
Index: app/dialogs/dialogs-constructors.c
===================================================================
RCS file: /cvs/gnome/gimp/app/dialogs/dialogs-constructors.c,v
retrieving revision 1.170
diff -u -p -r1.170 dialogs-constructors.c
--- app/dialogs/dialogs-constructors.c	7 Sep 2005 00:28:30 -0000	1.170
+++ app/dialogs/dialogs-constructors.c	24 Sep 2005 14:58:15 -0000
@@ -174,6 +174,14 @@ dialogs_quit_get (GimpDialogFactory *fac
   return quit_dialog_new (context->gimp);
 }
 
+GtkWidget *
+dialogs_close_all_get (GimpDialogFactory *factory,
+                       GimpContext       *context,
+                       gint               preview_size)
+{
+  return close_all_dialog_new (context->gimp);
+}
+
 
 /***********/
 /*  docks  */
Index: app/dialogs/dialogs-constructors.h
===================================================================
RCS file: /cvs/gnome/gimp/app/dialogs/dialogs-constructors.h,v
retrieving revision 1.49
diff -u -p -r1.49 dialogs-constructors.h
--- app/dialogs/dialogs-constructors.h	3 Apr 2005 15:48:02 -0000	1.49
+++ app/dialogs/dialogs-constructors.h	24 Sep 2005 14:58:16 -0000
@@ -52,6 +52,9 @@ GtkWidget * dialogs_error_get           
 GtkWidget * dialogs_quit_get               (GimpDialogFactory *factory,
                                             GimpContext       *context,
                                             gint               preview_size);
+GtkWidget * dialogs_close_all_get          (GimpDialogFactory *factory,
+                                            GimpContext       *context,
+                                            gint               preview_size);
 
 
 /*  docks  */
Index: app/dialogs/dialogs.c
===================================================================
RCS file: /cvs/gnome/gimp/app/dialogs/dialogs.c,v
retrieving revision 1.85
diff -u -p -r1.85 dialogs.c
--- app/dialogs/dialogs.c	8 Jul 2005 22:54:44 -0000	1.85
+++ app/dialogs/dialogs.c	24 Sep 2005 14:58:17 -0000
@@ -104,7 +104,9 @@ static const GimpDialogFactoryEntry topl
   TOPLEVEL ("gimp-error-dialog",
             dialogs_error_get,       TRUE, FALSE, FALSE),
   TOPLEVEL ("gimp-quit-dialog",
-            dialogs_quit_get,        TRUE, FALSE, FALSE)
+            dialogs_quit_get,        TRUE, FALSE, FALSE),
+  TOPLEVEL ("gimp-close-all-dialog",
+            dialogs_close_all_get,   TRUE, FALSE, FALSE)
 };
 
 #define DOCKABLE(id,name,blurb,stock_id,help_id,\
Index: app/dialogs/quit-dialog.c
===================================================================
RCS file: /cvs/gnome/gimp/app/dialogs/quit-dialog.c,v
retrieving revision 1.22
diff -u -p -r1.22 quit-dialog.c
--- app/dialogs/quit-dialog.c	13 Sep 2005 18:21:06 -0000	1.22
+++ app/dialogs/quit-dialog.c	24 Sep 2005 14:58:19 -0000
@@ -45,17 +45,18 @@
 
 #include "gimp-intl.h"
 
-
-static void  quit_dialog_response          (GtkWidget         *dialog,
-                                            gint               response_id,
-                                            Gimp              *gimp);
-static void  quit_dialog_container_changed (GimpContainer     *images,
-                                            GimpObject        *image,
-                                            GimpMessageBox    *box);
-static void  quit_dialog_image_activated   (GimpContainerView *view,
-                                            GimpImage         *image,
-                                            gpointer           insert_data,
-                                            Gimp              *gimp);
+static GtkWidget * quit_close_all_dialog_new               (Gimp              *gimp,
+                                                            gboolean           do_quit);
+static void        quit_close_all_dialog_response          (GtkWidget         *dialog,
+                                                            gint               response_id,
+                                                            Gimp              *gimp);
+static void        quit_close_all_dialog_container_changed (GimpContainer     *images,
+                                                            GimpObject        *image,
+                                                            GimpMessageBox    *box);
+static void        quit_close_all_dialog_image_activated   (GimpContainerView *view,
+                                                            GimpImage         *image,
+                                                            gpointer           insert_data,
+                                                            Gimp              *gimp);
 
 
 /*  public functions  */
@@ -63,6 +64,19 @@ static void  quit_dialog_image_activated
 GtkWidget *
 quit_dialog_new (Gimp *gimp)
 {
+  return quit_close_all_dialog_new (gimp, TRUE);
+}
+
+GtkWidget *
+close_all_dialog_new (Gimp *gimp)
+{
+  return quit_close_all_dialog_new (gimp, FALSE);
+}
+
+static GtkWidget *
+quit_close_all_dialog_new (Gimp     *gimp,
+                           gboolean  do_quit)
+{
   GimpContainer  *images;
   GimpMessageBox *box;
   GtkWidget      *dialog;
@@ -96,7 +110,7 @@ quit_dialog_new (Gimp *gimp)
                           images, (GDestroyNotify) g_object_unref);
 
   g_signal_connect (dialog, "response",
-                    G_CALLBACK (quit_dialog_response),
+                    G_CALLBACK (quit_close_all_dialog_response),
                     gimp);
 
   box = GIMP_MESSAGE_DIALOG (dialog)->box;
@@ -104,12 +118,13 @@ quit_dialog_new (Gimp *gimp)
   button = gtk_dialog_add_button (GTK_DIALOG (dialog), "", GTK_RESPONSE_OK);
 
   g_object_set_data (G_OBJECT (box), "ok-button", button);
+  g_object_set_data (G_OBJECT (box), "do-quit", GINT_TO_POINTER (do_quit));
 
   g_signal_connect_object (images, "add",
-                           G_CALLBACK (quit_dialog_container_changed),
+                           G_CALLBACK (quit_close_all_dialog_container_changed),
                            box, 0);
   g_signal_connect_object (images, "remove",
-                           G_CALLBACK (quit_dialog_container_changed),
+                           G_CALLBACK (quit_close_all_dialog_container_changed),
                            box, 0);
 
   gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
@@ -128,7 +143,7 @@ quit_dialog_new (Gimp *gimp)
   gtk_widget_show (view);
 
   g_signal_connect (view, "activate-item",
-                    G_CALLBACK (quit_dialog_image_activated),
+                    G_CALLBACK (quit_close_all_dialog_image_activated),
                     gimp);
 
   dnd_widget = gimp_container_view_get_dnd_widget (GIMP_CONTAINER_VIEW (view));
@@ -136,8 +151,12 @@ quit_dialog_new (Gimp *gimp)
                            (GimpDndDragViewableFunc) gimp_dnd_get_drag_data,
                            NULL);
 
-  label = gtk_label_new (_("If you quit GIMP now, "
-                           "these changes will be lost."));
+  if (do_quit)
+    label = gtk_label_new (_("If you quit GIMP now, "
+                             "these changes will be lost."));
+  else
+    label = gtk_label_new (_("If close these files now, "
+                             "changes will be lost."));
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
   gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
@@ -145,32 +164,41 @@ quit_dialog_new (Gimp *gimp)
 
   g_object_set_data (G_OBJECT (box), "lost-label", label);
 
-  quit_dialog_container_changed (images, NULL,
-                                 GIMP_MESSAGE_DIALOG (dialog)->box);
+  quit_close_all_dialog_container_changed (images, NULL,
+                            GIMP_MESSAGE_DIALOG (dialog)->box);
 
   return dialog;
 }
 
 static void
-quit_dialog_response (GtkWidget *dialog,
-                      gint       response_id,
-                      Gimp      *gimp)
+quit_close_all_dialog_response (GtkWidget *dialog,
+                                gint       response_id,
+                                Gimp      *gimp)
 {
+  GimpMessageBox *box     = GIMP_MESSAGE_DIALOG (dialog)->box;
+  gboolean        do_quit = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (box), "do-quit"));
+
   gtk_widget_destroy (dialog);
 
   if (response_id == GTK_RESPONSE_OK)
-    gimp_exit (gimp, TRUE);
+    {
+      if (do_quit)
+        gimp_exit (gimp, TRUE);
+      else
+        gimp_displays_delete (gimp);
+    }
 }
 
-static void
-quit_dialog_container_changed (GimpContainer  *images,
-                               GimpObject     *image,
-                               GimpMessageBox *box)
+    static void
+quit_close_all_dialog_container_changed (GimpContainer  *images,
+                                         GimpObject     *image,
+                                         GimpMessageBox *box)
 {
   gint       num_images = gimp_container_num_children (images);
   GtkWidget *label      = g_object_get_data (G_OBJECT (box), "lost-label");
   GtkWidget *button     = g_object_get_data (G_OBJECT (box), "ok-button");
   GtkWidget *dialog     = gtk_widget_get_toplevel (button);
+  gboolean   do_quit    = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (box), "do-quit"));
   gchar     *text;
 
   text = g_strdup_printf (ngettext ("There is one image with unsaved changes:",
@@ -183,7 +211,7 @@ quit_dialog_container_changed (GimpConta
     {
       gtk_widget_hide (label);
       g_object_set (button,
-                    "label",     GTK_STOCK_QUIT,
+                    "label",     do_quit ? GTK_STOCK_QUIT : GTK_STOCK_CLOSE,
                     "use-stock", TRUE,
                     "image",     NULL,
                     NULL);
@@ -204,10 +232,10 @@ quit_dialog_container_changed (GimpConta
 }
 
 static void
-quit_dialog_image_activated (GimpContainerView *view,
-                             GimpImage         *image,
-                             gpointer           insert_data,
-                             Gimp              *gimp)
+quit_close_all_dialog_image_activated (GimpContainerView *view,
+                                       GimpImage         *image,
+                                       gpointer           insert_data,
+                                       Gimp              *gimp)
 {
   GList *list;
 
Index: app/dialogs/quit-dialog.h
===================================================================
RCS file: /cvs/gnome/gimp/app/dialogs/quit-dialog.h,v
retrieving revision 1.1
diff -u -p -r1.1 quit-dialog.h
--- app/dialogs/quit-dialog.h	9 Jul 2004 20:38:35 -0000	1.1
+++ app/dialogs/quit-dialog.h	24 Sep 2005 14:58:19 -0000
@@ -22,7 +22,9 @@
 #define __QUIT_DIALOG_H__
 
 
-GtkWidget * quit_dialog_new (Gimp *gimp);
+GtkWidget * quit_dialog_new       (Gimp *gimp);
+
+GtkWidget * close_all_dialog_new  (Gimp *gimp);
 
 
 #endif  /*  __QUIT_DIALOG_H__  */
Index: app/widgets/gimphelp-ids.h
===================================================================
RCS file: /cvs/gnome/gimp/app/widgets/gimphelp-ids.h,v
retrieving revision 1.69
diff -u -p -r1.69 gimphelp-ids.h
--- app/widgets/gimphelp-ids.h	19 Sep 2005 12:44:03 -0000	1.69
+++ app/widgets/gimphelp-ids.h	24 Sep 2005 14:58:25 -0000
@@ -39,6 +39,7 @@
 #define GIMP_HELP_FILE_REVERT                     "gimp-file-revert"
 #define GIMP_HELP_FILE_CLOSE                      "gimp-file-close"
 #define GIMP_HELP_FILE_QUIT                       "gimp-file-quit"
+#define GIMP_HELP_FILE_CLOSE_ALL                  "gimp-file-close-all"
 
 #define GIMP_HELP_EDIT_UNDO                       "gimp-edit-undo"
 #define GIMP_HELP_EDIT_REDO                       "gimp-edit-redo"
Index: menus/image-menu.xml.in
===================================================================
RCS file: /cvs/gnome/gimp/menus/image-menu.xml.in,v
retrieving revision 1.59
diff -u -p -r1.59 image-menu.xml.in
--- menus/image-menu.xml.in	23 Sep 2005 21:32:50 -0000	1.59
+++ menus/image-menu.xml.in	24 Sep 2005 14:58:34 -0000
@@ -33,6 +33,7 @@
       <placeholder name="Info" />
       <separator />
       <menuitem action="view-close" />
+      <menuitem action="file-close-all" />
       <menuitem action="file-quit" />
     </menu>
 
Index: menus/toolbox-menu.xml.in
===================================================================
RCS file: /cvs/gnome/gimp/menus/toolbox-menu.xml.in,v
retrieving revision 1.11
diff -u -p -r1.11 toolbox-menu.xml.in
--- menus/toolbox-menu.xml.in	26 Jun 2005 23:47:13 -0000	1.11
+++ menus/toolbox-menu.xml.in	24 Sep 2005 14:58:35 -0000
@@ -39,6 +39,7 @@
       </menu>
 
       <separator />
+      <menuitem action="file-close-all" />
       <menuitem action="file-quit" />
     </menu>
 
