Prevent single-node ways from being created by undo.
[potlatch2.git] / net / systemeD / halcyon / connection / MainUndoStack.as
index be75b6d..38f87ff 100644 (file)
@@ -103,6 +103,12 @@ package net.systemeD.halcyon.connection {
                                return false;
                        }
                }
+               
+               public function removeLastIfAction(action:Class):void {
+                       if (undoActions.length && undoActions[undoActions.length-1] is action) {
+                               undoActions.pop();
+                       }
+               }
 
         [Bindable(event="new_undo_item")]
                public function getUndoDescription():String {
@@ -111,6 +117,13 @@ package net.systemeD.halcyon.connection {
                        return null;
                }
 
+        [Bindable(event="new_redo_item")]
+               public function getRedoDescription():String {
+                       if (redoActions.length==0) return null;
+                       if (redoActions[redoActions.length-1].name) return redoActions[redoActions.length-1].name;
+                       return null;
+               }
+
         /**
         * Takes the action most recently undone, does it, and adds it to the undo stack
         */