|
From: Tapio V. <aa...@us...> - 2011-01-13 16:27:15
|
Module: editor
Branch: master
Commit: 439a1387f8cd412bd79f2957ce4d1274a5c854de
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jan 13 18:26:09 2011 +0200
Implement an Operation combiner.
Allows grouping several Operations to a single undo-step.
---
editorapp.cc | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/editorapp.cc b/editorapp.cc
index cf2881e..89374e1 100644
--- a/editorapp.cc
+++ b/editorapp.cc
@@ -185,6 +185,11 @@ void EditorApp::on_actionUndo_triggered()
{
if (opStack.top().op() == "BLOCK")
return;
+ else if (opStack.top().op() == "COMBINER") {
+ int count = opStack.top().i(1);
+ for (int i = 0; i < count; ++i) opStack.pop();
+ // TODO: Redo handling
+ }
// TODO: Move popped to redo stack
opStack.pop();
|