Turn the undo/save issue from a bug to a feature
authorAndy Allan <gravitystorm@gmail.com>
Fri, 20 Aug 2010 14:22:16 +0000 (14:22 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Fri, 20 Aug 2010 14:22:16 +0000 (14:22 +0000)
TODO.txt
net/systemeD/halcyon/connection/MainUndoStack.as
net/systemeD/halcyon/connection/XMLConnection.as

index e139206..8b945a4 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -7,7 +7,6 @@ Potlatch 2: main outstanding issues
 * purgeOutside simply doesn't work - WayUIs stay around. To investigate
 * P1-style J (join) / shift-J (unjoin)
 * Make parallelise properly undoable
-* Undo after save leaves things marked as clean
 * shift+delete a way that's part of a relation, then undo triggers infinite loop
 * double-click to make a poi leaves two actions in the undo list
 
@@ -66,6 +65,7 @@ Requested enhancements
 
 * Non-900913 projections
 * Plugin support
+* Support undo / redo across saving events
 
 == Tag editing ==
 
index e85c4ec..f76aa8b 100644 (file)
@@ -57,6 +57,8 @@ package net.systemeD.halcyon.connection {
         public function breakUndo():void {
             undoActions = [];
             redoActions = [];
+            dispatchEvent(new Event("new_undo_item"));
+            dispatchEvent(new Event("new_redo_item"));
         }
         
         [Bindable(event="new_undo_item")]
index 79ac705..6bc0dad 100644 (file)
@@ -175,8 +175,9 @@ package net.systemeD.halcyon.connection {
                                }
             }
 
-               dispatchEvent(new SaveCompleteEvent(SAVE_COMPLETED, true));
-               markClean();
+            dispatchEvent(new SaveCompleteEvent(SAVE_COMPLETED, true));
+            markClean(); // marks the connection clean. Pressing undo from this point on leads to unexpected results
+            MainUndoStack.getGlobalStack().breakUndo(); // so, for now, break the undo stack
         }
 
         private function diffUploadError(event:IOErrorEvent):void {