From cede08e1e25c3a37b5276c80302bdb7acc27cd78 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 9 Jun 2011 15:26:05 +0000 Subject: [PATCH] Bugfix #26886 Operator redo: F6 menu didn't work for macros yet (like Duplicate-grab). --- source/blender/editors/screen/screen_ops.c | 8 +------- source/blender/windowmanager/intern/wm_operators.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index f016fb6822a..68326edfb11 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -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); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 1b7333024e7..8f15a21c624 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -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;