From b28a3306e0ef979d3e9f5ffae9e7c5127f6d10f9 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 20 Aug 2008 14:19:35 +0000 Subject: [PATCH] plug-ins/common/align-layers.c plug-ins/common/blur-gauss.c 2008-08-20 Michael Natterer * plug-ins/common/align-layers.c * plug-ins/common/blur-gauss.c * plug-ins/common/cartoon.c * plug-ins/common/edge-dog.c * plug-ins/common/edge-neon.c * plug-ins/common/edge-sobel.c * plug-ins/common/photocopy.c * plug-ins/common/pixelize.c * plug-ins/common/softglow.c * plug-ins/gradient-flare/gradient-flare.c: pass error messages with the return values instead of calling g_message(). svn path=/trunk/; revision=26679 --- ChangeLog | 14 ++++++++++++++ plug-ins/common/align-layers.c | 6 ++++-- plug-ins/common/blur-gauss.c | 8 +++++--- plug-ins/common/cartoon.c | 8 +++++--- plug-ins/common/edge-dog.c | 8 +++++--- plug-ins/common/edge-neon.c | 8 +++++--- plug-ins/common/edge-sobel.c | 8 +++++--- plug-ins/common/photocopy.c | 8 +++++--- plug-ins/common/pixelize.c | 8 +++++--- plug-ins/common/softglow.c | 8 +++++--- plug-ins/gradient-flare/gradient-flare.c | 8 +++++--- 11 files changed, 63 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53bdf7bd3b..cf52993b51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2008-08-20 Michael Natterer + + * plug-ins/common/align-layers.c + * plug-ins/common/blur-gauss.c + * plug-ins/common/cartoon.c + * plug-ins/common/edge-dog.c + * plug-ins/common/edge-neon.c + * plug-ins/common/edge-sobel.c + * plug-ins/common/photocopy.c + * plug-ins/common/pixelize.c + * plug-ins/common/softglow.c + * plug-ins/gradient-flare/gradient-flare.c: pass error messages + with the return values instead of calling g_message(). + 2008-08-20 Michael Natterer * plug-ins/common/file-gif-load.c: tons of cleanup: proper diff --git a/plug-ins/common/align-layers.c b/plug-ins/common/align-layers.c index 551adebfd3..de9f22dec0 100644 --- a/plug-ins/common/align-layers.c +++ b/plug-ins/common/align-layers.c @@ -146,7 +146,7 @@ run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals) { - static GimpParam values[1]; + static GimpParam values[2]; GimpPDBStatusType status = GIMP_PDB_EXECUTION_ERROR; GimpRunMode run_mode; gint image_id, layer_num; @@ -168,7 +168,9 @@ run (const gchar *name, gimp_image_get_layers (image_id, &layer_num); if (layer_num < 2) { - g_message (_("There are not enough layers to align.")); + *nreturn_vals = 2; + values[1].type = GIMP_PDB_STRING; + values[1].data.d_string = _("There are not enough layers to align."); return; } gimp_get_data (PLUG_IN_PROC, &VALS); diff --git a/plug-ins/common/blur-gauss.c b/plug-ins/common/blur-gauss.c index 7bd9d26cb1..30b49f9245 100644 --- a/plug-ins/common/blur-gauss.c +++ b/plug-ins/common/blur-gauss.c @@ -265,7 +265,7 @@ run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals) { - static GimpParam values[1]; + static GimpParam values[2]; gint32 image_ID; GimpDrawable *drawable; GimpRunMode run_mode; @@ -442,8 +442,10 @@ run (const gchar *name, } else { - g_message (_("Cannot operate on indexed color images.")); - status = GIMP_PDB_EXECUTION_ERROR; + status = GIMP_PDB_EXECUTION_ERROR; + *nreturn_vals = 2; + values[1].type = GIMP_PDB_STRING; + values[1].data.d_string = _("Cannot operate on indexed color images."); } gimp_drawable_detach (drawable); diff --git a/plug-ins/common/cartoon.c b/plug-ins/common/cartoon.c index b27733b1f2..b910d52583 100644 --- a/plug-ins/common/cartoon.c +++ b/plug-ins/common/cartoon.c @@ -160,7 +160,7 @@ run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals) { - static GimpParam values[1]; + static GimpParam values[2]; GimpRunMode run_mode; GimpDrawable *drawable; GimpPDBStatusType status = GIMP_PDB_SUCCESS; @@ -226,8 +226,10 @@ run (const gchar *name, } else { - g_message (_("Cannot operate on indexed color images.")); - status = GIMP_PDB_EXECUTION_ERROR; + status = GIMP_PDB_EXECUTION_ERROR; + *nreturn_vals = 2; + values[1].type = GIMP_PDB_STRING; + values[1].data.d_string = _("Cannot operate on indexed color images."); } } diff --git a/plug-ins/common/edge-dog.c b/plug-ins/common/edge-dog.c index e1e167da85..431c633389 100644 --- a/plug-ins/common/edge-dog.c +++ b/plug-ins/common/edge-dog.c @@ -153,7 +153,7 @@ run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals) { - static GimpParam values[1]; + static GimpParam values[2]; gint32 image_ID; GimpDrawable *drawable; GimpRunMode run_mode; @@ -248,8 +248,10 @@ run (const gchar *name, } else { - g_message (_("Cannot operate on indexed color images.")); - status = GIMP_PDB_EXECUTION_ERROR; + status = GIMP_PDB_EXECUTION_ERROR; + *nreturn_vals = 2; + values[1].type = GIMP_PDB_STRING; + values[1].data.d_string = _("Cannot operate on indexed color images."); } gimp_drawable_detach (drawable); diff --git a/plug-ins/common/edge-neon.c b/plug-ins/common/edge-neon.c index 80c1ffb553..dfb7ec6c95 100644 --- a/plug-ins/common/edge-neon.c +++ b/plug-ins/common/edge-neon.c @@ -152,7 +152,7 @@ run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals) { - static GimpParam values[1]; + static GimpParam values[2]; GimpRunMode run_mode; GimpDrawable *drawable; GimpPDBStatusType status = GIMP_PDB_SUCCESS; @@ -222,8 +222,10 @@ run (const gchar *name, } else { - g_message (_("Cannot operate on indexed color images.")); - status = GIMP_PDB_EXECUTION_ERROR; + status = GIMP_PDB_EXECUTION_ERROR; + *nreturn_vals = 2; + values[1].type = GIMP_PDB_STRING; + values[1].data.d_string = _("Cannot operate on indexed color images."); } values[0].data.d_status = status; diff --git a/plug-ins/common/edge-sobel.c b/plug-ins/common/edge-sobel.c index 606f606f88..f0a02829df 100644 --- a/plug-ins/common/edge-sobel.c +++ b/plug-ins/common/edge-sobel.c @@ -134,7 +134,7 @@ run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals) { - static GimpParam values[1]; + static GimpParam values[2]; GimpDrawable *drawable; GimpRunMode run_mode; GimpPDBStatusType status = GIMP_PDB_SUCCESS; @@ -206,8 +206,10 @@ run (const gchar *name, } else { - /* g_message ("Cannot operate on indexed color images"); */ - status = GIMP_PDB_EXECUTION_ERROR; + status = GIMP_PDB_EXECUTION_ERROR; + *nreturn_vals = 2; + values[1].type = GIMP_PDB_STRING; + values[1].data.d_string = _("Cannot operate on indexed color images."); } gimp_drawable_detach (drawable); diff --git a/plug-ins/common/photocopy.c b/plug-ins/common/photocopy.c index 354f072028..6bb80d1437 100644 --- a/plug-ins/common/photocopy.c +++ b/plug-ins/common/photocopy.c @@ -171,7 +171,7 @@ run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals) { - static GimpParam values[1]; + static GimpParam values[2]; GimpRunMode run_mode; GimpDrawable *drawable; GimpPDBStatusType status = GIMP_PDB_SUCCESS; @@ -238,8 +238,10 @@ run (const gchar *name, } else { - g_message (_("Cannot operate on indexed color images.")); - status = GIMP_PDB_EXECUTION_ERROR; + status = GIMP_PDB_EXECUTION_ERROR; + *nreturn_vals = 2; + values[1].type = GIMP_PDB_STRING; + values[1].data.d_string = _("Cannot operate on indexed color images."); } } diff --git a/plug-ins/common/pixelize.c b/plug-ins/common/pixelize.c index 8bb997ece1..b1f7523cba 100644 --- a/plug-ins/common/pixelize.c +++ b/plug-ins/common/pixelize.c @@ -198,7 +198,7 @@ run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals) { - static GimpParam values[1]; + static GimpParam values[2]; GimpDrawable *drawable; GimpRunMode run_mode; GimpPDBStatusType status = GIMP_PDB_SUCCESS; @@ -287,8 +287,10 @@ run (const gchar *name, } else { - /* g_message ("pixelize: cannot operate on indexed color images"); */ - status = GIMP_PDB_EXECUTION_ERROR; + status = GIMP_PDB_EXECUTION_ERROR; + *nreturn_vals = 2; + values[1].type = GIMP_PDB_STRING; + values[1].data.d_string = _("Cannot operate on indexed color images."); } } diff --git a/plug-ins/common/softglow.c b/plug-ins/common/softglow.c index e63a75bbf1..db50a6bf59 100644 --- a/plug-ins/common/softglow.c +++ b/plug-ins/common/softglow.c @@ -152,7 +152,7 @@ run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals) { - static GimpParam values[1]; + static GimpParam values[2]; GimpRunMode run_mode; GimpDrawable *drawable; GimpPDBStatusType status = GIMP_PDB_SUCCESS; @@ -218,8 +218,10 @@ run (const gchar *name, } else { - g_message (_("Cannot operate on indexed color images.")); - status = GIMP_PDB_EXECUTION_ERROR; + status = GIMP_PDB_EXECUTION_ERROR; + *nreturn_vals = 2; + values[1].type = GIMP_PDB_STRING; + values[1].data.d_string = _("Cannot operate on indexed color images."); } } diff --git a/plug-ins/gradient-flare/gradient-flare.c b/plug-ins/gradient-flare/gradient-flare.c index b07f6973fc..ee122d3fcc 100644 --- a/plug-ins/gradient-flare/gradient-flare.c +++ b/plug-ins/gradient-flare/gradient-flare.c @@ -827,7 +827,7 @@ plugin_run (const gchar *name, gint *nreturn_vals, GimpParam **return_vals) { - static GimpParam values[1]; + static GimpParam values[2]; GimpRunMode run_mode; GimpPDBStatusType status = GIMP_PDB_SUCCESS; gchar *path; @@ -961,8 +961,10 @@ plugin_run (const gchar *name, } else { - g_message (_("Cannot operate on indexed color images.")); - status = GIMP_PDB_EXECUTION_ERROR; + status = GIMP_PDB_EXECUTION_ERROR; + *nreturn_vals = 2; + values[1].type = GIMP_PDB_STRING; + values[1].data.d_string = _("Cannot operate on indexed color images."); } }