Commit 9326f4a7 authored by Michael Natterer's avatar Michael Natterer 😴

plug-ins: rename all boolean comment arguments to "save-comment"

and let them default to gimp_export_comment(). Set the default value
of all "comment" arguments to gimp_get_default_comment().
parent 2409b6f2
Pipeline #122178 passed with stages
in 23 minutes and 15 seconds
...@@ -143,13 +143,13 @@ csource_create_procedure (GimpPlugIn *plug_in, ...@@ -143,13 +143,13 @@ csource_create_procedure (GimpPlugIn *plug_in,
GIMP_PROC_AUX_ARG_STRING (procedure, "comment", GIMP_PROC_AUX_ARG_STRING (procedure, "comment",
"Comment", "Comment",
"Comment", "Comment",
NULL, gimp_get_default_comment (),
GIMP_PARAM_READWRITE); GIMP_PARAM_READWRITE);
GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "use-comment", GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "save-comment",
"Use comment", "Save comment",
"Use comment", "Save comment",
FALSE, gimp_export_comment (),
GIMP_PARAM_READWRITE); GIMP_PARAM_READWRITE);
GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "glib-types", GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "glib-types",
...@@ -547,7 +547,7 @@ save_image (GFile *file, ...@@ -547,7 +547,7 @@ save_image (GFile *file,
gint drawable_bpp; gint drawable_bpp;
gchar *config_prefixed_name; gchar *config_prefixed_name;
gchar *config_comment; gchar *config_comment;
gboolean config_use_comment; gboolean config_save_comment;
gboolean config_glib_types; gboolean config_glib_types;
gboolean config_save_alpha; gboolean config_save_alpha;
gboolean config_rgb565; gboolean config_rgb565;
...@@ -558,7 +558,7 @@ save_image (GFile *file, ...@@ -558,7 +558,7 @@ save_image (GFile *file,
g_object_get (config, g_object_get (config,
"prefixed-name", &config_prefixed_name, "prefixed-name", &config_prefixed_name,
"comment", &config_comment, "comment", &config_comment,
"use-comment", &config_use_comment, "save-comment", &config_save_comment,
"glib-types", &config_glib_types, "glib-types", &config_glib_types,
"save-alpha", &config_save_alpha, "save-alpha", &config_save_alpha,
"rgb565", &config_rgb565, "rgb565", &config_rgb565,
...@@ -736,7 +736,7 @@ save_image (GFile *file, ...@@ -736,7 +736,7 @@ save_image (GFile *file,
s_uint, s_uint, s_uint)) s_uint, s_uint, s_uint))
goto fail; goto fail;
if (config_use_comment) if (config_save_comment)
{ {
if (! print (output, error, " %s\t*comment;\n", s_char)) if (! print (output, error, " %s\t*comment;\n", s_char))
goto fail; goto fail;
...@@ -789,7 +789,7 @@ save_image (GFile *file, ...@@ -789,7 +789,7 @@ save_image (GFile *file,
} }
} }
if (config_use_comment && ! config_comment) if (config_save_comment && ! config_comment)
{ {
if (! config_use_macros) if (! config_use_macros)
{ {
...@@ -804,7 +804,7 @@ save_image (GFile *file, ...@@ -804,7 +804,7 @@ save_image (GFile *file,
goto fail; goto fail;
} }
} }
else if (config_use_comment) else if (config_save_comment)
{ {
gchar *p = config_comment - 1; gchar *p = config_comment - 1;
...@@ -1010,7 +1010,7 @@ save_dialog (GimpProcedure *procedure, ...@@ -1010,7 +1010,7 @@ save_dialog (GimpProcedure *procedure,
/* Use Comment /* Use Comment
*/ */
toggle = gimp_prop_check_button_new (config, "use-comment", toggle = gimp_prop_check_button_new (config, "save-comment",
_("_Save comment to file")); _("_Save comment to file"));
gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
......
...@@ -19,23 +19,6 @@ ...@@ -19,23 +19,6 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Contents:
*
* main() - Main entry - just call gimp_main()...
* query() - Respond to a plug-in query...
* run() - Run the plug-in...
* load_image() - Load a PNG image into a new image window.
* offsets_dialog() - Asks the user about offsets when loading.
* respin_cmap() - Re-order a Gimp colormap for PNG tRNS
* save_image() - Export the specified image to a PNG file.
* save_compression_callback() - Update the image compression level.
* save_interlace_update() - Update the interlacing option.
* save_dialog() - Pop up the export dialog.
*
* Revision History:
*
* see ChangeLog
*/ */
#include "config.h" #include "config.h"
...@@ -281,10 +264,10 @@ png_create_procedure (GimpPlugIn *plug_in, ...@@ -281,10 +264,10 @@ png_create_procedure (GimpPlugIn *plug_in,
TRUE, TRUE,
G_PARAM_READWRITE); G_PARAM_READWRITE);
GIMP_PROC_ARG_BOOLEAN (procedure, "comment", GIMP_PROC_ARG_BOOLEAN (procedure, "save-comment",
"Comment", "Save comment",
"Write comment?", "Write comment?",
TRUE, gimp_export_comment (),
G_PARAM_READWRITE); G_PARAM_READWRITE);
GIMP_PROC_ARG_BOOLEAN (procedure, "save-transparent", GIMP_PROC_ARG_BOOLEAN (procedure, "save-transparent",
...@@ -1282,7 +1265,7 @@ save_image (GFile *file, ...@@ -1282,7 +1265,7 @@ save_image (GFile *file,
"offs", &save_offs, "offs", &save_offs,
"phys", &save_phys, "phys", &save_phys,
"time", &save_time, "time", &save_time,
"comment", &save_comment, "save-comment", &save_comment,
"save-transparent", &save_transp_pixels, "save-transparent", &save_transp_pixels,
"compression", &compression_level, "compression", &compression_level,
"format", &export_format, "format", &export_format,
...@@ -2264,7 +2247,7 @@ save_dialog (GimpImage *image, ...@@ -2264,7 +2247,7 @@ save_dialog (GimpImage *image,
col = 1; col = 1;
row = 0; row = 0;
button = gimp_prop_check_button_new (config, "comment", button = gimp_prop_check_button_new (config, "save-comment",
_("Save comme_nt")); _("Save comme_nt"));
gtk_grid_attach (GTK_GRID (grid), button, col, row++, 1, 1); gtk_grid_attach (GTK_GRID (grid), button, col, row++, 1, 1);
......
...@@ -202,16 +202,16 @@ xbm_create_procedure (GimpPlugIn *plug_in, ...@@ -202,16 +202,16 @@ xbm_create_procedure (GimpPlugIn *plug_in,
gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure), gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure),
"xbm,icon,bitmap"); "xbm,icon,bitmap");
GIMP_PROC_ARG_BOOLEAN (procedure, "use-comment", GIMP_PROC_ARG_BOOLEAN (procedure, "save-comment",
"Use comment", "Save comment",
_("Write a comment at the beginning of the file."), _("Write a comment at the beginning of the file."),
FALSE, FALSE, /* *NOT* gimp_export_comment() */
G_PARAM_READWRITE); G_PARAM_READWRITE);
GIMP_PROC_ARG_STRING (procedure, "comment", GIMP_PROC_ARG_STRING (procedure, "comment",
"Comment", "Comment",
"Image description (maximum 72 bytes)", "Image description (maximum 72 bytes)",
"Created with GIMP", gimp_get_default_comment (),
G_PARAM_READWRITE); G_PARAM_READWRITE);
GIMP_PROC_ARG_BOOLEAN (procedure, "x10-format", GIMP_PROC_ARG_BOOLEAN (procedure, "x10-format",
...@@ -980,7 +980,7 @@ save_image (GFile *file, ...@@ -980,7 +980,7 @@ save_image (GFile *file,
guchar *data = NULL; guchar *data = NULL;
guchar *cmap; guchar *cmap;
const gchar *intfmt; const gchar *intfmt;
gboolean config_use_comment; gboolean config_save_comment;
gchar *config_comment; gchar *config_comment;
gint config_x10_format; gint config_x10_format;
gint config_use_hot; gint config_use_hot;
...@@ -988,7 +988,7 @@ save_image (GFile *file, ...@@ -988,7 +988,7 @@ save_image (GFile *file,
gint config_y_hot; gint config_y_hot;
g_object_get (config, g_object_get (config,
"use-comment", &config_use_comment, "save-comment", &config_save_comment,
"comment", &config_comment, "comment", &config_comment,
"x10-format", &config_x10_format, "x10-format", &config_x10_format,
"use-hot-spot", &config_use_hot, "use-hot-spot", &config_use_hot,
...@@ -1065,7 +1065,7 @@ save_image (GFile *file, ...@@ -1065,7 +1065,7 @@ save_image (GFile *file,
} }
/* Maybe write the image comment. */ /* Maybe write the image comment. */
if (config_use_comment && config_comment && *config_comment) if (config_save_comment && config_comment && *config_comment)
{ {
if (! print (output, error, "/* %s */\n", config_comment)) if (! print (output, error, "/* %s */\n", config_comment))
goto fail; goto fail;
...@@ -1278,7 +1278,7 @@ save_dialog (GimpDrawable *drawable, ...@@ -1278,7 +1278,7 @@ save_dialog (GimpDrawable *drawable,
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame); gtk_widget_show (frame);
toggle = gimp_prop_check_button_new (config, "use-comment", toggle = gimp_prop_check_button_new (config, "save-comment",
_("_Write comment")); _("_Write comment"));
gtk_frame_set_label_widget (GTK_FRAME (frame), toggle); gtk_frame_set_label_widget (GTK_FRAME (frame), toggle);
...@@ -1298,7 +1298,7 @@ save_dialog (GimpDrawable *drawable, ...@@ -1298,7 +1298,7 @@ save_dialog (GimpDrawable *drawable,
gtk_grid_attach (GTK_GRID (grid), hint, 0, 0, 2, 1); gtk_grid_attach (GTK_GRID (grid), hint, 0, 0, 2, 1);
gtk_widget_show (hint); gtk_widget_show (hint);
g_object_bind_property (config, "use-comment", g_object_bind_property (config, "save-comment",
grid, "sensitive", grid, "sensitive",
G_BINDING_SYNC_CREATE); G_BINDING_SYNC_CREATE);
......
...@@ -223,7 +223,7 @@ jpeg_create_procedure (GimpPlugIn *plug_in, ...@@ -223,7 +223,7 @@ jpeg_create_procedure (GimpPlugIn *plug_in,
GIMP_PROC_ARG_STRING (procedure, "comment", GIMP_PROC_ARG_STRING (procedure, "comment",
"Comment", "Comment",
"Image comment", "Image comment",
NULL, gimp_get_default_comment (),
G_PARAM_READWRITE); G_PARAM_READWRITE);
GIMP_PROC_ARG_INT (procedure, "sub-sampling", GIMP_PROC_ARG_INT (procedure, "sub-sampling",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment