From: Andy Allan Date: Sat, 9 Jan 2010 18:14:10 +0000 (+0000) Subject: Relation selection dialog X-Git-Tag: 0.5~552 X-Git-Url: https://git.openstreetmap.org/potlatch2.git/commitdiff_plain/3e2bb0e11dec0c3abc2cf267a4f3842dd3b7f69b?hp=c839a6630b9a1a4990c23bb052261a290da0d369 Relation selection dialog --- diff --git a/net/systemeD/halcyon/connection/Relation.as b/net/systemeD/halcyon/connection/Relation.as index 22474adb..784d6f73 100644 --- a/net/systemeD/halcyon/connection/Relation.as +++ b/net/systemeD/halcyon/connection/Relation.as @@ -55,6 +55,21 @@ package net.systemeD.halcyon.connection { removed[0].entity.removeParent(this); } + public function getDescription():String { + var desc:String = ""; + var relTags:Object = getTagsHash(); + if ( relTags["type"] ) { + desc = relTags["type"]; + if ( relTags[desc] ) + desc += " " + relTags[desc]; + } + if ( relTags["ref"] ) + desc += " " + relTags["ref"]; + if ( relTags["name"] ) + desc += " " + relTags["name"]; + return desc; + } + public override function getType():String { return 'relation'; } diff --git a/net/systemeD/potlatch2/RelationSelectPanel.mxml b/net/systemeD/potlatch2/RelationSelectPanel.mxml new file mode 100644 index 00000000..5b2a8bd8 --- /dev/null +++ b/net/systemeD/potlatch2/RelationSelectPanel.mxml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/net/systemeD/potlatch2/TagViewer.mxml b/net/systemeD/potlatch2/TagViewer.mxml index d47478cb..449c05f2 100644 --- a/net/systemeD/potlatch2/TagViewer.mxml +++ b/net/systemeD/potlatch2/TagViewer.mxml @@ -214,19 +214,7 @@ props["id"] = rel.id; var memberIndex:uint = rel.findEntityMemberIndex(entity); props["role"] = rel.getMember(memberIndex).role; - - var desc:String = ""; - var relTags:Object = rel.getTagsHash(); - if ( relTags["type"] ) { - desc = relTags["type"]; - if ( relTags[desc] ) - desc += " " + relTags[desc]; - } - if ( relTags["ref"] ) - desc += " " + relTags["ref"]; - if ( relTags["name"] ) - desc += " " + relTags["name"]; - props["description"] = desc; + props["description"] = rel.getDescription(); relations.push(props); } @@ -292,6 +280,7 @@ } public function addToRelation():void { + new RelationSelectPanel().init(selectedEntity); } public function removeFromRelation():void {