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:
authorCampbell Barton <ideasman42@gmail.com>2011-02-22 05:42:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-22 05:42:19 +0300
commit36618a099673a4d6b8552a67d469a223153f55a1 (patch)
treee39e106216c75ccb23633fa01f10c89ee25b2d7d /source/blender/editors/util
parentb5e3d2a2eaec5ac20c959538a9c161b25e2087a7 (diff)
operator ED_OT_undo_push, needed for editmode undo/redo glitch fix, (coming next).
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r--source/blender/editors/util/undo.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index a992e33e7d6..c3294657635 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -60,9 +60,13 @@
#include "WM_api.h"
#include "WM_types.h"
+#include "RNA_access.h"
+#include "RNA_define.h"
#include "util_intern.h"
+#define MAXUNDONAME 64 /* XXX, make common define */
+
/* ***************** generic undo system ********************* */
void ED_undo_push(bContext *C, const char *str)
@@ -252,6 +256,14 @@ static int ed_undo_exec(bContext *C, wmOperator *UNUSED(op))
return ed_undo_step(C, 1, NULL);
}
+static int ed_undo_push_exec(bContext *C, wmOperator *op)
+{
+ char str[MAXUNDONAME];
+ RNA_string_get(op->ptr, "message", str);
+ ED_undo_push(C, str);
+ return OPERATOR_FINISHED;
+}
+
static int ed_redo_exec(bContext *C, wmOperator *UNUSED(op))
{
return ed_undo_step(C, -1, NULL);
@@ -298,6 +310,19 @@ void ED_OT_undo(wmOperatorType *ot)
ot->poll= ED_operator_screenactive;
}
+void ED_OT_undo_push(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Undo Push";
+ ot->description= "Add an undo state (internal use only)";
+ ot->idname= "ED_OT_undo_push";
+
+ /* api callbacks */
+ ot->exec= ed_undo_push_exec;
+
+ RNA_def_string(ot->srna, "message", "Add an undo step *function may be moved*", MAXUNDONAME, "Undo Message", "");
+}
+
void ED_OT_redo(wmOperatorType *ot)
{
/* identifiers */