[gimp] plug-in, libgimp: Fixes #6753: redesign of WebP Export dialog



commit d8062d1d77f5fea570821165d0e7a381b1dfd615
Author: Mayank Suman <mayanksuman live com>
Date:   Thu Jun 17 23:08:56 2021 +0530

    plug-in, libgimp: Fixes #6753: redesign of WebP Export dialog
    
    Added an option for exporting thumbnail in WebP Export dialogbox.
    
    Additionally, introduced a function gimp_procedure_dialog_fill_expander.
    The function is similar to gimp_procedure_dialog_fill_frame but allows
    adding GtkExpander instead of GtkFrame.

 libgimp/gimpproceduredialog.c         | 118 +++++++++++++++
 libgimp/gimpproceduredialog.h         |   6 +
 libgimp/gimpui.def                    |   1 +
 plug-ins/file-webp/file-webp-dialog.c | 274 ++++++++--------------------------
 plug-ins/file-webp/file-webp.c        |  72 ++++-----
 5 files changed, 214 insertions(+), 257 deletions(-)
---
diff --git a/libgimp/gimpproceduredialog.c b/libgimp/gimpproceduredialog.c
index 212db10a52..de8257f30a 100644
--- a/libgimp/gimpproceduredialog.c
+++ b/libgimp/gimpproceduredialog.c
@@ -1316,6 +1316,124 @@ gimp_procedure_dialog_fill_frame (GimpProcedureDialog *dialog,
 }
 
 
+/**
+ * gimp_procedure_dialog_fill_expander:
+ * @dialog:        the #GimpProcedureDialog.
+ * @container_id:  a container identifier.
+ * @title_id: (nullable): the identifier for the title widget.
+ * @invert_title:  whether to use the opposite value of @title_id if it
+ *                 represents a boolean widget.
+ * @contents_id: (nullable): the identifier for the contents.
+ *
+ * Creates a new #GtkExpander and packs @title_id as its title
+ * and @contents_id as content.
+ * If @title_id represents a boolean property, its value will be used to
+ * expand the #GtkExpander. If @invert_title is TRUE, then expand binding is
+ * inverted.
+ *
+ * The @container_id must be a unique ID which is neither the name of a
+ * property of the #GimpProcedureConfig associated to @dialog, nor is it
+ * the ID of any previously created container. This ID can later be used
+ * together with property names to be packed in other containers or
+ * inside @dialog itself.
+ *
+ * Returns: (transfer none): the #GtkWidget representing @container_id. The
+ *                           object belongs to @dialog and must not be
+ *                           freed.
+ */
+GtkWidget *
+gimp_procedure_dialog_fill_expander (GimpProcedureDialog *dialog,
+                                     const gchar         *container_id,
+                                     const gchar         *title_id,
+                                     gboolean             invert_title,
+                                     const gchar         *contents_id)
+{
+  GtkWidget *expander;
+  GtkWidget *contents = NULL;
+  GtkWidget *title    = NULL;
+
+  g_return_val_if_fail (container_id != NULL, NULL);
+
+  if (g_object_class_find_property (G_OBJECT_GET_CLASS (dialog->priv->config),
+                                    container_id))
+    {
+      g_warning ("%s: expander identifier '%s' cannot be an existing property name.",
+                 G_STRFUNC, container_id);
+      return NULL;
+    }
+
+  if ((expander = g_hash_table_lookup (dialog->priv->widgets, container_id)))
+    {
+      g_warning ("%s: expander identifier '%s' was already configured.",
+                 G_STRFUNC, container_id);
+      return expander;
+    }
+
+  expander = gtk_expander_new (NULL);
+
+  if (contents_id)
+    {
+      contents = gimp_procedure_dialog_get_widget (dialog, contents_id, G_TYPE_NONE);
+      if (! contents)
+        {
+          g_warning ("%s: no property or configured widget with identifier '%s'.",
+                     G_STRFUNC, contents_id);
+          return expander;
+        }
+
+      g_object_ref (contents);
+      gtk_container_add (GTK_CONTAINER (expander), contents);
+      gtk_widget_show (contents);
+    }
+
+  if (title_id)
+    {
+      title = gimp_procedure_dialog_get_widget (dialog, title_id, G_TYPE_NONE);
+      if (! title)
+        {
+          g_warning ("%s: no property or configured widget with identifier '%s'.",
+                     G_STRFUNC, title_id);
+          return expander;
+        }
+
+      g_object_ref (title);
+      gtk_expander_set_label_widget (GTK_EXPANDER (expander), title);
+      gtk_expander_set_resize_toplevel (GTK_EXPANDER (expander), TRUE);
+      gtk_widget_show (title);
+      g_object_bind_property (title,    "sensitive",
+                              expander, "sensitive",
+                              G_BINDING_SYNC_CREATE);
+
+      if (contents && (GTK_IS_CHECK_BUTTON (title) || GTK_IS_SWITCH (title)))
+        {
+          GBindingFlags flags = G_BINDING_SYNC_CREATE;
+          gboolean      active;
+
+          /* Workaround for connecting check button state to expanded state of
+           * GtkExpander. This is required as GtkExpander do not pass click
+           * events to label widget.
+           * Please see https://bugzilla.gnome.org/show_bug.cgi?id=705971
+           */
+          if (invert_title)
+            flags |= G_BINDING_INVERT_BOOLEAN;
+
+          g_object_get (title, "active", &active, NULL);
+          gtk_expander_set_expanded (GTK_EXPANDER (expander),
+                                     invert_title ?  ! active : active);
+          g_object_bind_property (expander, "expanded",
+                                  title,    "active",
+                                  flags);
+        }
+    }
+
+  g_hash_table_insert (dialog->priv->widgets, g_strdup (container_id), expander);
+  if (g_object_is_floating (expander))
+    g_object_ref_sink (expander);
+
+  return expander;
+}
+
+
 /**
  * gimp_procedure_dialog_set_sensitive:
  * @dialog:          the #GimpProcedureDialog.
diff --git a/libgimp/gimpproceduredialog.h b/libgimp/gimpproceduredialog.h
index 289b68116f..b3d44eafef 100644
--- a/libgimp/gimpproceduredialog.h
+++ b/libgimp/gimpproceduredialog.h
@@ -113,6 +113,12 @@ GtkWidget * gimp_procedure_dialog_fill_frame        (GimpProcedureDialog *dialog
                                                      gboolean             invert_title,
                                                      const gchar         *contents_id);
 
+GtkWidget * gimp_procedure_dialog_fill_expander     (GimpProcedureDialog *dialog,
+                                                     const gchar         *container_id,
+                                                     const gchar         *title_id,
+                                                     gboolean             invert_title,
+                                                     const gchar         *contents_id);
+
 void        gimp_procedure_dialog_fill              (GimpProcedureDialog *dialog,
                                                      ...) G_GNUC_NULL_TERMINATED;
 void        gimp_procedure_dialog_fill_list         (GimpProcedureDialog *dialog,
diff --git a/libgimp/gimpui.def b/libgimp/gimpui.def
index abe2f5b9c7..46217b918b 100644
--- a/libgimp/gimpui.def
+++ b/libgimp/gimpui.def
@@ -42,6 +42,7 @@ EXPORTS
        gimp_procedure_dialog_fill
        gimp_procedure_dialog_fill_box
        gimp_procedure_dialog_fill_box_list
+       gimp_procedure_dialog_fill_expander
        gimp_procedure_dialog_fill_flowbox
        gimp_procedure_dialog_fill_flowbox_list
        gimp_procedure_dialog_fill_frame
diff --git a/plug-ins/file-webp/file-webp-dialog.c b/plug-ins/file-webp/file-webp-dialog.c
index b459293350..f0935123d5 100644
--- a/plug-ins/file-webp/file-webp-dialog.c
+++ b/plug-ins/file-webp/file-webp-dialog.c
@@ -32,20 +32,6 @@
 #include "libgimp/stdplugins-intl.h"
 
 
-static void
-save_dialog_toggle_scale (GObject          *config,
-                          const GParamSpec *pspec,
-                          GtkWidget        *scale)
-{
-  gboolean lossless;
-
-  g_object_get (config,
-                "lossless", &lossless,
-                NULL);
-
-  gtk_widget_set_sensitive (scale, ! lossless);
-}
-
 static void
 show_maxkeyframe_hints (GObject          *config,
                         const GParamSpec *pspec,
@@ -77,73 +63,18 @@ save_dialog (GimpImage     *image,
              GObject       *config)
 {
   GtkWidget     *dialog;
-  GtkWidget     *vbox;
-  GtkWidget     *grid;
-  GtkWidget     *expander;
-  GtkWidget     *frame;
-  GtkWidget     *vbox2;
-  GtkWidget     *label;
-  GtkWidget     *toggle;
   GtkListStore  *store;
-  GtkWidget     *combo;
-  GtkWidget     *quality_scale;
-  GtkWidget     *alpha_quality_scale;
   gint32         nlayers;
   gboolean       animation_supported = FALSE;
   gboolean       run;
-  gchar         *text;
-  gint           row = 0;
 
   g_free (gimp_image_get_layers (image, &nlayers));
 
   animation_supported = nlayers > 1;
 
-  dialog = gimp_procedure_dialog_new (procedure,
-                                      GIMP_PROCEDURE_CONFIG (config),
-                                      _("Export Image as WebP"));
-
-  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
-  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
-                      vbox, FALSE, FALSE, 0);
-  gtk_widget_show (vbox);
-
-  grid = gtk_grid_new ();
-  gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
-  gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
-  gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE, 0);
-  gtk_widget_show (grid);
-
-  /* Create the lossless checkbox */
-  toggle = gimp_prop_check_button_new (config, "lossless",
-                                       _("_Lossless"));
-  gtk_grid_attach (GTK_GRID (grid), toggle, 0, row, 3, 1);
-  row++;
-
-  /* Create the slider for image quality */
-  quality_scale = gimp_prop_scale_entry_new (config, "quality",
-                                             _("Image _quality:"),
-                                             1.0, FALSE, 0, 0);
-  gtk_grid_attach (GTK_GRID (grid), quality_scale, 0, row++, 3, 1);
-  gtk_widget_show (quality_scale);
-
-  /* Create the slider for alpha channel quality */
-  alpha_quality_scale = gimp_prop_scale_entry_new (config, "alpha-quality",
-                                                   _("Alpha q_uality:"),
-                                                   1.0, FALSE, 0, 0);
-  gtk_grid_attach (GTK_GRID (grid), alpha_quality_scale, 0, row++, 3, 1);
-  gtk_widget_show (alpha_quality_scale);
-
-  /* Enable and disable the sliders when the lossless option is selected */
-  g_signal_connect (config, "notify::lossless",
-                    G_CALLBACK (save_dialog_toggle_scale),
-                    quality_scale);
-  g_signal_connect (config, "notify::lossless",
-                    G_CALLBACK (save_dialog_toggle_scale),
-                    alpha_quality_scale);
-
-  save_dialog_toggle_scale (config, NULL, quality_scale);
-  save_dialog_toggle_scale (config, NULL, alpha_quality_scale);
+  dialog = gimp_save_procedure_dialog_new (GIMP_SAVE_PROCEDURE (procedure),
+                                           GIMP_PROCEDURE_CONFIG (config),
+                                           image);
 
   /* Create the combobox containing the presets */
   store = gimp_int_store_new ("Default", WEBP_PRESET_DEFAULT,
@@ -153,159 +84,76 @@ save_dialog (GimpImage     *image,
                               "Icon",    WEBP_PRESET_ICON,
                               "Text",    WEBP_PRESET_TEXT,
                               NULL);
-  combo = gimp_prop_int_combo_box_new (config, "preset",
-                                       GIMP_INT_STORE (store));
+  gimp_procedure_dialog_get_int_combo (GIMP_PROCEDURE_DIALOG (dialog),
+                                       "preset", GIMP_INT_STORE (store));
   g_object_unref (store);
 
-  label = gimp_grid_attach_aligned (GTK_GRID (grid), 0, row++,
-                                    _("Source _type:"), 0.0, 0.5,
-                                    combo, 2);
-  gimp_help_set_help_data (label,
-                           _("WebP encoder \"preset\""),
-                           NULL);
+  /* Create scale for image and alpha quality */
+  gimp_procedure_dialog_get_widget (GIMP_PROCEDURE_DIALOG (dialog),
+                                    "quality", GIMP_TYPE_SCALE_ENTRY);
+  gimp_procedure_dialog_get_widget (GIMP_PROCEDURE_DIALOG (dialog),
+                                    "alpha-quality", GIMP_TYPE_SCALE_ENTRY);
+
+  /* Create frame for quality options */
+  gimp_procedure_dialog_fill_box (GIMP_PROCEDURE_DIALOG (dialog),
+                                  "quality-options",
+                                  "quality", "alpha-quality",
+                                  NULL);
+  gimp_procedure_dialog_fill_frame (GIMP_PROCEDURE_DIALOG (dialog),
+                                    "quality-frame", "lossless", TRUE,
+                                    "quality-options");
 
   if (animation_supported)
     {
-      GtkWidget      *animation_box;
-      GtkWidget      *delay;
-      GtkWidget      *hbox;
       GtkWidget      *label_kf;
-      GtkWidget      *kf_distance;
-      GtkWidget      *hbox_kf;
-      PangoAttrList  *attrs;
-      PangoAttribute *attr;
-
-      vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
-      gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0);
-      gtk_widget_show (vbox2);
-
-      text = g_strdup_printf ("<b>%s</b>", _("_Advanced Options"));
-      expander = gtk_expander_new_with_mnemonic (text);
-      gtk_expander_set_use_markup (GTK_EXPANDER (expander), TRUE);
-      g_free (text);
-
-
-      /* Create the top-level animation checkbox expander */
-      text = g_strdup_printf ("<b>%s</b>", _("As A_nimation"));
-      toggle = gimp_prop_check_button_new (config, "animation",
-                                           text);
-      g_free (text);
-
-      gtk_label_set_use_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (toggle))),
-                                TRUE);
-      gtk_box_pack_start (GTK_BOX (vbox2), toggle, TRUE, TRUE, 0);
-
-      frame = gimp_frame_new ("<expander>");
-      gtk_box_pack_start (GTK_BOX (vbox2), frame, TRUE, TRUE, 0);
-      gtk_widget_show (frame);
-
-      g_object_bind_property (toggle, "active",
-                              frame,  "visible",
-                              G_BINDING_SYNC_CREATE);
-
-      /* animation options box */
-      animation_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-      gtk_container_add (GTK_CONTAINER (frame), animation_box);
-      gtk_widget_show (animation_box);
-
-      /* loop animation checkbox */
-      toggle = gimp_prop_check_button_new (config, "animation-loop",
-                                           _("Loop _forever"));
-      gtk_box_pack_start (GTK_BOX (animation_box), toggle,
-                          FALSE, FALSE, 0);
-
-      /* create a hbox for 'max key-frame distance */
-      hbox_kf = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
-      gtk_box_pack_start (GTK_BOX (animation_box), hbox_kf, FALSE, FALSE, 0);
-      gtk_widget_set_sensitive (hbox_kf, TRUE);
-      gtk_widget_show (hbox_kf);
-
-      /* label for 'max key-frame distance' adjustment */
-      label_kf = gtk_label_new (_("Max distance between key-frames:"));
-      gtk_label_set_xalign (GTK_LABEL (label_kf), 0.2);
-      gtk_box_pack_start (GTK_BOX (hbox_kf), label_kf, FALSE, FALSE, 0);
-      gtk_widget_show (label_kf);
-
-      /* key-frame distance entry */
-      kf_distance = gimp_prop_spin_button_new (config, "keyframe-distance",
-                                               1.0, 1.0, 0);
-      gtk_box_pack_start (GTK_BOX (hbox_kf), kf_distance, FALSE, FALSE, 0);
-
-      /* Add some hinting text for special values of key-frame distance. */
-      label_kf = gtk_label_new (NULL);
-      gtk_box_pack_start (GTK_BOX (hbox_kf), label_kf, FALSE, FALSE, 0);
-      gtk_widget_show (label_kf);
-
-      attrs = pango_attr_list_new ();
-      attr  = pango_attr_style_new (PANGO_STYLE_ITALIC);
-      pango_attr_list_insert (attrs, attr);
-      gtk_label_set_attributes (GTK_LABEL (label_kf), attrs);
-      pango_attr_list_unref (attrs);
 
+      /* Hint for some special values of keyframe-distance. */
+      label_kf = gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (dialog),
+                                                  "keyframe-hint", NULL);
+      gtk_label_set_xalign (GTK_LABEL (label_kf), 1.0);
+      gtk_label_set_ellipsize (GTK_LABEL (label_kf), PANGO_ELLIPSIZE_END);
+      gimp_label_set_attributes (GTK_LABEL (label_kf),
+                                 PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC,
+                                 -1);
       g_signal_connect (config, "notify::keyframe-distance",
                         G_CALLBACK (show_maxkeyframe_hints),
                         label_kf);
       show_maxkeyframe_hints (config, NULL, GTK_LABEL (label_kf));
 
-      /* minimize-size checkbox */
-      toggle = gimp_prop_check_button_new (config, "minimize-size",
-                                           _("_Minimize output size "
-                                             "(slower)"));
-      gtk_box_pack_start (GTK_BOX (animation_box), toggle,
-                          FALSE, FALSE, 0);
-
-      /* Enable and disable the kf-distance box when the 'minimize size'
-       * option is selected
-       */
-      g_object_bind_property (config,  "minimize-size",
-                              hbox_kf, "sensitive",
-                              G_BINDING_SYNC_CREATE |
-                              G_BINDING_INVERT_BOOLEAN);
-
-      /* create a hbox for delay */
-      hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
-      gtk_box_pack_start (GTK_BOX (animation_box), hbox, FALSE, FALSE, 0);
-      gtk_widget_show (hbox);
-
-      /* label for 'delay' adjustment */
-      label = gtk_label_new (_("Delay between frames where unspecified:"));
-      gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-      gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-      gtk_widget_show (label);
-
-      /* default delay */
-      delay = gimp_prop_spin_button_new (config, "default-delay",
-                                         1, 10, 0);
-      gtk_box_pack_start (GTK_BOX (hbox), delay, FALSE, FALSE, 0);
-
-      /* label for 'ms' adjustment */
-      label = gtk_label_new (_("milliseconds"));
-      gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-      gtk_widget_show (label);
-
-      /* Create the force-delay checkbox */
-      toggle = gimp_prop_check_button_new (config, "force-delay",
-                                           _("Use _delay entered above for "
-                                             "all frames"));
-      gtk_box_pack_start (GTK_BOX (animation_box), toggle, FALSE, FALSE, 0);
-  }
-
-  /* Save EXIF data */
-  toggle = gimp_prop_check_button_new (config, "save-exif",
-                                       _("_Save Exif data"));
-  gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
-
-  /* XMP metadata */
-  toggle = gimp_prop_check_button_new (config, "save-xmp",
-                                       _("Save _XMP data"));
-  gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
-
-  /* Color profile */
-  toggle = gimp_prop_check_button_new (config, "save-color-profile",
-                                       _("Save color _profile"));
-  gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
-
-  gtk_widget_show (dialog);
+      /* when minimize-size is true, keyframe-distance and hint are insensitive. */
+      gimp_procedure_dialog_set_sensitive (GIMP_PROCEDURE_DIALOG (dialog),
+                                           "keyframe-distance",
+                                           TRUE, config, "minimize-size", TRUE);
+      gimp_procedure_dialog_set_sensitive (GIMP_PROCEDURE_DIALOG (dialog),
+                                           "keyframe-hint",
+                                           TRUE, config, "minimize-size", TRUE);
+
+      /* Create frame for animation options */
+      gimp_procedure_dialog_fill_box (GIMP_PROCEDURE_DIALOG (dialog),
+                                      "animation-options",
+                                      "animation-loop",
+                                      "minimize-size",
+                                      "keyframe-distance",
+                                      "keyframe-hint",
+                                      "default-delay",
+                                      "force-delay",
+                                      NULL);
+      gimp_procedure_dialog_fill_expander (GIMP_PROCEDURE_DIALOG (dialog),
+                                           "animation-frame", "animation", FALSE,
+                                           "animation-options");
+
+      /* Fill dialog with containers*/
+      gimp_procedure_dialog_fill (GIMP_PROCEDURE_DIALOG (dialog),
+                                  "preset", "quality-frame", "animation-frame",
+                                  NULL);
+    }
+  else
+    {
+      /* Fill dialog with containers*/
+      gimp_procedure_dialog_fill (GIMP_PROCEDURE_DIALOG (dialog),
+                                  "preset", "quality-frame",
+                                  NULL);
+    }
 
   run = gimp_procedure_dialog_run (GIMP_PROCEDURE_DIALOG (dialog));
 
diff --git a/plug-ins/file-webp/file-webp.c b/plug-ins/file-webp/file-webp.c
index cce4fdaf87..8152f72468 100644
--- a/plug-ins/file-webp/file-webp.c
+++ b/plug-ins/file-webp/file-webp.c
@@ -155,96 +155,80 @@ webp_create_procedure (GimpPlugIn  *plug_in,
                                       "(C) 2016 Ben Touchette",
                                       "2015,2016");
 
+      gimp_file_procedure_set_format_name (GIMP_FILE_PROCEDURE (procedure),
+                                           _("WebP"));
       gimp_file_procedure_set_mime_types (GIMP_FILE_PROCEDURE (procedure),
                                           "image/webp");
       gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure),
                                           "webp");
 
       GIMP_PROC_ARG_INT (procedure, "preset",
-                         "Preset",
-                         "Preset (Default=0, Picture=1, Photo=2, Drawing=3, "
+                         "Source _type",
+                         "WebP encoder preset (Default=0, Picture=1, Photo=2, Drawing=3, "
                          "Icon=4, Text=5)",
                          0, 5, WEBP_PRESET_DEFAULT,
                          G_PARAM_READWRITE);
 
       GIMP_PROC_ARG_BOOLEAN (procedure, "lossless",
-                             "Lossless",
+                             "L_ossless",
                              "Use lossless encoding",
                              FALSE,
                              G_PARAM_READWRITE);
 
       GIMP_PROC_ARG_DOUBLE (procedure, "quality",
-                            "Quality",
+                            "Image _quality",
                             "Quality of the image",
                             0, 100, 90,
                             G_PARAM_READWRITE);
 
       GIMP_PROC_ARG_DOUBLE (procedure, "alpha-quality",
-                            "Alpha quality",
+                            "Alpha q_uality",
                             "Quality of the image's alpha channel",
                             0, 100, 100,
                             G_PARAM_READWRITE);
 
-      GIMP_PROC_ARG_BOOLEAN (procedure, "animation",
-                             "Animation",
-                             "Use layers for animation",
-                             FALSE,
-                             G_PARAM_READWRITE);
-
       GIMP_PROC_ARG_BOOLEAN (procedure, "animation-loop",
-                             "Animation loop",
+                             _("Loop _forever"),
                              "Loop animation infinitely",
                              TRUE,
                              G_PARAM_READWRITE);
 
       GIMP_PROC_ARG_BOOLEAN (procedure, "minimize-size",
-                             "Minimize size",
-                             "Minimize animation size",
+                             _("_Minimize output size (slower)"),
+                             "Minimize output file size",
                              TRUE,
                              G_PARAM_READWRITE);
 
       GIMP_PROC_ARG_INT (procedure, "keyframe-distance",
-                         "Keyframe distance",
+                         _("Max distance between _key-frames"),
                          "Maximum distance between keyframes",
                          0, G_MAXINT, 50,
                          G_PARAM_READWRITE);
 
-      GIMP_PROC_ARG_BOOLEAN (procedure, "save-exif",
-                             "Save Exif",
-                             "Toggle saving Exif data",
-                             gimp_export_exif (),
-                             G_PARAM_READWRITE);
-
-      GIMP_PROC_ARG_BOOLEAN (procedure, "save-iptc",
-                             "Save IPTC",
-                             "Toggle saving IPTC data",
-                             gimp_export_iptc (),
-                             G_PARAM_READWRITE);
-
-      GIMP_PROC_ARG_BOOLEAN (procedure, "save-xmp",
-                             "Save XMP",
-                             "Toggle saving XMP data",
-                             gimp_export_xmp (),
-                             G_PARAM_READWRITE);
-
-      GIMP_PROC_ARG_BOOLEAN (procedure, "save-color-profile",
-                             "Save color profle",
-                             "Toggle saving the color profile",
-                             gimp_export_color_profile (),
-                             G_PARAM_READWRITE);
-
       GIMP_PROC_ARG_INT (procedure, "default-delay",
-                         "Default delay",
-                         "Delay to use when timestamps are not available "
-                         "or forced",
+                         _("_Default delay between frames"),
+                         "Default delay (in milliseconds) to use when timestamps"
+                         " for frames are not available or forced.",
                          0, G_MAXINT, 200,
                          G_PARAM_READWRITE);
 
       GIMP_PROC_ARG_BOOLEAN (procedure, "force-delay",
-                             "Force delay",
-                             "Force delay on all frames",
+                             _("Use default dela_y for all frames"),
+                             "Force default delay on all frames",
                              FALSE,
                              G_PARAM_READWRITE);
+
+      GIMP_PROC_ARG_BOOLEAN (procedure, "animation",
+                             _("Save a_nimation"),
+                             "Use layers for animation",
+                             FALSE,
+                             G_PARAM_READWRITE);
+
+      gimp_save_procedure_set_support_exif      (GIMP_SAVE_PROCEDURE (procedure), TRUE);
+      gimp_save_procedure_set_support_iptc      (GIMP_SAVE_PROCEDURE (procedure), TRUE);
+      gimp_save_procedure_set_support_xmp       (GIMP_SAVE_PROCEDURE (procedure), TRUE);
+      gimp_save_procedure_set_support_profile   (GIMP_SAVE_PROCEDURE (procedure), TRUE);
+      gimp_save_procedure_set_support_thumbnail (GIMP_SAVE_PROCEDURE (procedure), TRUE);
     }
 
   return procedure;


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