app/core/gimpedit.c app/core/gimpimagefile.c app/core/gimpmoduleinfo.c

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

	* app/core/gimpedit.c
	* app/core/gimpimagefile.c
	* app/core/gimpmoduleinfo.c
	* app/core/gimpmodules.c
	* app/core/gimppalette.c
	* app/core/gimppattern.c: More of the extensive proofing. Fun fun fun!
This commit is contained in:
Rebecca Walter 2001-11-20 15:07:45 +00:00 committed by Rebecca Jean Pedersen
parent c3b545cf86
commit 57c23b69e0
14 changed files with 108 additions and 105 deletions

View File

@ -1,3 +1,14 @@
2001-11-20 Rebecca Walter <rjp@mail.tele.dk>
* app/core/gimpedit.c
* app/core/gimpimagefile.c
* app/core/gimpmoduleinfo.c
* app/core/gimpmodules.c
* app/core/gimppalette.c
* app/core/gimppattern.c: More of the extensive proofing. Fun fun fun!
2001-11-20 Sven Neumann <sven@gimp.org>
* app/gui/preferences-dialog.c

View File

@ -360,7 +360,7 @@ gimp_edit_fill (GimpImage *gimage,
return TRUE; /* nothing to do, but the fill succeded */
default:
g_warning ("%s(): unknown fill type", G_GNUC_FUNCTION);
g_warning ("%s: unknown fill type", G_GNUC_PRETTY_FUNCTION);
gimp_image_get_background (gimage, drawable, col);
break;
}

View File

@ -273,14 +273,14 @@ gimp_modules_module_initialize (const gchar *filename,
if (! module_info->load_inhibit)
{
if (gimp->be_verbose)
g_print (_("load module: \"%s\"\n"), filename);
g_print (_("loading module: '%s'\n"), filename);
gimp_module_info_module_load (module_info, TRUE);
}
else
{
if (gimp->be_verbose)
g_print (_("skipping module: \"%s\"\n"), filename);
g_print (_("skipping module: '%s'\n"), filename);
module_info->state = GIMP_MODULE_STATE_UNLOADED_OK;
}

View File

@ -360,7 +360,7 @@ gimp_edit_fill (GimpImage *gimage,
return TRUE; /* nothing to do, but the fill succeded */
default:
g_warning ("%s(): unknown fill type", G_GNUC_FUNCTION);
g_warning ("%s: unknown fill type", G_GNUC_PRETTY_FUNCTION);
gimp_image_get_background (gimage, drawable, col);
break;
}

View File

@ -253,7 +253,7 @@ gimp_imagefile_read_png_thumb (GimpImagefile *imagefile,
if (!pixbuf)
{
g_message (_("Couldn't open thumbnail file '%s'\n%s"),
g_message (_("Could not open thumbnail\nfile '%s':\n%s"),
thumbname, error->message);
g_free (thumbname);
g_error_free (error);
@ -439,7 +439,7 @@ readXVThumb (const gchar *fnam,
if (strncmp (P7_buf, P7_332, 6)!=0)
{
g_warning ("Thumbnail doesn't have the 'P7 332' header.");
g_warning ("Thumbnail does not have the 'P7 332' header.");
fclose (fp);
return NULL;
}
@ -478,14 +478,14 @@ readXVThumb (const gchar *fnam,
if (twofivefive!=255)
{
g_warning ("Thumbnail is of funky depth.");
g_warning ("Thumbnail depth is incorrect.");
fclose (fp);
return NULL;
}
if ((*w)<1 || (*h)<1 || (*w)>80 || (*h)>60)
{
g_warning ("Thumbnail size bad. Corrupted?");
g_warning ("Thumbnail size is bad. Corrupted?");
fclose (fp);
return NULL;
}

View File

@ -262,7 +262,7 @@ gimp_module_info_module_load (GimpModuleInfoObj *module_info,
gimp_module_info_set_last_error (module_info, g_module_error ());
if (verbose)
g_warning (_("module load error: %s: %s"),
g_message (_("Module '%s' load error:\n%s"),
module_info->fullpath, module_info->last_module_error);
return;
}
@ -280,12 +280,11 @@ gimp_module_info_module_load (GimpModuleInfoObj *module_info,
module_info->state = GIMP_MODULE_STATE_ERROR;
gimp_module_info_set_last_error (module_info,
"missing module_init() symbol");
_("Missing module_init() symbol"));
if (verbose)
g_warning ("%s: module_init() symbol not found",
module_info->fullpath);
g_message (_("Module '%s' load error:\n%s"),
module_info->fullpath, module_info->last_module_error);
g_module_close (module_info->module);
module_info->module = NULL;
return;

View File

@ -273,14 +273,14 @@ gimp_modules_module_initialize (const gchar *filename,
if (! module_info->load_inhibit)
{
if (gimp->be_verbose)
g_print (_("load module: \"%s\"\n"), filename);
g_print (_("loading module: '%s'\n"), filename);
gimp_module_info_module_load (module_info, TRUE);
}
else
{
if (gimp->be_verbose)
g_print (_("skipping module: \"%s\"\n"), filename);
g_print (_("skipping module: '%s'\n"), filename);
module_info->state = GIMP_MODULE_STATE_UNLOADED_OK;
}

View File

@ -257,7 +257,8 @@ gimp_palette_load (const gchar *filename)
/* Open the requested file */
if (! (fp = fopen (filename, "r")))
{
g_warning ("Failed to open palette file %s", filename);
g_message (_("Failed to open palette file '%s': %s"),
filename, g_strerror (errno));
return NULL;
}
@ -270,12 +271,11 @@ gimp_palette_load (const gchar *filename)
{
/* bad magic, but maybe it has \r\n at the end of lines? */
if (!strcmp (str, "GIMP Palette\r"))
g_message (_("Loading palette %s:\n"
"Corrupt palette:\n"
"missing magic header\n"
g_message (_("Loading palette '%s':\n"
"Corrupt palette: missing magic header\n"
"Does this file need converting from DOS?"), filename);
else
g_message (_("Loading palette %s:\n"
g_message (_("Loading palette '%s':\n"
"Corrupt palette: missing magic header"), filename);
fclose (fp);
@ -289,7 +289,7 @@ gimp_palette_load (const gchar *filename)
if (! fgets (str, 1024, fp))
{
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -314,7 +314,7 @@ gimp_palette_load (const gchar *filename)
if (! fgets (str, 1024, fp))
{
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -332,8 +332,8 @@ gimp_palette_load (const gchar *filename)
if (columns < 0 || columns > 256)
{
g_message (_("Loading palette %s (line %d):\n"
"Invalid number or columns"),
g_message (_("Loading palette '%s':\n"
"Invalid number or columns in line %d."),
filename, linenum);
columns = 0;
@ -343,7 +343,7 @@ gimp_palette_load (const gchar *filename)
if (! fgets (str, 1024, fp))
{
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -358,8 +358,6 @@ gimp_palette_load (const gchar *filename)
{
gchar *basename;
g_warning ("old palette format %s", filename);
basename = g_path_get_basename (filename);
gimp_object_set_name (GIMP_OBJECT (palette), basename);
@ -376,22 +374,22 @@ gimp_palette_load (const gchar *filename)
r = atoi (tok);
else
/* maybe we should just abort? */
g_message (_("Loading palette %s (line %d):\n"
"Missing RED component"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"Missing RED component in line %d."), filename, linenum);
tok = strtok (NULL, " \t");
if (tok)
g = atoi (tok);
else
g_message (_("Loading palette %s (line %d):\n"
"Missing GREEN component"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"Missing GREEN component in line %d."), filename, linenum);
tok = strtok (NULL, " \t");
if (tok)
b = atoi (tok);
else
g_message (_("Loading palette %s (line %d):\n"
"Missing BLUE component"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"Missing BLUE component in line %d."), filename, linenum);
/* optional name */
tok = strtok (NULL, "\n");
@ -399,8 +397,8 @@ gimp_palette_load (const gchar *filename)
if (r < 0 || r > 255 ||
g < 0 || g > 255 ||
b < 0 || b > 255)
g_message (_("Loading palette %s (line %d):\n"
"RGB value out of range"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"RGB value out of range in line %d."), filename, linenum);
gimp_rgba_set_uchar (&color,
(guchar) r,
@ -416,7 +414,7 @@ gimp_palette_load (const gchar *filename)
if (feof (fp))
break;
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -454,8 +452,8 @@ gimp_palette_save (GimpData *data)
if (! (fp = fopen (GIMP_DATA (palette)->filename, "w")))
{
g_message (_("Can't save palette \"%s\"\n"),
GIMP_DATA (palette)->filename);
g_message (_("Cannot save palette '%s':\n%s"),
GIMP_DATA (palette)->filename, g_strerror (errno));
return FALSE;
}

View File

@ -257,7 +257,8 @@ gimp_palette_load (const gchar *filename)
/* Open the requested file */
if (! (fp = fopen (filename, "r")))
{
g_warning ("Failed to open palette file %s", filename);
g_message (_("Failed to open palette file '%s': %s"),
filename, g_strerror (errno));
return NULL;
}
@ -270,12 +271,11 @@ gimp_palette_load (const gchar *filename)
{
/* bad magic, but maybe it has \r\n at the end of lines? */
if (!strcmp (str, "GIMP Palette\r"))
g_message (_("Loading palette %s:\n"
"Corrupt palette:\n"
"missing magic header\n"
g_message (_("Loading palette '%s':\n"
"Corrupt palette: missing magic header\n"
"Does this file need converting from DOS?"), filename);
else
g_message (_("Loading palette %s:\n"
g_message (_("Loading palette '%s':\n"
"Corrupt palette: missing magic header"), filename);
fclose (fp);
@ -289,7 +289,7 @@ gimp_palette_load (const gchar *filename)
if (! fgets (str, 1024, fp))
{
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -314,7 +314,7 @@ gimp_palette_load (const gchar *filename)
if (! fgets (str, 1024, fp))
{
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -332,8 +332,8 @@ gimp_palette_load (const gchar *filename)
if (columns < 0 || columns > 256)
{
g_message (_("Loading palette %s (line %d):\n"
"Invalid number or columns"),
g_message (_("Loading palette '%s':\n"
"Invalid number or columns in line %d."),
filename, linenum);
columns = 0;
@ -343,7 +343,7 @@ gimp_palette_load (const gchar *filename)
if (! fgets (str, 1024, fp))
{
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -358,8 +358,6 @@ gimp_palette_load (const gchar *filename)
{
gchar *basename;
g_warning ("old palette format %s", filename);
basename = g_path_get_basename (filename);
gimp_object_set_name (GIMP_OBJECT (palette), basename);
@ -376,22 +374,22 @@ gimp_palette_load (const gchar *filename)
r = atoi (tok);
else
/* maybe we should just abort? */
g_message (_("Loading palette %s (line %d):\n"
"Missing RED component"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"Missing RED component in line %d."), filename, linenum);
tok = strtok (NULL, " \t");
if (tok)
g = atoi (tok);
else
g_message (_("Loading palette %s (line %d):\n"
"Missing GREEN component"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"Missing GREEN component in line %d."), filename, linenum);
tok = strtok (NULL, " \t");
if (tok)
b = atoi (tok);
else
g_message (_("Loading palette %s (line %d):\n"
"Missing BLUE component"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"Missing BLUE component in line %d."), filename, linenum);
/* optional name */
tok = strtok (NULL, "\n");
@ -399,8 +397,8 @@ gimp_palette_load (const gchar *filename)
if (r < 0 || r > 255 ||
g < 0 || g > 255 ||
b < 0 || b > 255)
g_message (_("Loading palette %s (line %d):\n"
"RGB value out of range"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"RGB value out of range in line %d."), filename, linenum);
gimp_rgba_set_uchar (&color,
(guchar) r,
@ -416,7 +414,7 @@ gimp_palette_load (const gchar *filename)
if (feof (fp))
break;
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -454,8 +452,8 @@ gimp_palette_save (GimpData *data)
if (! (fp = fopen (GIMP_DATA (palette)->filename, "w")))
{
g_message (_("Can't save palette \"%s\"\n"),
GIMP_DATA (palette)->filename);
g_message (_("Cannot save palette '%s':\n%s"),
GIMP_DATA (palette)->filename, g_strerror (errno));
return FALSE;
}

View File

@ -257,7 +257,8 @@ gimp_palette_load (const gchar *filename)
/* Open the requested file */
if (! (fp = fopen (filename, "r")))
{
g_warning ("Failed to open palette file %s", filename);
g_message (_("Failed to open palette file '%s': %s"),
filename, g_strerror (errno));
return NULL;
}
@ -270,12 +271,11 @@ gimp_palette_load (const gchar *filename)
{
/* bad magic, but maybe it has \r\n at the end of lines? */
if (!strcmp (str, "GIMP Palette\r"))
g_message (_("Loading palette %s:\n"
"Corrupt palette:\n"
"missing magic header\n"
g_message (_("Loading palette '%s':\n"
"Corrupt palette: missing magic header\n"
"Does this file need converting from DOS?"), filename);
else
g_message (_("Loading palette %s:\n"
g_message (_("Loading palette '%s':\n"
"Corrupt palette: missing magic header"), filename);
fclose (fp);
@ -289,7 +289,7 @@ gimp_palette_load (const gchar *filename)
if (! fgets (str, 1024, fp))
{
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -314,7 +314,7 @@ gimp_palette_load (const gchar *filename)
if (! fgets (str, 1024, fp))
{
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -332,8 +332,8 @@ gimp_palette_load (const gchar *filename)
if (columns < 0 || columns > 256)
{
g_message (_("Loading palette %s (line %d):\n"
"Invalid number or columns"),
g_message (_("Loading palette '%s':\n"
"Invalid number or columns in line %d."),
filename, linenum);
columns = 0;
@ -343,7 +343,7 @@ gimp_palette_load (const gchar *filename)
if (! fgets (str, 1024, fp))
{
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -358,8 +358,6 @@ gimp_palette_load (const gchar *filename)
{
gchar *basename;
g_warning ("old palette format %s", filename);
basename = g_path_get_basename (filename);
gimp_object_set_name (GIMP_OBJECT (palette), basename);
@ -376,22 +374,22 @@ gimp_palette_load (const gchar *filename)
r = atoi (tok);
else
/* maybe we should just abort? */
g_message (_("Loading palette %s (line %d):\n"
"Missing RED component"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"Missing RED component in line %d."), filename, linenum);
tok = strtok (NULL, " \t");
if (tok)
g = atoi (tok);
else
g_message (_("Loading palette %s (line %d):\n"
"Missing GREEN component"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"Missing GREEN component in line %d."), filename, linenum);
tok = strtok (NULL, " \t");
if (tok)
b = atoi (tok);
else
g_message (_("Loading palette %s (line %d):\n"
"Missing BLUE component"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"Missing BLUE component in line %d."), filename, linenum);
/* optional name */
tok = strtok (NULL, "\n");
@ -399,8 +397,8 @@ gimp_palette_load (const gchar *filename)
if (r < 0 || r > 255 ||
g < 0 || g > 255 ||
b < 0 || b > 255)
g_message (_("Loading palette %s (line %d):\n"
"RGB value out of range"), filename, linenum);
g_message (_("Loading palette '%s':\n"
"RGB value out of range in line %d."), filename, linenum);
gimp_rgba_set_uchar (&color,
(guchar) r,
@ -416,7 +414,7 @@ gimp_palette_load (const gchar *filename)
if (feof (fp))
break;
g_message (_("Loading palette %s (line %d):\nRead error"),
g_message (_("Loading palette '%s':\nRead error in line %d."),
filename, linenum);
fclose (fp);
@ -454,8 +452,8 @@ gimp_palette_save (GimpData *data)
if (! (fp = fopen (GIMP_DATA (palette)->filename, "w")))
{
g_message (_("Can't save palette \"%s\"\n"),
GIMP_DATA (palette)->filename);
g_message (_("Cannot save palette '%s':\n%s"),
GIMP_DATA (palette)->filename, g_strerror (errno));
return FALSE;
}

View File

@ -287,7 +287,7 @@ gimp_pattern_load (const gchar *filename)
if (header.magic_number != GPATTERN_MAGIC || header.version != 1 ||
header.header_size <= sizeof (header))
{
g_message (_("Unknown pattern format version #%d in \"%s\"."),
g_message (_("Unknown pattern format version %d in '%s'."),
header.version, filename);
goto error;
}
@ -295,9 +295,9 @@ gimp_pattern_load (const gchar *filename)
/* Check for supported bit depths */
if (header.bytes != 1 && header.bytes != 3)
{
g_message ("Unsupported pattern depth: %d\n"
"in file \"%s\"\n"
"GIMP Patterns must be GRAY or RGB\n",
g_message (_("Unsupported pattern depth %d\n"
"in file '%s'.\n"
"GIMP Patterns must be GRAY or RGB.\n"),
header.bytes, filename);
goto error;
}
@ -309,13 +309,13 @@ gimp_pattern_load (const gchar *filename)
if ((read (fd, name, bn_size)) < bn_size)
{
g_message (_("Error in GIMP pattern file \"%s\"."), filename);
g_message (_("Error in GIMP pattern file '%s'."), filename);
goto error;
}
if (!g_utf8_validate (name, -1, NULL))
{
g_message (_("Invalid UTF-8 string in GIMP pattern file \"%s\"."),
g_message (_("Invalid UTF-8 string in pattern file '%s'."),
filename);
g_free (name);
name = NULL;
@ -333,7 +333,7 @@ gimp_pattern_load (const gchar *filename)
header.width * header.height * header.bytes) <
header.width * header.height * header.bytes)
{
g_message (_("GIMP pattern file appears to be truncated: \"%s\"."),
g_message (_("Fatal parsing error: Pattern file '%s' appears truncated."),
filename);
goto error;
}

View File

@ -287,7 +287,7 @@ gimp_pattern_load (const gchar *filename)
if (header.magic_number != GPATTERN_MAGIC || header.version != 1 ||
header.header_size <= sizeof (header))
{
g_message (_("Unknown pattern format version #%d in \"%s\"."),
g_message (_("Unknown pattern format version %d in '%s'."),
header.version, filename);
goto error;
}
@ -295,9 +295,9 @@ gimp_pattern_load (const gchar *filename)
/* Check for supported bit depths */
if (header.bytes != 1 && header.bytes != 3)
{
g_message ("Unsupported pattern depth: %d\n"
"in file \"%s\"\n"
"GIMP Patterns must be GRAY or RGB\n",
g_message (_("Unsupported pattern depth %d\n"
"in file '%s'.\n"
"GIMP Patterns must be GRAY or RGB.\n"),
header.bytes, filename);
goto error;
}
@ -309,13 +309,13 @@ gimp_pattern_load (const gchar *filename)
if ((read (fd, name, bn_size)) < bn_size)
{
g_message (_("Error in GIMP pattern file \"%s\"."), filename);
g_message (_("Error in GIMP pattern file '%s'."), filename);
goto error;
}
if (!g_utf8_validate (name, -1, NULL))
{
g_message (_("Invalid UTF-8 string in GIMP pattern file \"%s\"."),
g_message (_("Invalid UTF-8 string in pattern file '%s'."),
filename);
g_free (name);
name = NULL;
@ -333,7 +333,7 @@ gimp_pattern_load (const gchar *filename)
header.width * header.height * header.bytes) <
header.width * header.height * header.bytes)
{
g_message (_("GIMP pattern file appears to be truncated: \"%s\"."),
g_message (_("Fatal parsing error: Pattern file '%s' appears truncated."),
filename);
goto error;
}

View File

@ -262,7 +262,7 @@ gimp_module_info_module_load (GimpModuleInfoObj *module_info,
gimp_module_info_set_last_error (module_info, g_module_error ());
if (verbose)
g_warning (_("module load error: %s: %s"),
g_message (_("Module '%s' load error:\n%s"),
module_info->fullpath, module_info->last_module_error);
return;
}
@ -280,12 +280,11 @@ gimp_module_info_module_load (GimpModuleInfoObj *module_info,
module_info->state = GIMP_MODULE_STATE_ERROR;
gimp_module_info_set_last_error (module_info,
"missing module_init() symbol");
_("Missing module_init() symbol"));
if (verbose)
g_warning ("%s: module_init() symbol not found",
module_info->fullpath);
g_message (_("Module '%s' load error:\n%s"),
module_info->fullpath, module_info->last_module_error);
g_module_close (module_info->module);
module_info->module = NULL;
return;

View File

@ -273,14 +273,14 @@ gimp_modules_module_initialize (const gchar *filename,
if (! module_info->load_inhibit)
{
if (gimp->be_verbose)
g_print (_("load module: \"%s\"\n"), filename);
g_print (_("loading module: '%s'\n"), filename);
gimp_module_info_module_load (module_info, TRUE);
}
else
{
if (gimp->be_verbose)
g_print (_("skipping module: \"%s\"\n"), filename);
g_print (_("skipping module: '%s'\n"), filename);
module_info->state = GIMP_MODULE_STATE_UNLOADED_OK;
}