[gimp] plug-ins: file-tiff using the new dialog generation.



commit 3e67d7d6764b234505f56c85a65c74e714af9d83
Author: Jehan <jehan girinstud io>
Date:   Sat Nov 21 22:27:27 2020 +0100

    plug-ins: file-tiff using the new dialog generation.

 plug-ins/file-tiff/file-tiff-save.c | 28 ++++------------------
 plug-ins/file-tiff/file-tiff.c      | 48 +++++++------------------------------
 2 files changed, 14 insertions(+), 62 deletions(-)
---
diff --git a/plug-ins/file-tiff/file-tiff-save.c b/plug-ins/file-tiff/file-tiff-save.c
index 03fb52b52b..386c065469 100644
--- a/plug-ins/file-tiff/file-tiff-save.c
+++ b/plug-ins/file-tiff/file-tiff-save.c
@@ -1279,13 +1279,12 @@ save_dialog (GimpImage     *image,
   GtkListStore    *store;
   GtkWidget       *combo;
   GtkWidget       *frame;
-  GtkWidget       *flowbox;
   GimpCompression  compression;
   gboolean         run;
 
-  dialog = gimp_procedure_dialog_new (procedure,
-                                      GIMP_PROCEDURE_CONFIG (config),
-                                      _("Export Image as TIFF"));
+  dialog = gimp_save_procedure_dialog_new (GIMP_SAVE_PROCEDURE (procedure),
+                                           GIMP_PROCEDURE_CONFIG (config),
+                                           _("Export Image as TIFF"));
 
   store =
     gimp_int_store_new (_("None"),              GIMP_COMPRESSION_NONE,
@@ -1299,7 +1298,7 @@ save_dialog (GimpImage     *image,
   combo = gimp_procedure_dialog_get_int_combo (GIMP_PROCEDURE_DIALOG (dialog),
                                                "compression", GIMP_INT_STORE (store));
   g_object_unref (store);
-  combo = gimp_label_int_widget_get_widget (combo);
+  combo = gimp_label_int_widget_get_widget (GIMP_LABEL_INT_WIDGET (combo));
   gimp_int_combo_box_set_sensitivity (GIMP_INT_COMBO_BOX (combo),
                                       combo_sensitivity_func,
                                       combo, NULL);
@@ -1325,29 +1324,12 @@ save_dialog (GimpImage     *image,
                                                               G_TYPE_NONE),
                             has_alpha && ! is_indexed);
 
-  gimp_procedure_dialog_get_label (GIMP_PROCEDURE_DIALOG (dialog),
-                                   "comment-label", "Comment");
-  gimp_procedure_dialog_fill_frame (GIMP_PROCEDURE_DIALOG (dialog),
-                                    "comment-frame", "comment-label", FALSE,
-                                    "gimp-comment");
-
-  flowbox = gimp_procedure_dialog_fill_flowbox (GIMP_PROCEDURE_DIALOG (dialog),
-                                                "metadata-box",
-                                                "save-exif", "save-xmp", "save-iptc",
-                                                "save-geotiff", "save-thumbnail",
-#ifdef TIFFTAG_ICCPROFILE
-                                                "save-color-profile",
-#endif
-                                                NULL);
-  gtk_flow_box_set_min_children_per_line (GTK_FLOW_BOX (flowbox), 2);
-  gtk_flow_box_set_max_children_per_line (GTK_FLOW_BOX (flowbox), 2);
+  gimp_save_procedure_dialog_add_metadata (GIMP_SAVE_PROCEDURE_DIALOG (dialog), "save-geotiff");
 
   gimp_procedure_dialog_fill (GIMP_PROCEDURE_DIALOG (dialog),
                               "compression",
                               "layers-frame",
                               "save-transparent-pixels",
-                              "metadata-box",
-                              "comment-frame",
                               NULL);
 
   g_object_get (config,
diff --git a/plug-ins/file-tiff/file-tiff.c b/plug-ins/file-tiff/file-tiff.c
index 98689ed22d..68d15114b5 100644
--- a/plug-ins/file-tiff/file-tiff.c
+++ b/plug-ins/file-tiff/file-tiff.c
@@ -208,15 +208,6 @@ tiff_create_procedure (GimpPlugIn  *plug_in,
                              TRUE,
                              G_PARAM_READWRITE);
 
-      GIMP_PROC_AUX_ARG_STRING (procedure, "gimp-comment",
-                                "Comment",
-                                "Image comment",
-                                gimp_get_default_comment (),
-                                G_PARAM_READWRITE);
-
-      gimp_procedure_set_argument_sync (procedure, "gimp-comment",
-                                        GIMP_ARGUMENT_SYNC_PARASITE);
-
       GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "save-layers",
                                  "Save Layers",
                                  "Save Layers",
@@ -229,41 +220,20 @@ tiff_create_procedure (GimpPlugIn  *plug_in,
                                  TRUE,
                                  G_PARAM_READWRITE);
 
-      GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "save-exif",
-                                 "Save Exif data",
-                                 "Save Exif",
-                                 gimp_export_exif (),
-                                 G_PARAM_READWRITE);
-
-      GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "save-xmp",
-                                 "Save XMP data",
-                                 "Save XMP",
-                                 gimp_export_xmp (),
-                                 G_PARAM_READWRITE);
-
-      GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "save-iptc",
-                                 "Save IPTC data",
-                                 "Save IPTC",
-                                 gimp_export_iptc (),
-                                 G_PARAM_READWRITE);
-
-      GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "save-thumbnail",
-                                 "Save thumbnail",
-                                 "Save thumbnail",
-                                 TRUE,
-                                 G_PARAM_READWRITE);
-
-      GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "save-color-profile",
-                                 "Save color profile",
-                                 "Save color profile",
-                                 gimp_export_color_profile (),
-                                 G_PARAM_READWRITE);
-
       GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "save-geotiff",
                                  "Save GeoTIFF data",
                                  "Save GeoTIFF data",
                                  TRUE,
                                  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);
+#ifdef TIFFTAG_ICCPROFILE
+      gimp_save_procedure_set_support_profile   (GIMP_SAVE_PROCEDURE (procedure), TRUE);
+#endif
+      gimp_save_procedure_set_support_thumbnail (GIMP_SAVE_PROCEDURE (procedure), TRUE);
+      gimp_save_procedure_set_support_comment   (GIMP_SAVE_PROCEDURE (procedure), TRUE);
     }
 
   return procedure;


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