diff options
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 0fe3e8a0fcf..cd46e24264d 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -138,6 +138,7 @@ enum { OPTYPE_INTERNAL = (1 << 6), OPTYPE_LOCK_BYPASS = (1 << 7), /* Allow operator to run when interface is locked */ + OPTYPE_UNDO_GROUPED = (1 << 8), /* Special type of undo which doesn't store itself multiple times */ }; /* context to call operator in for WM_operator_name_call */ @@ -522,6 +523,7 @@ typedef struct wmOperatorType { const char *idname; /* unique identifier */ const char *translation_context; const char *description; /* tooltips and python docs */ + const char *undo_group; /* identifier to group operators together */ /* this callback executes the operator without any interactive input, * parameters may be provided through operator properties. cannot use diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index dc34e8015c9..ad8a67027c0 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -730,6 +730,8 @@ static void wm_operator_finished(bContext *C, wmOperator *op, const bool repeat) if (wm->op_undo_depth == 0) if (op->type->flag & OPTYPE_UNDO) ED_undo_push_op(C, op); + else if (op->type->flag & OPTYPE_UNDO_GROUPED) + ED_undo_grouped_push_op(C, op); if (repeat == 0) { if (G.debug & G_DEBUG_WM) { @@ -1857,6 +1859,8 @@ static int wm_handler_fileselect_do(bContext *C, ListBase *handlers, wmEventHand if (CTX_wm_manager(C) == wm && wm->op_undo_depth == 0) if (handler->op->type->flag & OPTYPE_UNDO) ED_undo_push_op(C, handler->op); + else if (handler->op->type->flag & OPTYPE_UNDO_GROUPED) + ED_undo_grouped_push_op(C, handler->op); if (handler->op->reports->list.first) { |