Index: app/core/gimpmarshal.list
===================================================================
--- app/core/gimpmarshal.list	(revision 27191)
+++ app/core/gimpmarshal.list	(working copy)
@@ -44,6 +44,7 @@ VOID: INT
 VOID: INT, INT
 VOID: INT, INT, INT, INT
 VOID: OBJECT
+VOID: OBJECT, BOOLEAN
 VOID: OBJECT, INT
 VOID: OBJECT, OBJECT
 VOID: OBJECT, POINTER
Index: app/tools/gimplevelstool.c
===================================================================
--- app/tools/gimplevelstool.c	(revision 27191)
+++ app/tools/gimplevelstool.c	(working copy)
@@ -94,6 +94,10 @@ static gboolean   gimp_levels_tool_setti
                                                    const gchar       *filename,
                                                    GError           **error);
 
+static void       gimp_levels_tool_export_setup   (GimpSettingsBox      *settings_box,
+                                                   GtkFileChooserDialog *dialog,
+                                                   gboolean              export,
+                                                   GimpLevelsTool       *tool);
 static void       gimp_levels_tool_config_notify  (GObject           *object,
                                                    GParamSpec        *pspec,
                                                    GimpLevelsTool    *tool);
@@ -361,6 +365,10 @@ gimp_levels_tool_dialog (GimpImageMapToo
   GtkObject        *data;
   gint              border;
 
+  g_signal_connect (image_map_tool->settings_box, "file-dialog-setup",
+                    G_CALLBACK (gimp_levels_tool_export_setup),
+                    image_map_tool);
+
   main_vbox   = gimp_image_map_tool_dialog_get_vbox (image_map_tool);
   label_group = gimp_image_map_tool_dialog_get_label_group (image_map_tool);
 
@@ -725,7 +733,7 @@ gimp_levels_tool_settings_import (GimpIm
 {
   GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
   FILE           *file;
-  gboolean        success;
+  gchar           header[64];
 
   file = g_fopen (filename, "rt");
 
@@ -738,11 +746,34 @@ gimp_levels_tool_settings_import (GimpIm
       return FALSE;
     }
 
-  success = gimp_levels_config_load_cruft (tool->config, file, error);
+  if (! fgets (header, sizeof (header), file))
+    {
+      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                   _("Could not read header from '%s': %s"),
+                   gimp_filename_to_utf8 (filename),
+                   g_strerror (errno));
+      fclose (file);
+      return FALSE;
+    }
+
+  if (g_str_has_prefix (header, "# GIMP Levels File\n"))
+    {
+      gboolean success;
+
+      rewind (file);
+
+      success = gimp_levels_config_load_cruft (tool->config, file, error);
+
+      fclose (file);
+
+      return success;
+    }
 
   fclose (file);
 
-  return success;
+  return GIMP_IMAGE_MAP_TOOL_CLASS (parent_class)->settings_import (image_map_tool,
+                                                                    filename,
+                                                                    error);
 }
 
 static gboolean
@@ -751,25 +782,55 @@ gimp_levels_tool_settings_export (GimpIm
                                   GError           **error)
 {
   GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
-  FILE           *file;
-  gboolean        success;
 
-  file = g_fopen (filename, "wt");
-
-  if (! file)
+  if (tool->export_old_format)
     {
-      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
-                   _("Could not open '%s' for writing: %s"),
-                   gimp_filename_to_utf8 (filename),
-                   g_strerror (errno));
-      return FALSE;
+      FILE     *file;
+      gboolean  success;
+
+      file = g_fopen (filename, "wt");
+
+      if (! file)
+        {
+          g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                       _("Could not open '%s' for writing: %s"),
+                       gimp_filename_to_utf8 (filename),
+                       g_strerror (errno));
+          return FALSE;
+        }
+
+      success = gimp_levels_config_save_cruft (tool->config, file, error);
+
+      fclose (file);
+
+      return success;
     }
 
-  success = gimp_levels_config_save_cruft (tool->config, file, error);
+  return GIMP_IMAGE_MAP_TOOL_CLASS (parent_class)->settings_export (image_map_tool,
+                                                                    filename,
+                                                                    error);
+}
 
-  fclose (file);
+static void
+gimp_levels_tool_export_setup (GimpSettingsBox      *settings_box,
+                               GtkFileChooserDialog *dialog,
+                               gboolean              export,
+                               GimpLevelsTool       *tool)
+{
+  GtkWidget *button;
 
-  return success;
+  if (! export)
+    return;
+
+  button = gtk_check_button_new_with_label (_("Save old levels format"));
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+                                tool->export_old_format);
+  gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), button);
+  gtk_widget_show (button);
+
+  g_signal_connect (button, "toggled",
+                    G_CALLBACK (gimp_toggle_button_update),
+                    &tool->export_old_format);
 }
 
 static void
Index: app/tools/gimplevelstool.h
===================================================================
--- app/tools/gimplevelstool.h	(revision 27191)
+++ app/tools/gimplevelstool.h	(working copy)
@@ -61,6 +61,9 @@ struct _GimpLevelsTool
   GtkAdjustment        *high_output;
 
   GtkWidget            *active_picker;
+
+  /* export dialog */
+  gboolean              export_old_format;
 };
 
 struct _GimpLevelsToolClass
Index: app/tools/gimpcurvestool.c
===================================================================
--- app/tools/gimpcurvestool.c	(revision 27191)
+++ app/tools/gimpcurvestool.c	(working copy)
@@ -101,6 +101,10 @@ static gboolean   gimp_curves_tool_setti
                                                    const gchar          *filename,
                                                    GError              **error);
 
+static void       gimp_curves_tool_export_setup   (GimpSettingsBox      *settings_box,
+                                                   GtkFileChooserDialog *dialog,
+                                                   gboolean              export,
+                                                   GimpCurvesTool       *tool);
 static void       gimp_curves_tool_config_notify  (GObject              *object,
                                                    GParamSpec           *pspec,
                                                    GimpCurvesTool       *tool);
@@ -422,6 +426,10 @@ gimp_curves_tool_dialog (GimpImageMapToo
   GtkWidget        *bar;
   GtkWidget        *combo;
 
+  g_signal_connect (image_map_tool->settings_box, "file-dialog-setup",
+                    G_CALLBACK (gimp_curves_tool_export_setup),
+                    image_map_tool);
+
   main_vbox   = gimp_image_map_tool_dialog_get_vbox (image_map_tool);
   label_group = gimp_image_map_tool_dialog_get_label_group (image_map_tool);
 
@@ -605,7 +613,6 @@ gimp_curves_tool_settings_import (GimpIm
 {
   GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
   FILE           *file;
-  gboolean        success;
   gchar           header[64];
 
   file = g_fopen (filename, "rt");
@@ -631,6 +638,8 @@ gimp_curves_tool_settings_import (GimpIm
 
   if (g_str_has_prefix (header, "# GIMP Curves File\n"))
     {
+      gboolean success;
+
       rewind (file);
 
       success = gimp_curves_config_load_cruft (tool->config, file, error);
@@ -653,25 +662,55 @@ gimp_curves_tool_settings_export (GimpIm
                                   GError           **error)
 {
   GimpCurvesTool *tool = GIMP_CURVES_TOOL (image_map_tool);
-  FILE           *file;
-  gboolean        success;
 
-  file = g_fopen (filename, "wt");
-
-  if (! file)
+  if (tool->export_old_format)
     {
-      g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
-                   _("Could not open '%s' for writing: %s"),
-                   gimp_filename_to_utf8 (filename),
-                   g_strerror (errno));
-      return FALSE;
+      FILE     *file;
+      gboolean  success;
+
+      file = g_fopen (filename, "wt");
+
+      if (! file)
+        {
+          g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
+                       _("Could not open '%s' for writing: %s"),
+                       gimp_filename_to_utf8 (filename),
+                       g_strerror (errno));
+          return FALSE;
+        }
+
+      success = gimp_curves_config_save_cruft (tool->config, file, error);
+
+      fclose (file);
+
+      return success;
     }
 
-  success = gimp_curves_config_save_cruft (tool->config, file, error);
+  return GIMP_IMAGE_MAP_TOOL_CLASS (parent_class)->settings_export (image_map_tool,
+                                                                    filename,
+                                                                    error);
+}
+
+static void
+gimp_curves_tool_export_setup (GimpSettingsBox      *settings_box,
+                               GtkFileChooserDialog *dialog,
+                               gboolean              export,
+                               GimpCurvesTool       *tool)
+{
+  GtkWidget *button;
 
-  fclose (file);
+  if (! export)
+    return;
+
+  button = gtk_check_button_new_with_label (_("Save old curves format"));
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+                                tool->export_old_format);
+  gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), button);
+  gtk_widget_show (button);
 
-  return success;
+  g_signal_connect (button, "toggled",
+                    G_CALLBACK (gimp_toggle_button_update),
+                    &tool->export_old_format);
 }
 
 static void
Index: app/tools/gimpcurvestool.h
===================================================================
--- app/tools/gimpcurvestool.h	(revision 27191)
+++ app/tools/gimpcurvestool.h	(working copy)
@@ -48,6 +48,9 @@ struct _GimpCurvesTool
   GtkWidget            *yrange;
   GtkWidget            *graph;
   GtkWidget            *curve_type;
+
+  /* export dialog */
+  gboolean              export_old_format;
 };
 
 struct _GimpCurvesToolClass
Index: app/widgets/gimpsettingsbox.c
===================================================================
--- app/widgets/gimpsettingsbox.c	(revision 27191)
+++ app/widgets/gimpsettingsbox.c	(working copy)
@@ -44,6 +44,7 @@
 
 enum
 {
+  FILE_DIALOG_SETUP,
   IMPORT,
   EXPORT,
   LAST_SIGNAL
@@ -127,6 +128,17 @@ gimp_settings_box_class_init (GimpSettin
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
+  settings_box_signals[FILE_DIALOG_SETUP] =
+    g_signal_new ("file-dialog-setup",
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_LAST,
+                  G_STRUCT_OFFSET (GimpSettingsBoxClass, file_dialog_setup),
+                  NULL, NULL,
+                  gimp_marshal_VOID__OBJECT_BOOLEAN,
+                  G_TYPE_NONE, 2,
+                  GTK_TYPE_FILE_CHOOSER_DIALOG,
+                  G_TYPE_BOOLEAN);
+
   settings_box_signals[IMPORT] =
     g_signal_new ("import",
                   G_TYPE_FROM_CLASS (klass),
@@ -152,6 +164,7 @@ gimp_settings_box_class_init (GimpSettin
   object_class->set_property = gimp_settings_box_set_property;
   object_class->get_property = gimp_settings_box_get_property;
 
+  klass->file_dialog_setup   = NULL;
   klass->import              = NULL;
   klass->export              = NULL;
 
@@ -741,6 +754,10 @@ gimp_settings_box_file_dialog (GimpSetti
   gimp_help_connect (box->file_dialog, gimp_standard_help_func,
                      box->file_dialog_help_id, NULL);
 
+  /*  allow callbacks to add widgets to the dialog  */
+  g_signal_emit (box, settings_box_signals[FILE_DIALOG_SETUP], 0,
+                 box->file_dialog, save);
+
   gtk_widget_show (box->file_dialog);
 }
 
Index: app/widgets/gimpsettingsbox.h
===================================================================
--- app/widgets/gimpsettingsbox.h	(revision 27191)
+++ app/widgets/gimpsettingsbox.h	(working copy)
@@ -60,10 +60,13 @@ struct _GimpSettingsBoxClass
 {
   GtkHBoxClass  parent_class;
 
-  void (* import) (GimpSettingsBox *box,
-                   const gchar     *filename);
-  void (* export) (GimpSettingsBox *box,
-                   const gchar     *filename);
+  void (* file_dialog_setup) (GimpSettingsBox      *box,
+                              GtkFileChooserDialog *dialog,
+                              gboolean              export);
+  void (* import)            (GimpSettingsBox      *box,
+                              const gchar          *filename);
+  void (* export)            (GimpSettingsBox      *box,
+                              const gchar          *filename);
 };
 
 
