New Relation button
authorAndy Allan <gravitystorm@gmail.com>
Sun, 14 Feb 2010 16:48:47 +0000 (16:48 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Sun, 14 Feb 2010 16:48:47 +0000 (16:48 +0000)
TODO.txt
net/systemeD/potlatch2/RelationSelectPanel.mxml

index a66ff1033c229e0279cb1cc3b8fcf7a66c491b05..fd4c98548a4290fd2906bf334a381f807f132ec4 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -33,8 +33,8 @@ Potlatch 2: main outstanding issues
 * UI for geometry operations
 * Keyboard shortcuts
 * CSS editing
-* "New relations" panel
 * Direct click-to-edit of relation role should actually work
+* Relation member changes should update TagViewer automatically
 
 
 == Tagging ==
index 5b2a8bd8d17f3909c38f93ce6fe48cd4788ae4b1..136fa9e804de91b4be31dae87721141ac7b7bd45 100644 (file)
           relation.appendMember(new RelationMember(entity, ''));
           PopUpManager.removePopUp(this);
         }
+        
+        public function closeAndNewRelation():void {
+          var relation:Relation = conn.createRelation({}, [new RelationMember(entity, '')])
+          PopUpManager.removePopUp(this);
+          trace("edit relation "+id);
+          var panel:RelationEditorPanel = RelationEditorPanel(
+              PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
+          panel.setRelation(relation);
+          PopUpManager.centerPopUp(panel);
+        }
+        
     ]]></mx:Script> 
     <mx:Text id="warning" text="" />
     <mx:List width="100%" height="100%" id="relationSelector" verticalScrollPolicy="on"> 
     </mx:List>
     <mx:ControlBar>
-      <mx:Button label="New Relation..." enabled="false"/>
+      <mx:Button label="New Relation..." click="closeAndNewRelation();"/>
       <mx:Spacer width="100%"/>
       <mx:Button label="Select" click="updateEntityAndClose();" enabled="{relationSelector.selectedItem != null? true : false}"/>
     </mx:ControlBar>