Commit 46b7fdb8 authored by Rebecca Walter's avatar Rebecca Walter Committed by Rebecca Jean Pedersen
Browse files

app/core/gimpcontext.c app/core/gimpdatafactory.c

2001-11-16  Rebecca Walter  <rjp@mail.tele.dk>

        * app/core/gimpcontext.c
        * app/core/gimpdatafactory.c
        * app/core/gimpdrawable-bucket-fill.c
        * app/core/gimpdrawable.c
        * app/core/gimpgradient.c
        * app/core/gimpimage-convert.c
        * app/core/gimpimage-mask.c
        * app/core/gimpimage.c: Extensive proofreading of messages and
        warnings.  Improved standardization of string format and content.
parent d7b3fbe5
2001-11-16 Rebecca Walter <rjp@mail.tele.dk>
* app/core/gimpcontext.c
* app/core/gimpdatafactory.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable.c
* app/core/gimpgradient.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-mask.c
* app/core/gimpimage.c: Extensive proofreading of messages and
warnings. Improved standardization of string format and content.
2001-11-15 Michael Natterer <mitch@gimp.org>
Gimp's opacity values are a pain... the core actually *should*
......
......@@ -45,6 +45,7 @@
#include "gimppattern.h"
#include "gimptoolinfo.h"
#include "libgimp/gimpintl.h"
typedef void (* GimpContextCopyPropFunc) (GimpContext *src,
GimpContext *dest);
......@@ -966,7 +967,7 @@ gimp_context_set_name (GimpContext *context,
g_return_if_fail (GIMP_IS_CONTEXT (context));
if (! name)
name = "Unnamed";
name = _("Unnamed");
gimp_object_set_name (GIMP_OBJECT (context), name);
}
......
......@@ -278,9 +278,10 @@ gimp_data_factory_data_load_callback (const gchar *filename,
}
else
{
g_warning ("%s(): trying legacy loader on file with unknown "
"extension: %s",
G_GNUC_FUNCTION, filename);
g_message (_("Trying legacy loader on\n"
"file '%s'\n"
"with unknown extension."),
filename);
goto insert;
}
}
......@@ -295,7 +296,7 @@ gimp_data_factory_data_load_callback (const gchar *filename,
if (! data)
{
g_message (_("Warning: Failed to load data from\n\"%s\""), filename);
g_message (_("Warning: Failed to load data from\n'%s'"), filename);
}
else
{
......
......@@ -111,7 +111,7 @@ gimp_drawable_bucket_fill (GimpDrawable *drawable,
if (! pattern)
{
g_message (_("No available patterns for this operation."));
g_message (_("No patterns available for this operation."));
return;
}
}
......
......@@ -343,7 +343,7 @@ gimp_drawable_configure (GimpDrawable *drawable,
(gpointer) drawable);
if (!name)
name = _("unnamed");
name = _("Unnamed");
switch (type)
{
......@@ -360,7 +360,8 @@ gimp_drawable_configure (GimpDrawable *drawable,
case INDEXEDA_GIMAGE:
bpp = 2; alpha = TRUE; break;
default:
g_message (_("Layer type %d not supported."), type);
g_warning ("%s: Layer type %d not supported.",
G_GNUC_PRETTY_FUNCTION, type);
return;
}
......@@ -556,7 +557,7 @@ gimp_drawable_fill (GimpDrawable *drawable,
break;
default:
g_message (_("Can't fill unknown image type."));
g_warning ("%s: Cannot fill unknown image type.", G_GNUC_PRETTY_FUNCTION);
break;
}
......@@ -607,7 +608,7 @@ gimp_drawable_fill_by_type (GimpDrawable *drawable,
return;
default:
g_warning ("gimp_drawable_fill_by_type(): unknown fill type");
g_warning ("%s: unknown fill type %d", G_GNUC_PRETTY_FUNCTION, fill_type);
return;
}
......@@ -840,7 +841,7 @@ gimp_drawable_parasite_attach (GimpDrawable *drawable,
gimp_drawable_parasite_find
(drawable, gimp_parasite_name (parasite))))
{
undo_push_cantundo (drawable->gimage, _("parasite attach to drawable"));
undo_push_cantundo (drawable->gimage, _("parasite attached to drawable"));
}
gimp_parasite_list_add (drawable->parasites, parasite);
......@@ -878,7 +879,7 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable,
undo_push_drawable_parasite_remove (drawable->gimage, drawable,
gimp_parasite_name (p));
else if (gimp_parasite_is_persistent (p))
undo_push_cantundo (drawable->gimage, _("detach parasite from drawable"));
undo_push_cantundo (drawable->gimage, _("parasite detached from drawable"));
gimp_parasite_list_remove (drawable->parasites, parasite);
}
......
......@@ -328,7 +328,7 @@ gimp_gradient_load (const gchar *filename)
}
else
{
g_message (_("Invalid UTF-8 string in GIMP gradient file \"%s\"."),
g_message (_("Invalid UTF-8 string in gradient file '%s'."),
filename);
gimp_object_set_name (GIMP_OBJECT (gradient), _("Unnamed"));
}
......@@ -350,8 +350,8 @@ gimp_gradient_load (const gchar *filename)
if (num_segments < 1)
{
g_message ("%s(): invalid number of segments in \"%s\"",
G_GNUC_FUNCTION, filename);
g_message ("Fatal parsing error:\nGradient file '%s' is corrupt.",
filename);
g_object_unref (G_OBJECT (gradient));
fclose (file);
return NULL;
......@@ -406,9 +406,8 @@ gimp_gradient_load (const gchar *filename)
}
else
{
g_message ("%s(): badly formatted gradient segment %d in \"%s\" --- "
"bad things may happen soon",
G_GNUC_FUNCTION, i, filename);
g_message (_("Corrupt segment %d in gradient file '%s'."),
i, filename);
}
prev = seg;
......@@ -447,8 +446,7 @@ gimp_gradient_save (GimpData *data)
file = fopen (data->filename, "wb");
if (! file)
{
g_message ("%s(): can't open \"%s\"",
G_GNUC_FUNCTION, data->filename);
g_message (_("Unable to save '%s':\n%s"), data->filename, g_strerror (errno));
return FALSE;
}
......@@ -577,8 +575,8 @@ gimp_gradient_get_color_at (GimpGradient *gradient,
break;
default:
gimp_fatal_error ("%s(): Unknown gradient type %d",
G_GNUC_FUNCTION, (gint) seg->type);
g_warning ("%s: Unknown gradient type %d.",
G_GNUC_PRETTY_FUNCTION, seg->type);
break;
}
......@@ -639,8 +637,8 @@ gimp_gradient_get_color_at (GimpGradient *gradient,
break;
default:
gimp_fatal_error ("%s(): Unknown coloring mode %d",
G_GNUC_FUNCTION, (gint) seg->color);
g_warning ("%s(): Unknown coloring mode %d",
G_GNUC_PRETTY_FUNCTION, (gint) seg->color);
break;
}
......@@ -687,8 +685,8 @@ gimp_gradient_get_segment_at (GimpGradient *gradient,
}
/* Oops: we should have found a segment, but we didn't */
gimp_fatal_error ("%s(): no matching segment for position %0.15f",
G_GNUC_FUNCTION, pos);
g_warning ("%s(): no matching segment for position %0.15f",
G_GNUC_PRETTY_FUNCTION, pos);
return NULL;
}
......
......@@ -1279,7 +1279,7 @@ generate_histogram_rgb (CFHistogram histogram,
* quantizing at a later stage.
*/
needs_quantize = TRUE;
/* g_print (_("\nmax colours exceeded - needs quantize.\n"));*/
/* g_print ("\nmax colours exceeded - needs quantize.\n");*/
goto already_found;
}
else
......@@ -2861,8 +2861,8 @@ median_cut_pass2_nodestruct_dither_rgb (QuantizeObj *quantobj,
goto got_colour;
}
}
g_error ("Non-existant colour was expected to "
"be in non-destructive colourmap.");
g_error ("Nonexistent color was expected to "
"be in nondestructive colormap.");
got_colour:
dest[INDEXED_PIX] = lastindex;
if (has_alpha)
......
......@@ -1245,7 +1245,7 @@ gimp_image_apply_image (GimpImage *gimage,
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("%s(): illegal parameters", G_GNUC_FUNCTION);
g_warning ("%s: illegal parameters.", G_GNUC_PRETTY_FUNC);
return;
}
......@@ -1354,7 +1354,7 @@ gimp_image_replace_image (GimpImage *gimage,
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("%s(): got illegal parameters", G_GNUC_FUNCTION);
g_warning ("%s: illegal parameters.", G_GNUC_PRETTY_FUNC);
return;
}
......@@ -1914,7 +1914,8 @@ gimp_image_get_new_tattoo (GimpImage *gimage)
gimage->tattoo_state++;
if (gimage->tattoo_state <= 0)
g_warning ("gimp_image_get_new_tattoo(): Tattoo state has become corrupt (2.1 billion operation limit exceded)");
g_warning ("%s: Tattoo state corrupted "
"(integer overflow).", G_GNUC_PRETTY_FUNC);
return gimage->tattoo_state;
}
......@@ -2172,7 +2173,7 @@ project_indexed (GimpImage *gimage,
initial_region (src, dest, NULL, gimage->cmap, layer->opacity,
layer->mode, gimage->visible, INITIAL_INDEXED);
else
g_message ("%s(): unable to project indexed image.", G_GNUC_FUNCTION);
g_warning ("%s: unable to project indexed image.", G_GNUC_PRETTY_FUNCTION);
}
static void
......@@ -3186,8 +3187,7 @@ gimp_image_raise_layer (GimpImage *gimage,
/* is this the top layer already? */
if (curpos == 0)
{
g_message (_("%s(): layer cannot be raised any further"),
G_GNUC_FUNCTION);
g_message (_("Layer cannot be raised higher."));
return FALSE;
}
......@@ -3211,8 +3211,7 @@ gimp_image_lower_layer (GimpImage *gimage,
length = gimp_container_num_children (gimage->layers);
if (curpos >= length - 1)
{
g_message (_("%s(): layer cannot be lowered any further"),
G_GNUC_FUNCTION);
g_message (_("Layer cannot be lowered more."));
return FALSE;
}
......@@ -3233,14 +3232,13 @@ gimp_image_raise_layer_to_top (GimpImage *gimage,
if (curpos == 0)
{
g_message (_("%s(): layer is already on top"),
G_GNUC_FUNCTION);
g_message (_("Layer is already on top."));
return FALSE;
}
if (! gimp_layer_has_alpha (layer))
{
g_message (_("%s(): can't raise Layer without alpha"), G_GNUC_FUNCTION);
g_message (_("Cannot raise a layer without alpha."));
return FALSE;
}
......@@ -3264,7 +3262,7 @@ gimp_image_lower_layer_to_bottom (GimpImage *gimage,
if (curpos >= length - 1)
{
g_message (_("%s(): layer is already on bottom"), G_GNUC_FUNCTION);
g_message (_("Layer is already on the bottom."));
return FALSE;
}
......@@ -3311,7 +3309,8 @@ gimp_image_position_layer (GimpImage *gimage,
if (new_index == num_layers - 1 &&
! gimp_layer_has_alpha (tmp))
{
g_message (_("BG has no alpha, layer was placed above"));
g_message (_("Layer \"%s\" has no alpha.\nLayer was placed above it."),
GIMP_OBJECT (tmp)->name);
new_index--;
}
}
......@@ -3381,7 +3380,8 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
if (had_floating_sel)
return layer;
else
g_message (_("There are not enough visible layers for a merge.\nThere must be at least two."));
g_message (_("Not enough visible layers for a merge.\n"
"There must be at least two."));
return NULL;
}
......@@ -3595,7 +3595,8 @@ gimp_image_merge_layers (GimpImage *gimage,
OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer)
{
g_message ("gimp_image_merge_layers: could not allocate merge layer");
g_warning ("%s: could not allocate merge layer.",
G_GNUC_PRETTY_FUNC);
return NULL;
}
......@@ -3633,7 +3634,8 @@ gimp_image_merge_layers (GimpImage *gimage,
if (!merge_layer)
{
g_message ("gimp_image_merge_layers: could not allocate merge layer");
g_warning ("%s: could not allocate merge layer",
G_GNUC_PRETTY_FUNC);
return NULL;
}
......@@ -3692,7 +3694,8 @@ gimp_image_merge_layers (GimpImage *gimage,
if (operation == -1)
{
g_message ("gimp_image_merge_layers attempting to merge incompatible layers\n");
g_warning ("%s: attempting to merge incompatible layers.",
G_GNUC_PRETTY_FUNCTION);
return NULL;
}
......@@ -3793,13 +3796,15 @@ gimp_image_add_layer (GimpImage *gimage,
if (GIMP_DRAWABLE (layer)->gimage != NULL &&
GIMP_DRAWABLE (layer)->gimage != gimage)
{
g_message ("gimp_image_add_layer: attempt to add layer to wrong image");
g_warning ("%s: attempting to add layer to wrong image.",
G_GNUC_PRETTY_FUNC);
return FALSE;
}
if (gimp_container_have (gimage->layers, GIMP_OBJECT (layer)))
{
g_message ("gimp_image_add_layer: trying to add layer to image twice");
g_warning ("%s: trying to add layer to image twice.",
G_GNUC_PRETTY_FUNC);
return FALSE;
}
......@@ -3943,7 +3948,7 @@ gimp_image_raise_channel (GimpImage *gimage,
GIMP_OBJECT (channel));
if (index == 0)
{
g_message (_("Channel cannot be raised any further"));
g_message (_("Channel cannot be raised higher."));
return FALSE;
}
......@@ -3963,7 +3968,7 @@ gimp_image_lower_channel (GimpImage *gimage,
GIMP_OBJECT (channel));
if (index == gimp_container_num_children (gimage->channels) - 1)
{
g_message (_("Channel cannot be lowered any further"));
g_message (_("Channel cannot be lowered more."));
return FALSE;
}
......@@ -4018,15 +4023,15 @@ gimp_image_add_channel (GimpImage *gimage,
if (GIMP_DRAWABLE (channel)->gimage != NULL &&
GIMP_DRAWABLE (channel)->gimage != gimage)
{
g_message ("%s(): attempt to add channel to wrong image",
G_GNUC_FUNCTION);
g_warning ("%s: attempting to add channel to wrong image.",
G_GNUC_PRETTY_FUNCTION);
return FALSE;
}
if (gimp_container_have (gimage->channels, GIMP_OBJECT (channel)))
{
g_message ("%s(): trying to add channel to image twice",
G_GNUC_FUNCTION);
g_warning ("%s: trying to add channel to image twice.",
G_GNUC_PRETTY_FUNCTION);
return FALSE;
}
......
......@@ -231,8 +231,8 @@ gimage_mask_extract (GimpImage *gimage,
non_empty = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
if (non_empty && (!(x2 - x1) || !(y2 - y1)))
{
g_message (_("Unable to cut/copy because the selected\n"
"region is empty."));
g_message (_("Unable to cut or copy because the\n"
"selected region is empty."));
return NULL;
}
......@@ -376,7 +376,7 @@ gimage_mask_float (GimpImage *gimage,
non_empty = gimp_drawable_mask_bounds ( (drawable), &x1, &y1, &x2, &y2);
if (! non_empty || (x2 - x1) == 0 || (y2 - y1) == 0)
{
g_message (_("Float Selection: No selection to float."));
g_message (_("Cannot float selection: No selection made."));
return NULL;
}
......@@ -596,7 +596,7 @@ gimage_mask_stroke (GimpImage *gimage,
if (! gimage_mask_boundary (gimage, &bs_in, &bs_out,
&num_segs_in, &num_segs_out))
{
g_message (_("No selection to stroke!"));
g_message (_("No selection to stroke."));
return FALSE;
}
......
......@@ -1245,7 +1245,7 @@ gimp_image_apply_image (GimpImage *gimage,
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("%s(): illegal parameters", G_GNUC_FUNCTION);
g_warning ("%s: illegal parameters.", G_GNUC_PRETTY_FUNC);
return;
}
......@@ -1354,7 +1354,7 @@ gimp_image_replace_image (GimpImage *gimage,
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("%s(): got illegal parameters", G_GNUC_FUNCTION);
g_warning ("%s: illegal parameters.", G_GNUC_PRETTY_FUNC);
return;
}
......@@ -1914,7 +1914,8 @@ gimp_image_get_new_tattoo (GimpImage *gimage)
gimage->tattoo_state++;
if (gimage->tattoo_state <= 0)
g_warning ("gimp_image_get_new_tattoo(): Tattoo state has become corrupt (2.1 billion operation limit exceded)");
g_warning ("%s: Tattoo state corrupted "
"(integer overflow).", G_GNUC_PRETTY_FUNC);
return gimage->tattoo_state;
}
......@@ -2172,7 +2173,7 @@ project_indexed (GimpImage *gimage,
initial_region (src, dest, NULL, gimage->cmap, layer->opacity,
layer->mode, gimage->visible, INITIAL_INDEXED);
else
g_message ("%s(): unable to project indexed image.", G_GNUC_FUNCTION);
g_warning ("%s: unable to project indexed image.", G_GNUC_PRETTY_FUNCTION);
}
static void
......@@ -3186,8 +3187,7 @@ gimp_image_raise_layer (GimpImage *gimage,
/* is this the top layer already? */
if (curpos == 0)
{
g_message (_("%s(): layer cannot be raised any further"),
G_GNUC_FUNCTION);
g_message (_("Layer cannot be raised higher."));
return FALSE;
}
......@@ -3211,8 +3211,7 @@ gimp_image_lower_layer (GimpImage *gimage,
length = gimp_container_num_children (gimage->layers);
if (curpos >= length - 1)
{
g_message (_("%s(): layer cannot be lowered any further"),
G_GNUC_FUNCTION);
g_message (_("Layer cannot be lowered more."));
return FALSE;
}
......@@ -3233,14 +3232,13 @@ gimp_image_raise_layer_to_top (GimpImage *gimage,
if (curpos == 0)
{
g_message (_("%s(): layer is already on top"),
G_GNUC_FUNCTION);
g_message (_("Layer is already on top."));
return FALSE;
}
if (! gimp_layer_has_alpha (layer))
{
g_message (_("%s(): can't raise Layer without alpha"), G_GNUC_FUNCTION);
g_message (_("Cannot raise a layer without alpha."));
return FALSE;
}
......@@ -3264,7 +3262,7 @@ gimp_image_lower_layer_to_bottom (GimpImage *gimage,
if (curpos >= length - 1)
{
g_message (_("%s(): layer is already on bottom"), G_GNUC_FUNCTION);
g_message (_("Layer is already on the bottom."));
return FALSE;
}
......@@ -3311,7 +3309,8 @@ gimp_image_position_layer (GimpImage *gimage,
if (new_index == num_layers - 1 &&
! gimp_layer_has_alpha (tmp))
{
g_message (_("BG has no alpha, layer was placed above"));
g_message (_("Layer \"%s\" has no alpha.\nLayer was placed above it."),
GIMP_OBJECT (tmp)->name);
new_index--;
}
}
......@@ -3381,7 +3380,8 @@ gimp_image_merge_visible_layers (GimpImage *gimage,
if (had_floating_sel)
return layer;
else
g_message (_("There are not enough visible layers for a merge.\nThere must be at least two."));
g_message (_("Not enough visible layers for a merge.\n"
"There must be at least two."));
return NULL;
}
......@@ -3595,7 +3595,8 @@ gimp_image_merge_layers (GimpImage *gimage,
OPAQUE_OPACITY, NORMAL_MODE);
if (!merge_layer)
{
g_message ("gimp_image_merge_layers: could not allocate merge layer");
g_warning ("%s: could not allocate merge layer.",
G_GNUC_PRETTY_FUNC);
return NULL;
}
......@@ -3633,7 +3634,8 @@ gimp_image_merge_layers (GimpImage *gimage,
if (!merge_layer)
{
g_message ("gimp_image_merge_layers: could not allocate merge layer");
g_warning ("%s: could not allocate merge layer",
G_GNUC_PRETTY_FUNC);
return NULL;
}
......@@ -3692,7 +3694,8 @@ gimp_image_merge_layers (GimpImage *gimage,
if (operation == -1)
{
g_message ("gimp_image_merge_layers attempting to merge incompatible layers\n");
g_warning ("%s: attempting to merge incompatible layers.",
G_GNUC_PRETTY_FUNCTION);
return NULL;
}
......@@ -3793,13 +3796,15 @@ gimp_image_add_layer (GimpImage *gimage,
if (GIMP_DRAWABLE (layer)->gimage != NULL &&
GIMP_DRAWABLE (layer)->gimage != gimage)
{
g_message ("gimp_image_add_layer: attempt to add layer to wrong image");
g_warning ("%s: attempting to add layer to wrong image.",
G_GNUC_PRETTY_FUNC);
return FALSE;
}
if (gimp_container_have (gimage->layers, GIMP_OBJECT (layer)))
{
g_message ("gimp_image_add_layer: trying to add layer to image twice");
g_warning ("%s: trying to add layer to image twice.",
G_GNUC_PRETTY_FUNC);
return FALSE;
}
......@@ -3943,7 +3948,7 @@ gimp_image_raise_channel (GimpImage *gimage,
GIMP_OBJECT (channel));
if (index == 0)
{
g_message (_("Channel cannot be raised any further"));
g_message (_("Channel cannot be raised higher."));
return FALSE;
}
......@@ -3963,7 +3968,7 @@ gimp_image_lower_channel (GimpImage *gimage,
GIMP_OBJECT (channel));
if (index == gimp_container_num_children (gimage->channels) - 1)
{
g_message (_("Channel cannot be lowered any further"));
g_message (_("Channel cannot be lowered more."));
return FALSE;
}
......@@ -4018,15 +4023,15 @@ gimp_image_add_channel (GimpImage *gimage,
if (GIMP_DRAWABLE (channel)->gimage != NULL &&
GIMP_DRAWABLE (channel)->gimage != gimage)
{
g_message ("%s(): attempt to add channel to wrong image",
G_GNUC_FUNCTION);
g_warning ("%s: attempting to add channel to wrong image.",
G_GNUC_PRETTY_FUNCTION);
return FALSE;
}
if (gimp_container_have (gimage->channels, GIMP_OBJECT (channel)))
{
g_message ("%s(): trying to add channel to image twice",
G_GNUC_FUNCTION);
g_warning ("%s: trying to add channel to image twice.",
G_GNUC_PRETTY_FUNCTION);
return FALSE;
}
......
......@@ -1245,7 +1245,7 @@ gimp_image_apply_image (GimpImage *gimage,
operation = valid_combinations[gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("%s(): illegal parameters", G_GNUC_FUNCTION);
g_warning ("%s: illegal parameters.", G_GNUC_PRETTY_FUNC);
return;
}
......@@ -1354,7 +1354,7 @@ gimp_image_replace_image (GimpImage *gimage,
operation = valid_combinations [gimp_drawable_type (drawable)][src2PR->bytes];
if (operation == -1)
{
g_message ("%s(): got illegal parameters", G_GNUC_FUNCTION);
g_warning ("%s: illegal parameters.", G_GNUC_PRETTY_FUNC);
return;
}
......@@ -1914,7 +1914,8 @@ gimp_image_get_new_tattoo (GimpImage *gimage)
gimage->tattoo_state++;
if (gimage->tattoo_state <= 0)
g_warning ("gimp_image_get_new_tattoo(): Tattoo state has become corrupt (2.1 billion operation limit exceded)");
g_warning ("%s: Tattoo state corrupted "
"(integer overflow).", G_GNUC_PRETTY_FUNC);