update the progress to avoid looking like the script hangs. Fixes bug

2007-03-16  Michael Natterer  <mitch@gimp.org>

	* plug-ins/script-fu/scripts/spyrogimp.scm: update the progress
	to avoid looking like the script hangs. Fixes bug #356677.

	* plug-ins/script-fu/script-fu-interface.c
	(script_fu_interface_report_cc): if the command starts with
	"gimp-progress-", the script is obviously showing a progress bar
	for itself, so clear the text instead of showing an endless number
	of "gimp-progress-update" messages. Also fixed manual main loop
	iteration.


svn path=/trunk/; revision=22132
This commit is contained in:
Michael Natterer
2007-03-16 00:26:34 +00:00
committed by Michael Natterer
parent dd4042df85
commit 1a9cfa406e
3 changed files with 41 additions and 10 deletions

View File

@ -131,26 +131,38 @@ script_fu_interface_report_cc (const gchar *command)
if (sf_interface->last_command &&
strcmp (sf_interface->last_command, command) == 0)
{
gchar *new_command;
sf_interface->command_count++;
new_command = g_strdup_printf ("%s <%d>",
command, sf_interface->command_count);
gtk_label_set_text (GTK_LABEL (sf_interface->progress_label),
new_command);
g_free (new_command);
if (! g_str_has_prefix (command, "gimp-progress-"))
{
gchar *new_command;
new_command = g_strdup_printf ("%s <%d>",
command, sf_interface->command_count);
gtk_label_set_text (GTK_LABEL (sf_interface->progress_label),
new_command);
g_free (new_command);
}
}
else
{
sf_interface->command_count = 1;
gtk_label_set_text (GTK_LABEL (sf_interface->progress_label), command);
g_free (sf_interface->last_command);
sf_interface->last_command = g_strdup (command);
if (! g_str_has_prefix (command, "gimp-progress-"))
{
gtk_label_set_text (GTK_LABEL (sf_interface->progress_label), command);
}
else
{
gtk_label_set_text (GTK_LABEL (sf_interface->progress_label), "");
}
}
while (gtk_main_iteration ());
while (g_main_context_pending (NULL))
g_main_context_iteration (NULL, TRUE);
}
void