[gimp] app: warning message when compat mode set yet cannot be applied.



commit 9d9f30e7c0a1d20d2c46d3131171e243039c2ce2
Author: Jehan <jehan girinstud io>
Date:   Tue Sep 1 19:32:51 2015 +0200

    app: warning message when compat mode set yet cannot be applied.
    
    This would typically happen if the compat mode was set earlier through
    the save dialog, then later changes in the image render it inapplicable.
    When this happens, we unset the compat mode, and saves without error,
    but still emit a warning for the user to know the compatibility got
    dropped.

 app/actions/file-commands.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/app/actions/file-commands.c b/app/actions/file-commands.c
index c313dac..2ed08b5 100644
--- a/app/actions/file-commands.c
+++ b/app/actions/file-commands.c
@@ -261,12 +261,19 @@ file_save_cmd_callback (GtkAction *action,
 
           if (file && save_proc)
             {
-              gint rle_version;
-              gint zlib_version;
+              const gchar *version_string;
+              gint         rle_version;
+              gint         zlib_version;
 
-              gimp_image_get_xcf_version (image, FALSE, &rle_version,  NULL);
+              gimp_image_get_xcf_version (image, FALSE, &rle_version,  &version_string);
               gimp_image_get_xcf_version (image, TRUE,  &zlib_version, NULL);
 
+              if (rle_version == zlib_version && gimp_image_get_xcf_compat_mode (image))
+                gimp_message (image->gimp, G_OBJECT (display), GIMP_MESSAGE_WARNING,
+                              _("The image uses features from %s and "
+                                "cannot be saved for older GIMP "
+                                "versions."),
+                              version_string);
               saved = file_save_dialog_save_image (GIMP_PROGRESS (display),
                                                    gimp, image, file,
                                                    save_proc,


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