[gimp/goat-invasion: 157/234] app: be smarter about progress in gimp_apply_operation()



commit 9de09f4b1d43f922082e39578eb5f1ec6799b1bd
Author: Michael Natterer <mitch gimp org>
Date:   Mon Mar 19 23:57:50 2012 +0100

    app: be smarter about progress in gimp_apply_operation()
    
    so an already started progress can be passed in.

 app/core/gimp-apply-operation.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimp-apply-operation.c b/app/core/gimp-apply-operation.c
index bfb763d..74c29a8 100644
--- a/app/core/gimp-apply-operation.c
+++ b/app/core/gimp-apply-operation.c
@@ -50,7 +50,6 @@ gimp_apply_operation (GeglBuffer          *src_buffer,
 
   g_return_if_fail (GEGL_IS_BUFFER (src_buffer));
   g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
-  g_return_if_fail (progress == NULL || undo_desc != NULL);
   g_return_if_fail (GEGL_IS_NODE (operation));
   g_return_if_fail (GEGL_IS_BUFFER (dest_buffer));
 
@@ -90,7 +89,17 @@ gimp_apply_operation (GeglBuffer          *src_buffer,
   processor = gegl_node_new_processor (dest_node, &rect);
 
   if (progress)
-    gimp_progress_start (progress, undo_desc, FALSE);
+    {
+      if (gimp_progress_is_active (progress))
+        {
+          if (undo_desc)
+            gimp_progress_set_text (progress, undo_desc);
+        }
+      else
+        {
+          gimp_progress_start (progress, undo_desc, FALSE);
+        }
+    }
 
   while (gegl_processor_work (processor, &value))
     if (progress)



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