Commit a85bbe7f authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

added a newline to the output in the error case.

2009-03-22  Sven Neumann  <sven@gimp.org>

        * app/batch.c (batch_run_cmd): added a newline to the output in
        the error case.

        * plug-ins/script-fu/script-fu-eval.c (script_fu_eval_run):
        instead of disabling all output in batch mode, use the usual
        routine for error handling and pass the error string along with


svn path=/trunk/; revision=28200
parent e6af54a6
2009-03-22 Sven Neumann <sven@gimp.org>
* app/batch.c (batch_run_cmd): added a newline to the output in
the error case.
* plug-ins/script-fu/script-fu-eval.c (script_fu_eval_run):
instead of disabling all output in batch mode, use the usual
routine for error handling and pass the error string along with
the return values.
2009-03-22 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpscrolledpreview.c: use GtkAdjustment's
......
......@@ -168,8 +168,8 @@ batch_run_cmd (Gimp *gimp,
case GIMP_PDB_EXECUTION_ERROR:
if (error)
{
g_printerr ("batch command experienced an execution error: %s\n",
error->message);
g_printerr ("batch command experienced an execution error:\n"
"%s\n", error->message);
}
else
{
......@@ -180,8 +180,8 @@ batch_run_cmd (Gimp *gimp,
case GIMP_PDB_CALLING_ERROR:
if (error)
{
g_printerr ("batch command experienced a calling error: %s\n",
error->message);
g_printerr ("batch command experienced a calling error:\n"
"%s\n", error->message);
}
else
{
......
......@@ -33,6 +33,7 @@ script_fu_eval_run (const gchar *name,
GimpParam **return_vals)
{
static GimpParam values[2];
GString *output = g_string_new (NULL);
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
......@@ -44,12 +45,11 @@ script_fu_eval_run (const gchar *name,
run_mode = params[0].data.d_int32;
ts_set_run_mode (run_mode);
ts_register_output_func (ts_gstring_output_func, output);
switch (run_mode)
{
case GIMP_RUN_NONINTERACTIVE:
/* Disable Script-Fu output */
ts_register_output_func (NULL, NULL);
if (ts_interpret_string (params[1].data.d_string) != 0)
status = GIMP_PDB_EXECUTION_ERROR;
break;
......@@ -57,10 +57,8 @@ script_fu_eval_run (const gchar *name,
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
status = GIMP_PDB_CALLING_ERROR;
*nreturn_vals = 2;
values[1].type = GIMP_PDB_STRING;
values[1].data.d_string = _("Script-Fu evaluation mode only allows "
"non-interactive invocation");
g_string_assign (output, _("Script-Fu evaluation mode only allows "
"non-interactive invocation"));
break;
default:
......@@ -68,4 +66,15 @@ script_fu_eval_run (const gchar *name,
}
values[0].data.d_status = status;
if (status != GIMP_PDB_SUCCESS && output->len > 0)
{
*nreturn_vals = 2;
values[1].type = GIMP_PDB_STRING;
values[1].data.d_string = g_string_free (output, FALSE);
}
else
{
g_string_free (output, TRUE);
}
}
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