This repository has been archived by the owner on Jan 1, 2021. It is now read-only.
forked from openstreetmap/potlatch2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load relations from the server on supplying the ID
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:TitleWindow | ||
xmlns:mx="http://www.adobe.com/2006/mxml" | ||
xmlns:potlatch2="net.systemeD.potlatch2.*" | ||
title="Load Relation" width="350" height="200" | ||
showCloseButton="true" close="PopUpManager.removePopUp(this);"> | ||
|
||
<mx:HBox> | ||
<mx:Label text="Relation ID: " /> | ||
<mx:TextInput id="requestedID" restrict="0-9" /> | ||
</mx:HBox> | ||
<mx:ControlBar> | ||
<mx:Spacer width="100%"/> | ||
<mx:Button label="Load" click="loadRelation();" styleName="titleWindowButton" /> | ||
</mx:ControlBar> | ||
<mx:Script><![CDATA[ | ||
import net.systemeD.halcyon.*; | ||
import net.systemeD.halcyon.connection.*; | ||
import net.systemeD.potlatch2.*; | ||
import mx.managers.PopUpManager; | ||
// ** FIXME: should automatically focus on id field (like the Changeset dialogue) | ||
public function loadRelation():void { | ||
var conn:Connection = Connection.getConnectionInstance(); | ||
var id:uint = uint(requestedID.text); | ||
if (requestedID.text) { | ||
var rel:Relation=conn.getRelation(id); | ||
if (!rel) { | ||
rel = conn.createRelation({}, [], MainUndoStack.getGlobalStack().addAction); | ||
rel.renumber(id,1); | ||
} | ||
conn.loadEntity(rel); | ||
// add an eventListener of some sort to pop up the panel again once it's loaded | ||
} | ||
PopUpManager.removePopUp(this); | ||
} | ||
]]></mx:Script> | ||
</mx:TitleWindow> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters