Commit f2f1eab7 authored by Michael Natterer's avatar Michael Natterer 😴

app: add "ERROR" to the values of enum GimpPdbErrorCode

so they are now GIMP_PDB_ERROR_FOO instead of just GIMP_PDB_FOO,
because it was just too confusing wrt enum GimpPdbStatusType.
parent 435feea2
...@@ -148,7 +148,8 @@ image_convert_indexed_invoker (GimpProcedure *procedure, ...@@ -148,7 +148,8 @@ image_convert_indexed_invoker (GimpProcedure *procedure,
else if (pal->n_colors > MAXNUMCOLORS) else if (pal->n_colors > MAXNUMCOLORS)
{ {
g_set_error_literal (error, g_set_error_literal (error,
GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, GIMP_PDB_ERROR,
GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Cannot convert to a palette " _("Cannot convert to a palette "
"with more than 256 colors.")); "with more than 256 colors."));
success = FALSE; success = FALSE;
...@@ -203,7 +204,8 @@ image_convert_set_dither_matrix_invoker (GimpProcedure *procedure, ...@@ -203,7 +204,8 @@ image_convert_set_dither_matrix_invoker (GimpProcedure *procedure,
} }
else else
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR,
GIMP_PDB_ERROR_INVALID_ARGUMENT,
"Dither matrix length must be width * height"); "Dither matrix length must be width * height");
success = FALSE; success = FALSE;
} }
......
...@@ -60,7 +60,8 @@ floating_sel_remove_invoker (GimpProcedure *procedure, ...@@ -60,7 +60,8 @@ floating_sel_remove_invoker (GimpProcedure *procedure,
} }
else else
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR,
GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Cannot remove this layer because " _("Cannot remove this layer because "
"it is not a floating selection.")); "it is not a floating selection."));
success = FALSE; success = FALSE;
...@@ -92,7 +93,8 @@ floating_sel_anchor_invoker (GimpProcedure *procedure, ...@@ -92,7 +93,8 @@ floating_sel_anchor_invoker (GimpProcedure *procedure,
} }
else else
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR,
GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Cannot anchor this layer because " _("Cannot anchor this layer because "
"it is not a floating selection.")); "it is not a floating selection."));
success = FALSE; success = FALSE;
...@@ -124,7 +126,8 @@ floating_sel_to_layer_invoker (GimpProcedure *procedure, ...@@ -124,7 +126,8 @@ floating_sel_to_layer_invoker (GimpProcedure *procedure,
} }
else else
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR,
GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Cannot convert this layer to a normal layer " _("Cannot convert this layer to a normal layer "
"because it is not a floating selection.")); "because it is not a floating selection."));
success = FALSE; success = FALSE;
......
...@@ -295,7 +295,7 @@ gimp_pdb_proc_info (GimpPDB *pdb, ...@@ -295,7 +295,7 @@ gimp_pdb_proc_info (GimpPDB *pdb,
return TRUE; return TRUE;
} }
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_PROCEDURE_NOT_FOUND, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_PROCEDURE_NOT_FOUND,
_("Procedure '%s' not found"), proc_name); _("Procedure '%s' not found"), proc_name);
return FALSE; return FALSE;
......
...@@ -69,7 +69,7 @@ gimp_pdb_get_brush (Gimp *gimp, ...@@ -69,7 +69,7 @@ gimp_pdb_get_brush (Gimp *gimp,
if (! name || ! strlen (name)) if (! name || ! strlen (name))
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Invalid empty brush name")); _("Invalid empty brush name"));
return NULL; return NULL;
} }
...@@ -78,12 +78,12 @@ gimp_pdb_get_brush (Gimp *gimp, ...@@ -78,12 +78,12 @@ gimp_pdb_get_brush (Gimp *gimp,
if (! brush) if (! brush)
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Brush '%s' not found"), name); _("Brush '%s' not found"), name);
} }
else if (writable && ! gimp_data_is_writable (GIMP_DATA (brush))) else if (writable && ! gimp_data_is_writable (GIMP_DATA (brush)))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Brush '%s' is not editable"), name); _("Brush '%s' is not editable"), name);
return NULL; return NULL;
} }
...@@ -109,7 +109,7 @@ gimp_pdb_get_generated_brush (Gimp *gimp, ...@@ -109,7 +109,7 @@ gimp_pdb_get_generated_brush (Gimp *gimp,
if (! GIMP_IS_BRUSH_GENERATED (brush)) if (! GIMP_IS_BRUSH_GENERATED (brush))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Brush '%s' is not a generated brush"), name); _("Brush '%s' is not a generated brush"), name);
return NULL; return NULL;
} }
...@@ -130,7 +130,7 @@ gimp_pdb_get_dynamics (Gimp *gimp, ...@@ -130,7 +130,7 @@ gimp_pdb_get_dynamics (Gimp *gimp,
if (! name || ! strlen (name)) if (! name || ! strlen (name))
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Invalid empty paint dynamics name")); _("Invalid empty paint dynamics name"));
return NULL; return NULL;
} }
...@@ -139,12 +139,12 @@ gimp_pdb_get_dynamics (Gimp *gimp, ...@@ -139,12 +139,12 @@ gimp_pdb_get_dynamics (Gimp *gimp,
if (! dynamics) if (! dynamics)
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Paint dynamics '%s' not found"), name); _("Paint dynamics '%s' not found"), name);
} }
else if (writable && ! gimp_data_is_writable (GIMP_DATA (dynamics))) else if (writable && ! gimp_data_is_writable (GIMP_DATA (dynamics)))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Paint dynamics '%s' is not editable"), name); _("Paint dynamics '%s' is not editable"), name);
return NULL; return NULL;
} }
...@@ -164,7 +164,7 @@ gimp_pdb_get_pattern (Gimp *gimp, ...@@ -164,7 +164,7 @@ gimp_pdb_get_pattern (Gimp *gimp,
if (! name || ! strlen (name)) if (! name || ! strlen (name))
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Invalid empty pattern name")); _("Invalid empty pattern name"));
return NULL; return NULL;
} }
...@@ -173,7 +173,7 @@ gimp_pdb_get_pattern (Gimp *gimp, ...@@ -173,7 +173,7 @@ gimp_pdb_get_pattern (Gimp *gimp,
if (! pattern) if (! pattern)
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Pattern '%s' not found"), name); _("Pattern '%s' not found"), name);
} }
...@@ -193,7 +193,7 @@ gimp_pdb_get_gradient (Gimp *gimp, ...@@ -193,7 +193,7 @@ gimp_pdb_get_gradient (Gimp *gimp,
if (! name || ! strlen (name)) if (! name || ! strlen (name))
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Invalid empty gradient name")); _("Invalid empty gradient name"));
return NULL; return NULL;
} }
...@@ -202,12 +202,12 @@ gimp_pdb_get_gradient (Gimp *gimp, ...@@ -202,12 +202,12 @@ gimp_pdb_get_gradient (Gimp *gimp,
if (! gradient) if (! gradient)
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Gradient '%s' not found"), name); _("Gradient '%s' not found"), name);
} }
else if (writable && ! gimp_data_is_writable (GIMP_DATA (gradient))) else if (writable && ! gimp_data_is_writable (GIMP_DATA (gradient)))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Gradient '%s' is not editable"), name); _("Gradient '%s' is not editable"), name);
return NULL; return NULL;
} }
...@@ -228,7 +228,7 @@ gimp_pdb_get_palette (Gimp *gimp, ...@@ -228,7 +228,7 @@ gimp_pdb_get_palette (Gimp *gimp,
if (! name || ! strlen (name)) if (! name || ! strlen (name))
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Invalid empty palette name")); _("Invalid empty palette name"));
return NULL; return NULL;
} }
...@@ -237,12 +237,12 @@ gimp_pdb_get_palette (Gimp *gimp, ...@@ -237,12 +237,12 @@ gimp_pdb_get_palette (Gimp *gimp,
if (! palette) if (! palette)
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Palette '%s' not found"), name); _("Palette '%s' not found"), name);
} }
else if (writable && ! gimp_data_is_writable (GIMP_DATA (palette))) else if (writable && ! gimp_data_is_writable (GIMP_DATA (palette)))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Palette '%s' is not editable"), name); _("Palette '%s' is not editable"), name);
return NULL; return NULL;
} }
...@@ -262,7 +262,7 @@ gimp_pdb_get_font (Gimp *gimp, ...@@ -262,7 +262,7 @@ gimp_pdb_get_font (Gimp *gimp,
if (! name || ! strlen (name)) if (! name || ! strlen (name))
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Invalid empty font name")); _("Invalid empty font name"));
return NULL; return NULL;
} }
...@@ -272,7 +272,7 @@ gimp_pdb_get_font (Gimp *gimp, ...@@ -272,7 +272,7 @@ gimp_pdb_get_font (Gimp *gimp,
if (! font) if (! font)
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Font '%s' not found"), name); _("Font '%s' not found"), name);
} }
...@@ -291,7 +291,7 @@ gimp_pdb_get_buffer (Gimp *gimp, ...@@ -291,7 +291,7 @@ gimp_pdb_get_buffer (Gimp *gimp,
if (! name || ! strlen (name)) if (! name || ! strlen (name))
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Invalid empty buffer name")); _("Invalid empty buffer name"));
return NULL; return NULL;
} }
...@@ -301,7 +301,7 @@ gimp_pdb_get_buffer (Gimp *gimp, ...@@ -301,7 +301,7 @@ gimp_pdb_get_buffer (Gimp *gimp,
if (! buffer) if (! buffer)
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Named buffer '%s' not found"), name); _("Named buffer '%s' not found"), name);
} }
...@@ -320,7 +320,7 @@ gimp_pdb_get_paint_info (Gimp *gimp, ...@@ -320,7 +320,7 @@ gimp_pdb_get_paint_info (Gimp *gimp,
if (! name || ! strlen (name)) if (! name || ! strlen (name))
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Invalid empty paint method name")); _("Invalid empty paint method name"));
return NULL; return NULL;
} }
...@@ -330,7 +330,7 @@ gimp_pdb_get_paint_info (Gimp *gimp, ...@@ -330,7 +330,7 @@ gimp_pdb_get_paint_info (Gimp *gimp,
if (! paint_info) if (! paint_info)
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Paint method '%s' does not exist"), name); _("Paint method '%s' does not exist"), name);
} }
...@@ -349,7 +349,7 @@ gimp_pdb_item_is_attached (GimpItem *item, ...@@ -349,7 +349,7 @@ gimp_pdb_item_is_attached (GimpItem *item,
if (! gimp_item_is_attached (item)) if (! gimp_item_is_attached (item))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Item '%s' (%d) cannot be used because it has not " _("Item '%s' (%d) cannot be used because it has not "
"been added to an image"), "been added to an image"),
gimp_object_get_name (item), gimp_object_get_name (item),
...@@ -359,7 +359,7 @@ gimp_pdb_item_is_attached (GimpItem *item, ...@@ -359,7 +359,7 @@ gimp_pdb_item_is_attached (GimpItem *item,
if (image && image != gimp_item_get_image (item)) if (image && image != gimp_item_get_image (item))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Item '%s' (%d) cannot be used because it is " _("Item '%s' (%d) cannot be used because it is "
"attached to another image"), "attached to another image"),
gimp_object_get_name (item), gimp_object_get_name (item),
...@@ -388,7 +388,7 @@ gimp_pdb_item_is_in_tree (GimpItem *item, ...@@ -388,7 +388,7 @@ gimp_pdb_item_is_in_tree (GimpItem *item,
if (! gimp_item_get_tree (item)) if (! gimp_item_get_tree (item))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Item '%s' (%d) cannot be used because it is not " _("Item '%s' (%d) cannot be used because it is not "
"a direct child of an item tree"), "a direct child of an item tree"),
gimp_object_get_name (item), gimp_object_get_name (item),
...@@ -416,7 +416,7 @@ gimp_pdb_item_is_in_same_tree (GimpItem *item, ...@@ -416,7 +416,7 @@ gimp_pdb_item_is_in_same_tree (GimpItem *item,
if (gimp_item_get_tree (item) != gimp_item_get_tree (item2)) if (gimp_item_get_tree (item) != gimp_item_get_tree (item2))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Items '%s' (%d) and '%s' (%d) cannot be used " _("Items '%s' (%d) and '%s' (%d) cannot be used "
"because they are not part of the same item tree"), "because they are not part of the same item tree"),
gimp_object_get_name (item), gimp_object_get_name (item),
...@@ -441,7 +441,7 @@ gimp_pdb_item_is_not_ancestor (GimpItem *item, ...@@ -441,7 +441,7 @@ gimp_pdb_item_is_not_ancestor (GimpItem *item,
if (gimp_viewable_is_ancestor (GIMP_VIEWABLE (item), if (gimp_viewable_is_ancestor (GIMP_VIEWABLE (item),
GIMP_VIEWABLE (not_descendant))) GIMP_VIEWABLE (not_descendant)))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Item '%s' (%d) must not be an ancestor of " _("Item '%s' (%d) must not be an ancestor of "
"'%s' (%d)"), "'%s' (%d)"),
gimp_object_get_name (item), gimp_object_get_name (item),
...@@ -465,7 +465,7 @@ gimp_pdb_item_is_floating (GimpItem *item, ...@@ -465,7 +465,7 @@ gimp_pdb_item_is_floating (GimpItem *item,
if (! g_object_is_floating (item)) if (! g_object_is_floating (item))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Item '%s' (%d) has already been added to an image"), _("Item '%s' (%d) has already been added to an image"),
gimp_object_get_name (item), gimp_object_get_name (item),
gimp_item_get_ID (item)); gimp_item_get_ID (item));
...@@ -473,7 +473,7 @@ gimp_pdb_item_is_floating (GimpItem *item, ...@@ -473,7 +473,7 @@ gimp_pdb_item_is_floating (GimpItem *item,
} }
else if (gimp_item_get_image (item) != dest_image) else if (gimp_item_get_image (item) != dest_image)
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Trying to add item '%s' (%d) to wrong image"), _("Trying to add item '%s' (%d) to wrong image"),
gimp_object_get_name (item), gimp_object_get_name (item),
gimp_item_get_ID (item)); gimp_item_get_ID (item));
...@@ -492,7 +492,7 @@ gimp_pdb_item_is_writable (GimpItem *item, ...@@ -492,7 +492,7 @@ gimp_pdb_item_is_writable (GimpItem *item,
if (gimp_item_is_content_locked (item)) if (gimp_item_is_content_locked (item))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Item '%s' (%d) cannot be modified because its " _("Item '%s' (%d) cannot be modified because its "
"contents are locked"), "contents are locked"),
gimp_object_get_name (item), gimp_object_get_name (item),
...@@ -512,7 +512,7 @@ gimp_pdb_item_is_group (GimpItem *item, ...@@ -512,7 +512,7 @@ gimp_pdb_item_is_group (GimpItem *item,
if (! gimp_viewable_get_children (GIMP_VIEWABLE (item))) if (! gimp_viewable_get_children (GIMP_VIEWABLE (item)))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Item '%s' (%d) cannot be used because it is " _("Item '%s' (%d) cannot be used because it is "
"not a group item"), "not a group item"),
gimp_object_get_name (item), gimp_object_get_name (item),
...@@ -532,7 +532,7 @@ gimp_pdb_item_is_not_group (GimpItem *item, ...@@ -532,7 +532,7 @@ gimp_pdb_item_is_not_group (GimpItem *item,
if (gimp_viewable_get_children (GIMP_VIEWABLE (item))) if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Item '%s' (%d) cannot be modified because it " _("Item '%s' (%d) cannot be modified because it "
"is a group item"), "is a group item"),
gimp_object_get_name (item), gimp_object_get_name (item),
...@@ -553,7 +553,7 @@ gimp_pdb_layer_is_text_layer (GimpLayer *layer, ...@@ -553,7 +553,7 @@ gimp_pdb_layer_is_text_layer (GimpLayer *layer,
if (! gimp_item_is_text_layer (GIMP_ITEM (layer))) if (! gimp_item_is_text_layer (GIMP_ITEM (layer)))
{ {
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Layer '%s' (%d) cannot be used because it is not " _("Layer '%s' (%d) cannot be used because it is not "
"a text layer"), "a text layer"),
gimp_object_get_name (layer), gimp_object_get_name (layer),
...@@ -594,7 +594,7 @@ gimp_pdb_image_is_base_type (GimpImage *image, ...@@ -594,7 +594,7 @@ gimp_pdb_image_is_base_type (GimpImage *image,
if (gimp_image_base_type (image) == type) if (gimp_image_base_type (image) == type)
return TRUE; return TRUE;
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Image '%s' (%d) is of type '%s', " _("Image '%s' (%d) is of type '%s', "
"but an image of type '%s' is expected"), "but an image of type '%s' is expected"),
gimp_image_get_display_name (image), gimp_image_get_display_name (image),
...@@ -617,7 +617,7 @@ gimp_pdb_image_is_not_base_type (GimpImage *image, ...@@ -617,7 +617,7 @@ gimp_pdb_image_is_not_base_type (GimpImage *image,
if (gimp_image_base_type (image) != type) if (gimp_image_base_type (image) != type)
return TRUE; return TRUE;
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Image '%s' (%d) is already of type '%s'"), _("Image '%s' (%d) is already of type '%s'"),
gimp_image_get_display_name (image), gimp_image_get_display_name (image),
gimp_image_get_ID (image), gimp_image_get_ID (image),
...@@ -645,7 +645,7 @@ gimp_pdb_get_vectors_stroke (GimpVectors *vectors, ...@@ -645,7 +645,7 @@ gimp_pdb_get_vectors_stroke (GimpVectors *vectors,
stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_ID); stroke = gimp_vectors_stroke_get_by_ID (vectors, stroke_ID);
if (! stroke) if (! stroke)
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Vectors object %d does not contain stroke with ID %d"), _("Vectors object %d does not contain stroke with ID %d"),
gimp_item_get_ID (GIMP_ITEM (vectors)), stroke_ID); gimp_item_get_ID (GIMP_ITEM (vectors)), stroke_ID);
} }
......
...@@ -301,7 +301,7 @@ gimp_pdb_execute_procedure_by_name_args (GimpPDB *pdb, ...@@ -301,7 +301,7 @@ gimp_pdb_execute_procedure_by_name_args (GimpPDB *pdb,
if (list == NULL) if (list == NULL)
{ {
GError *pdb_error = g_error_new (GIMP_PDB_ERROR, GError *pdb_error = g_error_new (GIMP_PDB_ERROR,
GIMP_PDB_PROCEDURE_NOT_FOUND, GIMP_PDB_ERROR_PROCEDURE_NOT_FOUND,
_("Procedure '%s' not found"), name); _("Procedure '%s' not found"), name);
return_vals = gimp_procedure_get_return_values (NULL, FALSE, pdb_error); return_vals = gimp_procedure_get_return_values (NULL, FALSE, pdb_error);
...@@ -371,7 +371,7 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb, ...@@ -371,7 +371,7 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb,
if (! procedure) if (! procedure)
{ {
GError *pdb_error = g_error_new (GIMP_PDB_ERROR, GError *pdb_error = g_error_new (GIMP_PDB_ERROR,
GIMP_PDB_PROCEDURE_NOT_FOUND, GIMP_PDB_ERROR_PROCEDURE_NOT_FOUND,
_("Procedure '%s' not found"), name); _("Procedure '%s' not found"), name);
return_vals = gimp_procedure_get_return_values (NULL, FALSE, pdb_error); return_vals = gimp_procedure_get_return_values (NULL, FALSE, pdb_error);
...@@ -405,7 +405,8 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb, ...@@ -405,7 +405,8 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb,
g_value_array_free (args); g_value_array_free (args);
pdb_error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, pdb_error = g_error_new (GIMP_PDB_ERROR,
GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Procedure '%s' has been called with a " _("Procedure '%s' has been called with a "
"wrong type for argument #%d. " "wrong type for argument #%d. "
"Expected %s, got %s."), "Expected %s, got %s."),
...@@ -426,7 +427,7 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb, ...@@ -426,7 +427,7 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb,
if (error_msg) if (error_msg)
{ {
GError *pdb_error = g_error_new_literal (GIMP_PDB_ERROR, GError *pdb_error = g_error_new_literal (GIMP_PDB_ERROR,
GIMP_PDB_INTERNAL_ERROR, GIMP_PDB_ERROR_INTERNAL_ERROR,
error_msg); error_msg);
g_warning ("%s: %s", G_STRFUNC, error_msg); g_warning ("%s: %s", G_STRFUNC, error_msg);
g_free (error_msg); g_free (error_msg);
......
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
typedef enum typedef enum
{ {
GIMP_PDB_FAILED, /* generic error condition */ GIMP_PDB_ERROR_FAILED, /* generic error condition */
GIMP_PDB_CANCELLED, GIMP_PDB_ERROR_CANCELLED,
GIMP_PDB_PROCEDURE_NOT_FOUND, GIMP_PDB_ERROR_PROCEDURE_NOT_FOUND,
GIMP_PDB_INVALID_ARGUMENT, GIMP_PDB_ERROR_INVALID_ARGUMENT,
GIMP_PDB_INVALID_RETURN_VALUE, GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
GIMP_PDB_INTERNAL_ERROR GIMP_PDB_ERROR_INTERNAL_ERROR
} GimpPdbErrorCode; } GimpPdbErrorCode;
......
...@@ -352,7 +352,8 @@ gimp_procedure_execute (GimpProcedure *procedure, ...@@ -352,7 +352,8 @@ gimp_procedure_execute (GimpProcedure *procedure,
if (return_vals->n_values > 1 && if (return_vals->n_values > 1 &&
G_VALUE_HOLDS_STRING (&return_vals->values[1])) G_VALUE_HOLDS_STRING (&return_vals->values[1]))
{ {
g_set_error_literal (error, GIMP_PDB_ERROR, GIMP_PDB_FAILED, g_set_error_literal (error, GIMP_PDB_ERROR,
GIMP_PDB_ERROR_FAILED,
g_value_get_string (&return_vals->values[1])); g_value_get_string (&return_vals->values[1]));
} }
} }
...@@ -366,7 +367,8 @@ gimp_procedure_execute (GimpProcedure *procedure, ...@@ -366,7 +367,8 @@ gimp_procedure_execute (GimpProcedure *procedure,
{ {
g_warning ("%s: no return values, shouldn't happen", G_STRFUNC); g_warning ("%s: no return values, shouldn't happen", G_STRFUNC);
pdb_error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE, pdb_error = g_error_new (GIMP_PDB_ERROR,
GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
_("Procedure '%s' returned no return values"), _("Procedure '%s' returned no return values"),
gimp_object_get_name (procedure)); gimp_object_get_name (procedure));
...@@ -476,15 +478,15 @@ gimp_procedure_get_return_values (GimpProcedure *procedure, ...@@ -476,15 +478,15 @@ gimp_procedure_get_return_values (GimpProcedure *procedure,
{ {
switch ((GimpPdbErrorCode) error->code) switch ((GimpPdbErrorCode) error->code)
{ {
case GIMP_PDB_FAILED: case GIMP_PDB_ERROR_FAILED:
case GIMP_PDB_PROCEDURE_NOT_FOUND: case GIMP_PDB_ERROR_PROCEDURE_NOT_FOUND:
case GIMP_PDB_INVALID_ARGUMENT: case GIMP_PDB_ERROR_INVALID_ARGUMENT:
case GIMP_PDB_INVALID_RETURN_VALUE: case GIMP_PDB_ERROR_INVALID_RETURN_VALUE:
case GIMP_PDB_INTERNAL_ERROR: case GIMP_PDB_ERROR_INTERNAL_ERROR:
g_value_set_enum (&value, GIMP_PDB_CALLING_ERROR); g_value_set_enum (&value, GIMP_PDB_CALLING_ERROR);
break; break;
case GIMP_PDB_CANCELLED: case GIMP_PDB_ERROR_CANCELLED:
g_value_set_enum (&value, GIMP_PDB_CANCEL); g_value_set_enum (&value, GIMP_PDB_CANCEL);
break; break;
...@@ -636,7 +638,7 @@ gimp_procedure_validate_args (GimpProcedure *procedure, ...@@ -636,7 +638,7 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
if (return_vals) if (return_vals)
{ {
g_set_error (error, g_set_error (error,
GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
_("Procedure '%s' returned a wrong value type " _("Procedure '%s' returned a wrong value type "
"for return value '%s' (#%d). " "for return value '%s' (#%d). "
"Expected %s, got %s."), "Expected %s, got %s."),
...@@ -648,7 +650,7 @@ gimp_procedure_validate_args (GimpProcedure *procedure, ...@@ -648,7 +650,7 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
else else
{ {
g_set_error (error, g_set_error (error,
GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, GIMP_PDB_ERROR, GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Procedure '%s' has been called with a " _("Procedure '%s' has been called with a "
"wrong value type for argument '%s' (#%d). " "wrong value type for argument '%s' (#%d). "
"Expected %s, got %s."), "Expected %s, got %s."),
...@@ -680,7 +682,8 @@ gimp_procedure_validate_args (GimpProcedure *procedure, ...@@ -680,7 +682,8 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
if (return_vals) if (return_vals)
{ {
g_set_error (error, g_set_error (error,
GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE, GIMP_PDB_ERROR,
GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
_("Procedure '%s' returned an " _("Procedure '%s' returned an "
"invalid ID for argument '%s'. " "invalid ID for argument '%s'. "
"Most likely a plug-in is trying " "Most likely a plug-in is trying "
...@@ -692,7 +695,8 @@ gimp_procedure_validate_args (GimpProcedure *procedure, ...@@ -692,7 +695,8 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
else else
{ {
g_set_error (error, g_set_error (error,
GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, GIMP_PDB_ERROR,
GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Procedure '%s' has been called with an " _("Procedure '%s' has been called with an "
"invalid ID for argument '%s'. " "invalid ID for argument '%s'. "
"Most likely a plug-in is trying " "Most likely a plug-in is trying "
...@@ -708,7 +712,8 @@ gimp_procedure_validate_args (GimpProcedure *procedure, ...@@ -708,7 +712,8 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
if (return_vals) if (return_vals)
{ {
g_set_error (error, g_set_error (error,
GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE, GIMP_PDB_ERROR,
GIMP_PDB_ERROR_INVALID_RETURN_VALUE,
_("Procedure '%s' returned an " _("Procedure '%s' returned an "
"invalid ID for argument '%s'. " "invalid ID for argument '%s'. "
"Most likely a plug-in is trying " "Most likely a plug-in is trying "
...@@ -720,7 +725,8 @@ gimp_procedure_validate_args (GimpProcedure *procedure, ...@@ -720,7 +725,8 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
else else
{ {
g_set_error (error, g_set_error (error,
GIMP_PDB_ERROR, GIMP_PDB_INVALID_ARGUMENT, GIMP_PDB_ERROR,
GIMP_PDB_ERROR_INVALID_ARGUMENT,
_("Procedure '%s' has been called with an " _("Procedure '%s' has been called with an "
"invalid ID for argument '%s'. " "invalid ID for argument '%s'. "
"Most likely a plug-in is trying " "Most likely a plug-in is trying "
...@@ -740,7 +746,8 @@ gimp_procedure_validate_args (GimpProcedure *procedure, ...@@ -740,7 +746,8 @@ gimp_procedure_validate_args (GimpProcedure *procedure,
if (return_vals)