[gimp] plug-ins: Minor readability improvement in GIF's save_dialog()



commit 84b8ec1f5c0f4d0751e9c0d5c876cb808bcee456
Author: Martin Nordholts <martinn src gnome org>
Date:   Wed Jan 6 18:51:22 2010 +0100

    plug-ins: Minor readability improvement in GIF's save_dialog()
    
    Add an animation_supported boolean to GIF's save_dialog().

 plug-ins/common/file-gif-save.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/file-gif-save.c b/plug-ins/common/file-gif-save.c
index b166914..4486f8d 100644
--- a/plug-ins/common/file-gif-save.c
+++ b/plug-ins/common/file-gif-save.c
@@ -1001,9 +1001,11 @@ save_dialog (gint32 image_ID)
   GimpParasite  *GIF2_CMNT;
 #endif
   gint32         nlayers;
+  gboolean       animation_supported = FALSE;
   gboolean       run;
 
   gimp_image_get_layers (image_ID, &nlayers);
+  animation_supported = nlayers > 1;
 
   dialog = gimp_export_dialog_new (_("GIF"), PLUG_IN_BINARY, SAVE_PROC);
 
@@ -1188,8 +1190,7 @@ save_dialog (gint32 image_ID)
   /* If the image has only one layer it can't be animated, so
      desensitize the animation options. */
 
-  if (nlayers == 1)
-    gtk_widget_set_sensitive (frame, FALSE);
+  gtk_widget_set_sensitive (frame, animation_supported);
 
   gtk_widget_show (frame);
   gtk_widget_show (dialog);



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