Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-12-29 21:57:42 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-12-29 22:05:22 +0300
commitf874aeef70f2f315c3062d9694ae816674d0cdd0 (patch)
treee2c8ddb8ecfc415d89225a081ae8755f355993bd /source/blender/editors/util
parent6ecab6dd8e48d564a2b43e0e81e79d079e8b4c77 (diff)
parentbf7d7bc323d5505b78688af2df1f66e1053f62e1 (diff)
Merge branch 'master' into blender2.8
Please **DO NOT** add changes from master when it's totally uneeded! Changes to BLI_ area most certainly shall *always* be done in master, there is absolutely no point in adding more diff between the two branches than needed, will only makes merging more cumbersome! Conflicts: CMakeLists.txt source/blender/blenlib/intern/math_vector_inline.c
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r--source/blender/editors/util/undo.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index 4a9311416b3..fab5b7e821f 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -327,6 +327,13 @@ static int ed_redo_exec(bContext *C, wmOperator *UNUSED(op))
return ed_undo_step(C, -1, NULL);
}
+static int ed_undo_redo_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ wmOperator *last_op = WM_operator_last_redo(C);
+ const int ret = ED_undo_operator_repeat(C, last_op);
+ return ret ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+}
+
/* ********************** */
@@ -369,6 +376,17 @@ void ED_OT_redo(wmOperatorType *ot)
ot->poll = ED_operator_screenactive;
}
+void ED_OT_undo_redo(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Undo and Redo";
+ ot->description = "Undo and redo previous action";
+ ot->idname = "ED_OT_undo_redo";
+
+ /* api callbacks */
+ ot->exec = ed_undo_redo_exec;
+ ot->poll = ED_operator_screenactive;
+}
/* ui callbacks should call this rather than calling WM_operator_repeat() themselves */
int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)