WM: Support showing reports for modal operators
authorCampbell Barton <ideasman42@gmail.com>
Wed, 27 Jan 2016 06:33:35 +0000 (17:33 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 27 Jan 2016 06:34:44 +0000 (17:34 +1100)
This isn't common use, but modal operators may make reports while they're running.
Now they're displayed in the info header.

source/blender/windowmanager/intern/wm_event_system.c

index 3ff7ef1a42b22d839beb265fcbc6404b3dcde06b..84d6f7e920916dde5eb9a7b35baab89fdd07965e 100644 (file)
@@ -1691,8 +1691,15 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
                                if (ot->flag & OPTYPE_UNDO)
                                        wm->op_undo_depth--;
 
-                               if (retval & (OPERATOR_CANCELLED | OPERATOR_FINISHED))
+                               if (retval & (OPERATOR_CANCELLED | OPERATOR_FINISHED)) {
                                        wm_operator_reports(C, op, retval, false);
+                               }
+                               else {
+                                       /* not very common, but modal operators may report before finishing */
+                                       if (!BLI_listbase_is_empty(&op->reports->list)) {
+                                               wm_add_reports(op->reports);
+                                       }
+                               }
 
                                /* important to run 'wm_operator_finished' before NULLing the context members */
                                if (retval & OPERATOR_FINISHED) {