fix save dialogue
authorRichard Fairhurst <richard@systemed.net>
Mon, 14 Jun 2010 11:44:10 +0000 (11:44 +0000)
committerRichard Fairhurst <richard@systemed.net>
Mon, 14 Jun 2010 11:44:10 +0000 (11:44 +0000)
TODO.txt
net/systemeD/potlatch2/save/SaveDialog.mxml
potlatch2.mxml

index fe2c162..c9ca179 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -5,6 +5,7 @@ Potlatch 2: main outstanding issues
 == Core geometry ==
 
 ** Straighten way + undo + redo looks fine in the UI, but doesn't reinsert the nodes into the way properly when saving (maybe way isn't dirty?)
+* Dragging multipolygons (or constituent nodes) doesn't force redraw of all ways - need to hook something up to WAY_NODE_MOVED
 * Make parallelise properly undoable
 * Make Quadralatalawhatsit properly undoable
 * Splitway + undo leaves way marked dirty
@@ -22,7 +23,6 @@ Potlatch 2: main outstanding issues
 
 == Saving ==
 
-** Comment and advanced -> "comment" should show the same thing
 * Save should be deactivated until there's things to change
 * Should be able to reuse changesets
 * Shouldn't be able to change created_by and version on changeset
index 5fb732d..a3fa522 100644 (file)
@@ -3,11 +3,11 @@
        xmlns:mx="http://www.adobe.com/2006/mxml" 
        layout="vertical"
        horizontalAlign="center" title="Save Changes"
-       width="350" height="250" verticalGap="0">
+       width="350" height="330" verticalGap="0">
 
   <mx:ArrayCollection id="changesetTags">
     <mx:Object k="created_by" v="Potlatch 2"/>
-    <mx:Object k="version" v="x.xx.x"/>
+    <mx:Object k="version" v="{Application.application.version}"/>
     <mx:Object k="comment" v=""/>
   </mx:ArrayCollection>
   
             </mx:text>
           </mx:Text>
           <mx:Label text="Comment:"/>
-          <mx:TextArea id="comment" width="100%" height="100%"/>
+          <mx:TextArea id="comment" width="100%" height="100%" change="commentChanged(event);" />
         </mx:VBox>
         
         <mx:VBox width="100%" height="100%" label="Advanced">
           <mx:Label text="Changeset tags:"/>
-          <mx:DataGrid editable="true" width="100%" height="100%" id="advancedTagGrid"
+          <mx:DataGrid editable="true" width="100%" id="advancedTagGrid"
               dataProvider="{changesetTags}">
             <mx:columns>
                 <mx:DataGridColumn editable="true" dataField="k" headerText="Key"/>
                 <mx:DataGridColumn editable="true" dataField="v" headerText="Value"/>
             </mx:columns>
           </mx:DataGrid>        
+                 <mx:HBox horizontalAlign="right" width="100%">
+                   <mx:LinkButton label="Delete" click="removeTag()" enabled="{advancedTagGrid.selectedItem != null? true : false}"/>
+                   <mx:LinkButton label="Add" click="addNewTag()"/>
+                 </mx:HBox>
+                 <mx:HRule width="100%" />
         </mx:VBox>
       </mx:ViewStack>
       <mx:LinkBar dataProvider="{tagStack}"/>
@@ -69,6 +74,7 @@
   
     import mx.controls.*;
     import mx.managers.PopUpManager;
+       import mx.core.Application;
     
     import net.systemeD.halcyon.connection.*;
     
     
     [Bindable]
     private var failureText:String = "";
+
+       private function commentChanged(event:Event):void {
+               for (var i:int=changesetTags.length-1; i>0; i--) {
+                       if (changesetTags[i]['k']=='comment') { changesetTags.removeItemAt(i); }
+               }
+               changesetTags.addItem( { k:'comment', v: event.target.text } );
+    }
+
+       private function addNewTag():void {
+               changesetTags.addItem( { k:'(new key)', v:'(new value)' } );
+               advancedTagGrid.editedItemPosition = { rowIndex: changesetTags.length-1, columnIndex: 0 };
+       }
+
+       private function removeTag():void {
+               changesetTags.removeItemAt(advancedTagGrid.selectedIndex);
+       }
     
     private function startSave():void {
     
         conn.addEventListener(Connection.NEW_CHANGESET_ERROR, changesetError);
         conn.createChangeset(tags);
     }
-    
+
     private function changesetCreated(event:EntityEvent):void {
         var changeset:Changeset = conn.getActiveChangeset();
         addStatus("Changeset created (id: "+changeset.id+")");
index b37f77f..521aebb 100755 (executable)
 
                private var savecount:uint=0;
                private var loadcount:uint=0;
+               
+               public var version:String="(Foxbase) Alpha";                    // mxml won't read it if it's a const. Go figure
 
                private function initApp():void {