Commit fba87654 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

plug-ins/FractalExplorer/Dialogs.c

2004-01-19  Michael Natterer  <mitch@gimp.org>

	* plug-ins/FractalExplorer/Dialogs.c
	* plug-ins/FractalExplorer/FractalExplorer.c
	* plug-ins/bmp/bmpread.c
	* plug-ins/bmp/bmpwrite.c
	* plug-ins/common/CEL.c
	* plug-ins/common/CML_explorer.c
	* plug-ins/common/bz2.c
	* plug-ins/common/channel_mixer.c
	* plug-ins/common/curve_bend.c
	* plug-ins/common/dicom.c
	* plug-ins/common/gbr.c
	* plug-ins/common/gif.c
	* plug-ins/common/gifload.c
	* plug-ins/common/gih.c
	* plug-ins/common/gtm.c
	* plug-ins/common/gz.c
	* plug-ins/common/hrz.c
	* plug-ins/common/jpeg.c
	* plug-ins/common/mail.c
	* plug-ins/common/pat.c
	* plug-ins/common/pcx.c
	* plug-ins/common/png.c
	* plug-ins/common/pnm.c
	* plug-ins/common/ps.c
	* plug-ins/common/psd.c
	* plug-ins/common/psd_save.c
	* plug-ins/common/psp.c
	* plug-ins/common/spheredesigner.c
	* plug-ins/common/sunras.c
	* plug-ins/common/svg.c
	* plug-ins/common/tga.c
	* plug-ins/common/tiff.c
	* plug-ins/common/wmf.c
	* plug-ins/common/xbm.c
	* plug-ins/common/xpm.c
	* plug-ins/common/xwd.c
	* plug-ins/faxg3/faxg3.c
	* plug-ins/fits/fits.c
	* plug-ins/flame/flame.c
	* plug-ins/gfig/gfig.c
	* plug-ins/gflare/gflare.c
	* plug-ins/gfli/gfli.c
	* plug-ins/gimpressionist/ppmtool.c
	* plug-ins/helpbrowser/domain.c
	* plug-ins/ifscompose/ifscompose.c
	* plug-ins/sgi/sgi.c
	* plug-ins/xjt/xjt.c: use gimp_filename_to_utf8() for filenames
	passed to g_message() and gimp_progress_init(). Definitely missed
	lots of other places but it's a start...
parent 1f07af72
2004-01-19 Michael Natterer <mitch@gimp.org>
* plug-ins/FractalExplorer/Dialogs.c
* plug-ins/FractalExplorer/FractalExplorer.c
* plug-ins/bmp/bmpread.c
* plug-ins/bmp/bmpwrite.c
* plug-ins/common/CEL.c
* plug-ins/common/CML_explorer.c
* plug-ins/common/bz2.c
* plug-ins/common/channel_mixer.c
* plug-ins/common/curve_bend.c
* plug-ins/common/dicom.c
* plug-ins/common/gbr.c
* plug-ins/common/gif.c
* plug-ins/common/gifload.c
* plug-ins/common/gih.c
* plug-ins/common/gtm.c
* plug-ins/common/gz.c
* plug-ins/common/hrz.c
* plug-ins/common/jpeg.c
* plug-ins/common/mail.c
* plug-ins/common/pat.c
* plug-ins/common/pcx.c
* plug-ins/common/png.c
* plug-ins/common/pnm.c
* plug-ins/common/ps.c
* plug-ins/common/psd.c
* plug-ins/common/psd_save.c
* plug-ins/common/psp.c
* plug-ins/common/spheredesigner.c
* plug-ins/common/sunras.c
* plug-ins/common/svg.c
* plug-ins/common/tga.c
* plug-ins/common/tiff.c
* plug-ins/common/wmf.c
* plug-ins/common/xbm.c
* plug-ins/common/xpm.c
* plug-ins/common/xwd.c
* plug-ins/faxg3/faxg3.c
* plug-ins/fits/fits.c
* plug-ins/flame/flame.c
* plug-ins/gfig/gfig.c
* plug-ins/gflare/gflare.c
* plug-ins/gfli/gfli.c
* plug-ins/gimpressionist/ppmtool.c
* plug-ins/helpbrowser/domain.c
* plug-ins/ifscompose/ifscompose.c
* plug-ins/sgi/sgi.c
* plug-ins/xjt/xjt.c: use gimp_filename_to_utf8() for filenames
passed to g_message() and gimp_progress_init(). Definitely missed
lots of other places but it's a start...
2004-01-19 Michael Natterer <mitch@gimp.org>
* app/file/file-utils.h: removed inclusion of <stdio.h> and
......@@ -1825,7 +1825,7 @@ save_callback (void)
if (!fp)
{
g_message (_("Could not open '%s' for writing: %s"),
savename, g_strerror (errno));
gimp_filename_to_utf8 (savename), g_strerror (errno));
return;
}
......@@ -1839,7 +1839,7 @@ save_callback (void)
if (ferror (fp))
g_message (_("Could not write '%s': %s"),
savename, g_strerror (ferror (fp)));
gimp_filename_to_utf8 (savename), g_strerror (ferror (fp)));
fclose (fp);
}
......@@ -2126,20 +2126,21 @@ explorer_load (void)
if (!fp)
{
g_message (_("Could not open '%s' for reading: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return;
}
get_line (load_buf, MAX_LOAD_LINE, fp, 1);
if (strncmp (FRACTAL_HEADER, load_buf, strlen (load_buf)))
{
g_message (_("'%s' is not a FractalExplorer file"), filename);
g_message (_("'%s' is not a FractalExplorer file"),
gimp_filename_to_utf8 (filename));
return;
}
if (load_options (current_obj,fp))
{
g_message (_("'%s' is corrupt. Line %d Option section incorrect"),
filename, line_no);
gimp_filename_to_utf8 (filename), line_no);
return;
}
......
......@@ -82,7 +82,7 @@
#include "libgimp/stdplugins-intl.h"
/**********************************************************************
Global variables
Global variables
*********************************************************************/
gdouble xmin = -2;
......@@ -1168,7 +1168,8 @@ fractalexplorer_load (const gchar *filename,
if (strncmp (fractalexplorer_HEADER, load_buf, strlen (load_buf)))
{
g_message (_("File '%s' is not a FractalExplorer file"), filename);
g_message (_("File '%s' is not a FractalExplorer file"),
gimp_filename_to_utf8 (filename));
fclose (fp);
return NULL;
......@@ -1176,7 +1177,8 @@ fractalexplorer_load (const gchar *filename,
if (load_options (fractalexplorer, fp))
{
g_message (_("File '%s' is corrupt.\nLine %d Option section incorrect"), filename, line_no);
g_message (_("File '%s' is corrupt.\nLine %d Option section incorrect"),
gimp_filename_to_utf8 (filename), line_no);
fclose (fp);
return NULL;
......
......@@ -116,7 +116,7 @@ ReadBMP (const gchar *name)
if (!fd)
{
g_message (_("Could not open '%s' for reading: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return -1;
}
......@@ -131,7 +131,8 @@ ReadBMP (const gchar *name)
!strncmp (magick,"PI",2) || !strncmp (magick,"CI",2) ||
!strncmp (magick,"CP",2)))
{
g_message (_("'%s' is not a valid BMP file"), filename);
g_message (_("'%s' is not a valid BMP file"),
gimp_filename_to_utf8 (filename));
return -1;
}
......@@ -139,19 +140,22 @@ ReadBMP (const gchar *name)
{
if (!ReadOK (fd, buffer, 12))
{
g_message (_("'%s' is not a valid BMP file"), filename);
g_message (_("'%s' is not a valid BMP file"),
gimp_filename_to_utf8 (filename));
return -1;
}
if (!ReadOK (fd, magick, 2))
{
g_message (_("'%s' is not a valid BMP file"), filename);
g_message (_("'%s' is not a valid BMP file"),
gimp_filename_to_utf8 (filename));
return -1;
}
}
if (!ReadOK (fd, buffer, 12))
{
g_message (_("'%s' is not a valid BMP file"), filename);
g_message (_("'%s' is not a valid BMP file"),
gimp_filename_to_utf8 (filename));
return -1;
}
......@@ -164,7 +168,8 @@ ReadBMP (const gchar *name)
if (!ReadOK (fd, buffer, 4))
{
g_message (_("'%s' is not a valid BMP file"), filename);
g_message (_("'%s' is not a valid BMP file"),
gimp_filename_to_utf8 (filename));
return -1;
}
......@@ -176,7 +181,8 @@ ReadBMP (const gchar *name)
{
if (!ReadOK (fd, buffer, 8))
{
g_message (_("Error reading BMP file header from '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
......@@ -194,7 +200,8 @@ ReadBMP (const gchar *name)
{
if (!ReadOK (fd, buffer, Bitmap_File_Head.biSize - 4))
{
g_message (_("Error reading BMP file header from '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
Bitmap_Head.biWidth = ToL (&buffer[0x00]); /* 12 */
......@@ -214,7 +221,8 @@ ReadBMP (const gchar *name)
{
if (!ReadOK (fd, buffer, Bitmap_File_Head.biSize - 4))
{
g_message (_("Error reading BMP file header from '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
Bitmap_Head.biWidth =ToL (&buffer[0x00]); /* 12 */
......@@ -232,7 +240,8 @@ ReadBMP (const gchar *name)
}
else
{
g_message (_("Error reading BMP file header from '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
......@@ -250,17 +259,20 @@ ReadBMP (const gchar *name)
/* Sanity checks */
if (Bitmap_Head.biHeight == 0 || Bitmap_Head.biWidth == 0) {
g_message (_("Error reading BMP file header from '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
if (Bitmap_Head.biPlanes != 1) {
g_message (_("Error reading BMP file header from '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
if (ColormapSize > 256 || Bitmap_Head.biClrUsed > 256) {
g_message (_("Error reading BMP file header from '%s'"), filename);
g_message (_("Error reading BMP file header from '%s'"),
gimp_filename_to_utf8 (filename));
return -1;
}
......@@ -291,7 +303,8 @@ ReadBMP (const gchar *name)
if (!ReadOK (fd, tmp, 3 * sizeof (gint32)))
{
g_message (_("'%s' is not a valid BMP file"), filename);
g_message (_("'%s' is not a valid BMP file"),
gimp_filename_to_utf8 (filename));
return -1;
}
......
......@@ -196,7 +196,7 @@ WriteBMP (const gchar *filename,
if (!outfile)
{
g_message (_("Could not open '%s' for writing: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return GIMP_PDB_EXECUTION_ERROR;
}
......@@ -206,7 +206,8 @@ WriteBMP (const gchar *filename,
0, 0, drawable->width, drawable->height);
/* And let's begin the progress */
temp_buf = g_strdup_printf (_("Saving '%s'..."), filename);
temp_buf = g_strdup_printf (_("Saving '%s'..."),
gimp_filename_to_utf8 (filename));
gimp_progress_init (temp_buf);
g_free (temp_buf);
......
......@@ -303,11 +303,12 @@ load_image (const gchar *file,
if (fp == NULL)
{
g_message (_("Could not open '%s' for reading: %s"),
file, g_strerror (errno));
gimp_filename_to_utf8 (file), g_strerror (errno));
return -1;
}
progress = g_strdup_printf (_("Opening '%s'..."), brief);
progress = g_strdup_printf (_("Opening '%s'..."),
gimp_filename_to_utf8 (brief));
gimp_progress_init (progress);
g_free (progress);
......@@ -574,11 +575,12 @@ save_image (const gchar *file,
if (fp == NULL)
{
g_message (_("Could not open '%s' for writing: %s"),
file, g_strerror (errno));
gimp_filename_to_utf8 (file), g_strerror (errno));
return FALSE;
}
progress = g_strdup_printf (_("Saving '%s'..."), brief);
progress = g_strdup_printf (_("Saving '%s'..."),
gimp_filename_to_utf8 (brief));
gimp_progress_init (progress);
g_free (progress);
......
......@@ -2135,7 +2135,7 @@ CML_save_to_file_response (GtkFileSelection *fs,
if (! file)
{
g_message (_("Could not open '%s' for writing: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return;
}
......@@ -2188,7 +2188,8 @@ CML_save_to_file_response (GtkFileSelection *fs,
fprintf (file, "Random seed : %d\n", VALS.seed);
fclose(file);
g_message (_("Parameters were Saved to '%s'"), filename);
g_message (_("Parameters were Saved to '%s'"),
gimp_filename_to_utf8 (filename));
strncpy (VALS.last_file_name, filename,
sizeof (VALS.last_file_name) - 1);
......@@ -2339,7 +2340,7 @@ CML_load_parameter_file (const gchar *filename,
if (!file)
{
g_message (_("Could not open '%s' for reading: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return FALSE;
}
else
......@@ -2367,10 +2368,12 @@ CML_load_parameter_file (const gchar *filename,
if (interactive_mode)
{
if (version < PARAM_FILE_FORMAT_VERSION)
g_message (_("Warning: '%s' is an old format file."), filename);
g_message (_("Warning: '%s' is an old format file."),
gimp_filename_to_utf8 (filename));
if (PARAM_FILE_FORMAT_VERSION < version)
g_message (_("Warning: '%s' is a parameter file for newer "
"CML_explorer than me."), filename);
"CML_explorer than me."),
gimp_filename_to_utf8 (filename));
}
for (channel_id = 0; flag && (channel_id < 3); channel_id++)
{
......
......@@ -270,7 +270,8 @@ save_image (const gchar *filename,
|| !WIFEXITED (process_status)
|| (WEXITSTATUS (process_status) != 0))
{
g_message ("bzip2 exited abnormally on file '%s'", tmpname);
g_message ("bzip2 exited abnormally on file '%s'",
gimp_filename_to_utf8 (tmpname));
g_free (tmpname);
return GIMP_PDB_EXECUTION_ERROR;
}
......@@ -340,7 +341,8 @@ load_image (const gchar *filename,
|| !WIFEXITED (process_status)
|| (WEXITSTATUS (process_status) != 0))
{
g_message ("bzip2 exited abnormally on file '%s'", filename);
g_message ("bzip2 exited abnormally on file '%s'",
gimp_filename_to_utf8 (filename));
g_free (tmpname);
*status = GIMP_PDB_EXECUTION_ERROR;
return -1;
......
......@@ -1151,7 +1151,7 @@ cm_load_file_response_callback (GtkFileSelection *fs,
else
{
g_message (_("Could not open '%s' for reading: %s"),
mix->filename, g_strerror (errno));
gimp_filename_to_utf8 (mix->filename), g_strerror (errno));
}
}
......@@ -1236,7 +1236,7 @@ cm_save_file_response_callback (GtkFileSelection *fs,
if (! file)
{
g_message (_("Could not open '%s' for writing: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return;
}
......@@ -1245,7 +1245,8 @@ cm_save_file_response_callback (GtkFileSelection *fs,
cm_save_file (mix, file);
g_message (_("Parameters were Saved to '%s'"), filename);
g_message (_("Parameters were Saved to '%s'"),
gimp_filename_to_utf8 (filename));
gtk_widget_hide (GTK_WIDGET (fs));
}
......
......@@ -328,7 +328,8 @@ save_image (const gchar *filename,
|| !WIFEXITED (process_status)
|| (WEXITSTATUS (process_status) != 0))
{
g_message ("gzip exited abnormally on file '%s'", tmpname);
g_message ("gzip exited abnormally on file '%s'",
gimp_filename_to_utf8 (tmpname));
g_free (tmpname);
return 0;
}
......@@ -437,7 +438,8 @@ load_image (const gchar *filename,
|| !WIFEXITED (process_status)
|| (WEXITSTATUS (process_status) != 0))
{
g_message ("gzip exited abnormally on file '%s'", filename);
g_message ("gzip exited abnormally on file '%s'",
gimp_filename_to_utf8 (filename));
g_free (tmpname);
*status = GIMP_PDB_EXECUTION_ERROR;
return -1;
......
......@@ -832,7 +832,7 @@ p_save_pointfile (BenderDialog *cd,
if (!l_fp)
{
g_message (_("Could not open '%s' for writing: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return -1;
}
......@@ -884,7 +884,7 @@ p_load_pointfile (BenderDialog *cd,
if (!l_fp)
{
g_message (_("Could not open '%s' for reading: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return -1;
}
......
......@@ -281,20 +281,21 @@ load_image (const gchar *filename)
guint8 *pix_buf = NULL;
gboolean toggle_endian = FALSE;
temp = g_strdup_printf (_("Opening '%s'..."), filename);
gimp_progress_init (temp);
g_free (temp);
/* open the file */
DICOM = fopen (filename, "rb");
if (!DICOM)
{
g_message (_("Could not open '%s' for reading: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return -1;
}
temp = g_strdup_printf (_("Opening '%s'..."),
gimp_filename_to_utf8 (filename));
gimp_progress_init (temp);
g_free (temp);
/* allocate the necessary structures */
dicominfo = g_new0 (DicomInfo, 1);
......@@ -305,14 +306,16 @@ load_image (const gchar *filename)
if (g_ascii_strncasecmp (buf, "PAPYRUS", 7) == 0)
{
g_message ("'%s' is a PAPYRUS DICOM file.\n"
"This plug-in does not support this type yet.", filename);
"This plug-in does not support this type yet.",
gimp_filename_to_utf8 (filename));
return -1;
}
fread (buf, 1, 4, DICOM); /* This should be dicom */
if (g_ascii_strncasecmp (buf,"DICM",4) != 0)
{
g_message (_("'%s' is not a DICOM file."), filename);
g_message (_("'%s' is not a DICOM file."),
gimp_filename_to_utf8 (filename));
return -1;
}
......@@ -641,7 +644,7 @@ save_image (const gchar *filename,
if (!DICOM)
{
g_message (_("Could not open '%s' for writing: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
gimp_drawable_detach (drawable);
return FALSE;
}
......
......@@ -292,11 +292,12 @@ load_image (const gchar *filename)
if (fd == -1)
{
g_message (_("Could not open '%s' for reading: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return -1;
}
temp = g_strdup_printf (_("Opening '%s'..."), filename);
temp = g_strdup_printf (_("Opening '%s'..."),
gimp_filename_to_utf8 (filename));
gimp_progress_init (temp);
g_free (temp);
......@@ -353,7 +354,8 @@ load_image (const gchar *filename)
name = g_new (gchar, bn_size);
if ((read (fd, name, bn_size)) < bn_size)
{
g_message (_("Error in GIMP brush file '%s'"), filename);
g_message (_("Error in GIMP brush file '%s'"),
gimp_filename_to_utf8 (filename));
close (fd);
g_free (name);
return -1;
......@@ -530,7 +532,7 @@ save_image (const gchar *filename,
if (gimp_drawable_type (drawable_ID) != GIMP_GRAY_IMAGE &&
gimp_drawable_type (drawable_ID) != GIMP_RGBA_IMAGE)
{
g_message (_("GIMP brushes are either GRAYSCALE or RGBA\n"));
g_message (_("GIMP brushes are either GRAYSCALE or RGBA"));
return FALSE;
}
......@@ -539,11 +541,12 @@ save_image (const gchar *filename,
if (fd == -1)
{
g_message (_("Could not open '%s' for writing: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return FALSE;
}
temp = g_strdup_printf (_("Saving '%s'..."), filename);
temp = g_strdup_printf (_("Saving '%s'..."),
gimp_filename_to_utf8 (filename));
gimp_progress_init (temp);
g_free (temp);
......
......@@ -994,7 +994,7 @@ save_image (const gchar *filename,
if (!outfile)
{
g_message (_("Could not open '%s' for writing: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return FALSE;
}
......
......@@ -293,11 +293,12 @@ load_image (const gchar *filename)
if (!fd)
{
g_message (_("Could not open '%s' for reading: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return -1;
}
name_buf = g_strdup_printf (_("Opening '%s'..."), filename);
name_buf = g_strdup_printf (_("Opening '%s'..."),
gimp_filename_to_utf8 (filename));
gimp_progress_init (name_buf);
g_free (name_buf);
......@@ -979,8 +980,8 @@ ReadImage (FILE *fd,
/* I don't see how one would easily construct a GIF in which
this could happen, but it's a mad mad world. */
g_message ("Ouch! Can't handle non-alpha RGB frames.\n"
"Please file a bug report in GIMP's bugzilla.");
gimp_quit();
"Please file a bug report in GIMP's bugzilla.");
gimp_quit ();
}
while ((v = LZWReadByte (fd, FALSE, c)) >= 0)
......
......@@ -627,11 +627,12 @@ gih_load_image (const gchar *filename)
if (fd == -1)
{
g_message (_("Could not open '%s' for reading: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return -1;
}
temp = g_strdup_printf (_("Opening '%s'..."), filename);
temp = g_strdup_printf (_("Opening '%s'..."),
gimp_filename_to_utf8 (filename));
gimp_progress_init (temp);
g_free (temp);
......@@ -649,8 +650,8 @@ gih_load_image (const gchar *filename)
if (!name)
{
g_message ("Couldn't read name for brush pipe\nfrom '%s'",
filename);
g_message ("Couldn't read name for brush pipe from '%s'",
gimp_filename_to_utf8 (filename));
close (fd);
return -1;
}
......@@ -1215,11 +1216,12 @@ gih_save_image (const gchar *filename,
if (fd == -1)
{
g_message (_("Could not open '%s' for writing: %s"),
filename, g_strerror (errno));
gimp_filename_to_utf8 (filename), g_strerror (errno));
return FALSE;
}
msg = g_strdup_printf (_("Saving '%s'..."), filename);
msg = g_strdup_printf (_("Saving '%s'..."),