Commit 9d502791 authored by Michael Natterer's avatar Michael Natterer 😴

app: rename procedure_commands_run_procedure()

to procedure_commands_run_procedure_async(). Add a new
procedure_commands_run_procedure() that calls the procedure
synchronously, needed later.
parent ed2fb294
......@@ -85,10 +85,10 @@ filters_repeat_cmd_callback (GtkAction *action,
if (args)
{
if (procedure_commands_run_procedure (procedure, gimp,
GIMP_PROGRESS (display),
run_mode, args,
display))
if (procedure_commands_run_procedure_async (procedure, gimp,
GIMP_PROGRESS (display),
run_mode, args,
display))
{
gimp_filter_history_add (gimp, procedure);
}
......@@ -113,10 +113,10 @@ filters_history_cmd_callback (GtkAction *action,
if (args)
{
if (procedure_commands_run_procedure (procedure, gimp,
GIMP_PROGRESS (display),
GIMP_RUN_INTERACTIVE, args,
display))
if (procedure_commands_run_procedure_async (procedure, gimp,
GIMP_PROGRESS (display),
GIMP_RUN_INTERACTIVE, args,
display))
{
gimp_filter_history_add (gimp, procedure);
}
......
......@@ -141,10 +141,10 @@ plug_in_run_cmd_callback (GtkAction *action,
if (args)
{
if (procedure_commands_run_procedure (procedure, gimp,
GIMP_PROGRESS (display),
GIMP_RUN_INTERACTIVE, args,
display))
if (procedure_commands_run_procedure_async (procedure, gimp,
GIMP_PROGRESS (display),
GIMP_RUN_INTERACTIVE, args,
display))
{
/* remember only image plug-ins */
if (procedure->num_args >= 2 &&
......
......@@ -258,9 +258,44 @@ gboolean
procedure_commands_run_procedure (GimpProcedure *procedure,
Gimp *gimp,
GimpProgress *progress,
GimpRunMode run_mode,
GimpValueArray *args,
GimpDisplay *display)
GimpValueArray *args)
{
GimpValueArray *return_vals;
GError *error = NULL;
g_return_val_if_fail (GIMP_IS_PROCEDURE (procedure), FALSE);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
g_return_val_if_fail (args != NULL, FALSE);
g_value_set_int (gimp_value_array_index (args, 0), GIMP_RUN_NONINTERACTIVE);
return_vals = gimp_procedure_execute (procedure, gimp,
gimp_get_user_context (gimp),
progress, args,
&error);
gimp_value_array_unref (return_vals);
if (error)
{
gimp_message_literal (gimp,
G_OBJECT (progress), GIMP_MESSAGE_ERROR,
error->message);
g_clear_error (&error);
return FALSE;
}
return TRUE;
}
gboolean
procedure_commands_run_procedure_async (GimpProcedure *procedure,
Gimp *gimp,
GimpProgress *progress,
GimpRunMode run_mode,
GimpValueArray *args,
GimpDisplay *display)
{
GError *error = NULL;
......
......@@ -31,7 +31,11 @@ GimpValueArray * procedure_commands_get_display_args (GimpProcedure *procedure,
GimpDisplay *display,
GimpObject *settings);
gboolean procedure_commands_run_procedure (GimpProcedure *procedure,
gboolean procedure_commands_run_procedure (GimpProcedure *procedure,
Gimp *gimp,
GimpProgress *progress,
GimpValueArray *args);
gboolean procedure_commands_run_procedure_async (GimpProcedure *procedure,
Gimp *gimp,
GimpProgress *progress,
GimpRunMode run_mode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment