[gimp/gimp-2-6] app: make sure to always show error messages returned by plug-ins



commit 7a74dc1d93eacac6dba631bbdcadf1709928210c
Author: Michael Natterer <mitch gimp org>
Date:   Tue Sep 7 16:21:40 2010 +0200

    app: make sure to always show error messages returned by plug-ins
    
    gimp_plug_in_handle_proc_return(): if there is no plug-in main loop
    running (the plugin was running asynchronously from a menu), show the
    plug-in's error message here, because nobody else will show it
    otherwise.
    (cherry picked from commit bdc2d4520be090bbbb90af18c75de6df49ed1d61)

 app/plug-in/gimpplugin-message.c |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/app/plug-in/gimpplugin-message.c b/app/plug-in/gimpplugin-message.c
index 02a4dfb..34688b6 100644
--- a/app/plug-in/gimpplugin-message.c
+++ b/app/plug-in/gimpplugin-message.c
@@ -581,17 +581,27 @@ gimp_plug_in_handle_proc_return (GimpPlugIn   *plug_in,
 
   g_return_if_fail (proc_return != NULL);
 
+  proc_frame->return_vals =
+    plug_in_params_to_args (proc_frame->procedure->values,
+                            proc_frame->procedure->num_values,
+                            proc_return->params,
+                            proc_return->nparams,
+                            TRUE, TRUE);
+
   if (proc_frame->main_loop)
     {
-      proc_frame->return_vals =
-        plug_in_params_to_args (proc_frame->procedure->values,
-                                proc_frame->procedure->num_values,
-                                proc_return->params,
-                                proc_return->nparams,
-                                TRUE, TRUE);
-
       g_main_loop_quit (proc_frame->main_loop);
     }
+  else
+    {
+      /*  the plug-in is run asynchronously, so display its error
+       *  messages here because nobody else will do it
+       */
+      gimp_plug_in_procedure_handle_return_values (GIMP_PLUG_IN_PROCEDURE (proc_frame->procedure),
+                                                   plug_in->manager->gimp,
+                                                   proc_frame->progress,
+                                                   proc_frame->return_vals);
+    }
 
   gimp_plug_in_close (plug_in, FALSE);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]