Bugfix #26886
authorTon Roosendaal <ton@blender.org>
Thu, 9 Jun 2011 15:26:05 +0000 (15:26 +0000)
committerTon Roosendaal <ton@blender.org>
Thu, 9 Jun 2011 15:26:05 +0000 (15:26 +0000)
Operator redo: F6 menu didn't work for macros yet (like Duplicate-grab).

source/blender/editors/screen/screen_ops.c
source/blender/windowmanager/intern/wm_operators.c

index f016fb6822aae06b48afe295cf20ea099839450c..68326edfb113822d5a95cbabb96d852766db3e3c 100644 (file)
@@ -2461,13 +2461,7 @@ static void SCREEN_OT_repeat_history(wmOperatorType *ot)
 
 static int redo_last_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *UNUSED(event))
 {
-       wmWindowManager *wm= CTX_wm_manager(C);
-       wmOperator *lastop;
-       
-       /* only for operators that are registered and did an undo push */
-       for(lastop= wm->operators.last; lastop; lastop= lastop->prev)
-               if((lastop->type->flag & OPTYPE_REGISTER) && (lastop->type->flag & OPTYPE_UNDO))
-                       break;
+       wmOperator *lastop= WM_operator_last_redo(C);
        
        if(lastop)
                WM_operator_redo_popup(C, lastop);
index 1b7333024e7f5ac32fe7d7ac2458b7ce5bbb89bf..8f15a21c62428d3bed36a8ca44723e952827a776 100644 (file)
@@ -921,7 +921,16 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
        if(ED_undo_valid(C, op->type->name)==0)
                uiLayoutSetEnabled(layout, 0);
 
-       uiLayoutOperatorButs(C, layout, op, NULL, 'H', UI_LAYOUT_OP_SHOW_TITLE);
+       if(op->type->flag & OPTYPE_MACRO) {
+               for(op= op->macro.first; op; op= op->next) {
+                       uiItemL(layout, op->type->name, ICON_NONE);
+                       uiLayoutOperatorButs(C, layout, op, NULL, 'H', UI_LAYOUT_OP_SHOW_TITLE);
+               }
+       }
+       else {
+               uiLayoutOperatorButs(C, layout, op, NULL, 'H', UI_LAYOUT_OP_SHOW_TITLE);
+       }
+       
 
        uiPopupBoundsBlock(block, 4, 0, 0);
        uiEndBlock(C, block);
@@ -3125,7 +3134,6 @@ static int radial_control_cancel(bContext *C, wmOperator *op)
 static int radial_control_modal(bContext *C, wmOperator *op, wmEvent *event)
 {
        RadialControl *rc = op->customdata;
-       wmWindowManager *wm;
        float new_value, dist, zoom[2];
        float delta[2], snap, ret = OPERATOR_RUNNING_MODAL;