[gimp] app: Introduce file_save_dialog_unknown_ext_msg()



commit 7bddad13207fde2f614aa849a65dd8fa0f45ba56
Author: Martin Nordholts <martinn src gnome org>
Date:   Sat Apr 25 18:11:21 2009 +0200

    app: Introduce file_save_dialog_unknown_ext_msg()
    
    Introduce file_save_dialog_unknown_ext_msg() so that we don't need to
    have a copy-pasted huge error message (and prepare for more intricate
    message handling).
---
 ChangeLog                      |    7 +++++
 app/dialogs/file-save-dialog.c |   57 ++++++++++++++++++++++-----------------
 2 files changed, 39 insertions(+), 25 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7b5f065..3a036dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-25  Martin Nordholts  <martinn svn gnome org>
+
+	* app/dialogs/file-save-dialog.c: Introduce
+	file_save_dialog_unkown_ext_msg() so that we don't need to have a
+	copy-pasted huge error message (and prepare for more intricate
+	message handling).
+
 2009-04-24  Martin Nordholts  <martinn src gnome org>
 
 	Convert Subversion references to git
diff --git a/app/dialogs/file-save-dialog.c b/app/dialogs/file-save-dialog.c
index 0cf0254..16a69bc 100644
--- a/app/dialogs/file-save-dialog.c
+++ b/app/dialogs/file-save-dialog.c
@@ -55,21 +55,23 @@
 
 /*  local function prototypes  */
 
-static void      file_save_dialog_response      (GtkWidget            *save_dialog,
-                                                 gint                  response_id,
-                                                 Gimp                 *gimp);
-static gboolean  file_save_dialog_check_uri     (GtkWidget            *save_dialog,
-                                                 Gimp                 *gimp,
-                                                 gchar               **ret_uri,
-                                                 gchar               **ret_basename,
-                                                 GimpPlugInProcedure **ret_save_proc);
-static gboolean  file_save_dialog_use_extension (GtkWidget            *save_dialog,
-                                                 const gchar          *uri);
-static gboolean  file_save_dialog_save_image    (GtkWidget            *save_dialog,
-                                                 GimpImage            *image,
-                                                 const gchar          *uri,
-                                                 GimpPlugInProcedure  *save_proc,
-                                                 gboolean              save_a_copy);
+static void      file_save_dialog_response        (GtkWidget            *save_dialog,
+                                                   gint                  response_id,
+                                                   Gimp                 *gimp);
+static gboolean  file_save_dialog_check_uri       (GtkWidget            *save_dialog,
+                                                   Gimp                 *gimp,
+                                                   gchar               **ret_uri,
+                                                   gchar               **ret_basename,
+                                                   GimpPlugInProcedure **ret_save_proc);
+static void      file_save_dialog_unknown_ext_msg (GimpFileDialog       *dialog,
+                                                   Gimp                 *gimp);
+static gboolean  file_save_dialog_use_extension   (GtkWidget            *save_dialog,
+                                                   const gchar          *uri);
+static gboolean  file_save_dialog_save_image      (GtkWidget            *save_dialog,
+                                                   GimpImage            *image,
+                                                   const gchar          *uri,
+                                                   GimpPlugInProcedure  *save_proc,
+                                                   gboolean              save_a_copy);
 
 
 /*  public functions  */
@@ -298,11 +300,8 @@ file_save_dialog_check_uri (GtkWidget            *save_dialog,
               GIMP_LOG (SAVE_DIALOG,
                         "unable to figure save_proc, bailing out");
 
-              gimp_message (gimp, G_OBJECT (save_dialog), GIMP_MESSAGE_WARNING,
-                            _("The given filename does not have any known "
-                              "file extension. Please enter a known file "
-                              "extension or select a file format from the "
-                              "file format list."));
+              file_save_dialog_unknown_ext_msg (dialog, gimp);
+
               g_free (uri);
               g_free (basename);
               return FALSE;
@@ -334,11 +333,8 @@ file_save_dialog_check_uri (GtkWidget            *save_dialog,
           GIMP_LOG (SAVE_DIALOG,
                     "basename has no useful extension, bailing out");
 
-          gimp_message (gimp, G_OBJECT (save_dialog), GIMP_MESSAGE_WARNING,
-                        _("The given filename does not have any known "
-                          "file extension. Please enter a known file "
-                          "extension or select a file format from the "
-                          "file format list."));
+          file_save_dialog_unknown_ext_msg (dialog, gimp);
+
           g_free (uri);
           g_free (basename);
           return FALSE;
@@ -418,6 +414,17 @@ file_save_dialog_check_uri (GtkWidget            *save_dialog,
   return TRUE;
 }
 
+static void
+file_save_dialog_unknown_ext_msg (GimpFileDialog *dialog,
+                                  Gimp           *gimp)
+{
+  gimp_message (gimp, G_OBJECT (dialog), GIMP_MESSAGE_WARNING,
+                _("The given filename does not have any known "
+                  "file extension. Please enter a known file "
+                  "extension or select a file format from the "
+                  "file format list."));
+}
+
 static gboolean
 file_save_dialog_use_extension (GtkWidget   *save_dialog,
                                 const gchar *uri)



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