plug-ins/common/colortoalpha.c plug-ins/common/compose.c

2004-08-30  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/colortoalpha.c
	* plug-ins/common/compose.c
	* plug-ins/common/decompose.c
	* plug-ins/common/film.c
	* plug-ins/fits/fits.c: always use the progress API, not doing it
	in non-interactive mode has always been wrong.
This commit is contained in:
Sven Neumann 2004-08-30 19:01:41 +00:00 committed by Sven Neumann
parent 13d9596812
commit aeb5f302d5
6 changed files with 37 additions and 37 deletions

View File

@ -1,3 +1,12 @@
2004-08-30 Sven Neumann <sven@gimp.org>
* plug-ins/common/colortoalpha.c
* plug-ins/common/compose.c
* plug-ins/common/decompose.c
* plug-ins/common/film.c
* plug-ins/fits/fits.c: always use the progress API, not doing it
in non-interactive mode has always been wrong.
2004-08-30 Manish Singh <yosh@gimp.org>
* libgimp/gimpprogress.[ch] (gimp_progress_uninstall): return the

View File

@ -174,9 +174,7 @@ run (const gchar *name,
if (gimp_drawable_is_rgb (drawable->drawable_id) &&
gimp_drawable_is_layer (drawable->drawable_id))
{
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_progress_init (_("Removing color..."));
gimp_progress_init (_("Removing color..."));
toalpha (drawable);
}

View File

@ -410,8 +410,7 @@ run (const gchar *name,
if (status == GIMP_PDB_SUCCESS)
{
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_progress_init (_("Composing..."));
gimp_progress_init (_("Composing..."));
image_ID = compose (composevals.compose_type,
composevals.compose_ID,
@ -572,8 +571,7 @@ compose (const gchar *compose_type,
i += scan_lines;
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_progress_update (((gdouble)i) / (gdouble)height);
gimp_progress_update ((gdouble) i / (gdouble) height);
}
for (j = 0; j < num_images; j++)

View File

@ -327,8 +327,7 @@ run (const gchar *name,
}
if (status == GIMP_PDB_SUCCESS)
{
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_progress_init (_("Decomposing..."));
gimp_progress_init (_("Decomposing..."));
num_images = decompose (param[1].data.d_image, param[2].data.d_drawable,
decovals.extract_type, image_ID_extract);
@ -511,8 +510,7 @@ decompose (gint32 image_ID,
scan_lines);
i += scan_lines;
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_progress_update (((gdouble)i) / (gdouble)height);
gimp_progress_update ((gdouble) i / (gdouble) height);
}
g_free (src);

View File

@ -323,8 +323,7 @@ run (const gchar *name,
if (status == GIMP_PDB_SUCCESS)
{
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_progress_init (_("Composing Images..."));
gimp_progress_init (_("Composing Images..."));
image_ID = film ();
@ -537,9 +536,8 @@ film (void)
picture_x0 += picture_width + (picture_space/2);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_progress_update (((gdouble) (picture_count + 1)) /
(gdouble) num_pictures);
gimp_progress_update (((gdouble) (picture_count + 1)) /
(gdouble) num_pictures);
picture_count++;
}

View File

@ -456,15 +456,13 @@ save_image (const gchar *filename,
return (FALSE);
}
if (l_run_mode != GIMP_RUN_NONINTERACTIVE)
{
temp = g_strdup_printf (_("Saving '%s'..."),
gimp_filename_to_utf8 (filename));
gimp_progress_init (temp);
g_free (temp);
}
temp = g_strdup_printf (_("Saving '%s'..."),
gimp_filename_to_utf8 (filename));
gimp_progress_init (temp);
g_free (temp);
if ((drawable_type == GIMP_INDEXED_IMAGE) || (drawable_type == GIMP_INDEXEDA_IMAGE))
if ((drawable_type == GIMP_INDEXED_IMAGE) ||
(drawable_type == GIMP_INDEXEDA_IMAGE))
retval = save_index (ofp,image_ID, drawable_ID);
else
retval = save_direct (ofp,image_ID, drawable_ID);
@ -604,8 +602,8 @@ load_fits (const gchar *filename,
scan_lines++;
if ((l_run_mode != GIMP_RUN_NONINTERACTIVE) && ((i % 20) == 0))
gimp_progress_update ((double)(i+1) / (double)height);
if ((i % 20) == 0)
gimp_progress_update ((gdouble) (i + 1) / (gdouble) height);
if ((scan_lines == tile_height) || ((i+1) == height))
{
@ -656,9 +654,9 @@ load_fits (const gchar *filename,
dest -= width*ncompose;
scan_lines++;
if ((l_run_mode != GIMP_RUN_NONINTERACTIVE) && ((i % 20) == 0))
gimp_progress_update ( (double)(channel*height+i+1)
/ (double)(height*ncompose));
if ((i % 20) == 0)
gimp_progress_update ((gdouble) (channel * height + i + 1) /
(gdouble) (height * ncompose));
if ((scan_lines == tile_height) || ((i+1) == height))
{
@ -810,8 +808,9 @@ save_direct (FITS_FILE *ofp,
nbytes += bpsl;
src -= 2*bpsl;
if ((l_run_mode != GIMP_RUN_NONINTERACTIVE) && ((i % 20) == 0))
gimp_progress_update ((double)(i+channel*height)/(double)(height*bpp));
if ((i % 20) == 0)
gimp_progress_update ((gdouble) (i + channel * height) /
(gdouble) (height * bpp));
}
}
@ -909,9 +908,9 @@ save_index (FITS_FILE *ofp,
src -= 2*bpsl;
}
if ((l_run_mode != GIMP_RUN_NONINTERACTIVE) && ((i % 20) == 0))
gimp_progress_update ((double) (i+channel*height) /
(double) (height*(bpp+2)));
if ((i % 20) == 0)
gimp_progress_update ((gdouble) (i + channel * height) /
(gdouble) (height * (bpp + 2)));
}
/* Write the Alpha-channel */
@ -934,9 +933,9 @@ save_index (FITS_FILE *ofp,
src -= 2*bpsl;
}
if ((l_run_mode != GIMP_RUN_NONINTERACTIVE) && ((i % 20) == 0))
gimp_progress_update ((double) (i+channel*height) /
(double) (height*(bpp+2)));
if ((i % 20) == 0)
gimp_progress_update ((gdouble) (i + channel * height) /
(gdouble) (height * (bpp + 2)));
}
nbytes = nbytes % FITS_RECORD_SIZE;