From: Richard Fairhurst Date: Fri, 9 Jul 2010 19:35:02 +0000 (+0000) Subject: slash and burn trace statements, and fix areas on vector background layers X-Git-Tag: 0.5~338 X-Git-Url: https://git.openstreetmap.org/potlatch2.git/commitdiff_plain/f911a5df3a0f322b2d79a5832e1f7d08fd43c0f1?ds=sidebyside slash and burn trace statements, and fix areas on vector background layers --- diff --git a/TODO.txt b/TODO.txt index 184f3417..0320f605 100644 --- a/TODO.txt +++ b/TODO.txt @@ -3,8 +3,6 @@ Potlatch 2: main outstanding issues ** = required before P2 goes live -** Slash and burn trace statements - == Core geometry == * P1-style J (join) / shift-J (unjoin) @@ -32,7 +30,6 @@ Potlatch 2: main outstanding issues == UI == -** Clicking the menu on the SuperTabNavigator appears to boggle it completely * Escape should rewind the entity to how it was before the current ControllerState. (Record a position in the undo stack when exiting a ControllerState, and escape would rewind to that) * Potlatch 1-style "floaty warnings" * Custom imagery dialog fixes diff --git a/net/systemeD/halcyon/VectorLayer.as b/net/systemeD/halcyon/VectorLayer.as index 9ef040ea..d919e987 100644 --- a/net/systemeD/halcyon/VectorLayer.as +++ b/net/systemeD/halcyon/VectorLayer.as @@ -70,14 +70,18 @@ package net.systemeD.halcyon { if (entity is Way) { // copy way through to main layer // ** shouldn't do this if the nodes are already in the main layer + // (or maybe we should just match on lat/long to avoid ways in background having nodes in foreground) var oldWay:Way=Way(entity); var newWay:Way=connection.createWay(oldWay.getTagsCopy(), [], MainUndoStack.getGlobalStack().addAction); + var nodemap:Object={}; + var oldNode:Node, newNode:Node; for (i=0; i= 0; i-- ) { var action:UndoableAction = actions[i]; - trace("going to do "+action); action.undoAction(); } diff --git a/net/systemeD/halcyon/connection/Connection.as b/net/systemeD/halcyon/connection/Connection.as index f8e23713..13ee98f7 100755 --- a/net/systemeD/halcyon/connection/Connection.as +++ b/net/systemeD/halcyon/connection/Connection.as @@ -34,7 +34,6 @@ package net.systemeD.halcyon.connection { } public static function getParam(name:String, defaultValue:String):String { - trace("Returning param "+name+" as "+(params[name] == null ? defaultValue : params[name])); return params[name] == null ? defaultValue : params[name]; } diff --git a/net/systemeD/halcyon/connection/MainUndoStack.as b/net/systemeD/halcyon/connection/MainUndoStack.as index b302b218..e85c4ec8 100644 --- a/net/systemeD/halcyon/connection/MainUndoStack.as +++ b/net/systemeD/halcyon/connection/MainUndoStack.as @@ -19,7 +19,6 @@ package net.systemeD.halcyon.connection { * stack -- find another one. */ public function addAction(action:UndoableAction):void { - trace("doing "+action); var result:uint = action.doAction(); switch ( result ) { @@ -73,7 +72,6 @@ package net.systemeD.halcyon.connection { public function undo():void { if (!undoActions.length) { return; } var action:UndoableAction = undoActions.pop(); - trace("undoing "+action); action.undoAction(); redoActions.push(action); dispatchEvent(new Event("new_undo_item")); @@ -83,7 +81,6 @@ package net.systemeD.halcyon.connection { public function redo():void { if (!redoActions.length) { return; } var action:UndoableAction = redoActions.pop(); - trace("redoing "+action); action.doAction(); undoActions.push(action); dispatchEvent(new Event("new_undo_item")); diff --git a/net/systemeD/halcyon/connection/XMLConnection.as b/net/systemeD/halcyon/connection/XMLConnection.as index a22bd4e6..79ac7050 100644 --- a/net/systemeD/halcyon/connection/XMLConnection.as +++ b/net/systemeD/halcyon/connection/XMLConnection.as @@ -5,6 +5,7 @@ package net.systemeD.halcyon.connection { import flash.system.Security; import flash.net.*; import org.iotashan.oauth.*; + import mx.controls.Alert; import net.systemeD.halcyon.Globals; @@ -18,7 +19,6 @@ package net.systemeD.halcyon.connection { Security.loadPolicyFile(Connection.policyURL); var oauthPolicy:String = Connection.getParam("oauth_policy", ""); if ( oauthPolicy != "" ) { - trace(oauthPolicy); Security.loadPolicyFile(oauthPolicy); } } @@ -40,7 +40,7 @@ package net.systemeD.halcyon.connection { } private function errorOnMapLoad(event:Event):void { - trace("error loading map"); + Alert.show("Couldn't load the map", 'Error', mx.controls.Alert.OK); } private function mapLoadStatus(event:HTTPStatusEvent):void { trace("loading map status = "+event.status); @@ -180,8 +180,7 @@ package net.systemeD.halcyon.connection { } private function diffUploadError(event:IOErrorEvent):void { - trace("error "+URLLoader(event.target).data + " "+httpStatus+ " " + event.text); - + Alert.show("Couldn't upload data: "+httpStatus+" "+event.text, 'Error', mx.controls.Alert.OK); dispatchEvent(new SaveCompleteEvent(SAVE_COMPLETED, false)); } diff --git a/net/systemeD/halcyon/connection/actions/RemoveNodeFromWayAction.as b/net/systemeD/halcyon/connection/actions/RemoveNodeFromWayAction.as index 2e29db06..239d8d69 100644 --- a/net/systemeD/halcyon/connection/actions/RemoveNodeFromWayAction.as +++ b/net/systemeD/halcyon/connection/actions/RemoveNodeFromWayAction.as @@ -36,7 +36,6 @@ package net.systemeD.halcyon.connection.actions { for (var i:int = nodeRemovedFrom.length - 1; i >= 0; i--) { var index:int = nodeRemovedFrom[i]; - trace("node being added "+index+" "+i+" "+node); nodeList.splice(index, 0, node); entity.dispatchEvent(new WayNodeEvent(Connection.WAY_NODE_ADDED, node, Way(entity), index)); } diff --git a/net/systemeD/halcyon/styleparser/StyleList.as b/net/systemeD/halcyon/styleparser/StyleList.as index 0f8c4c51..78224446 100755 --- a/net/systemeD/halcyon/styleparser/StyleList.as +++ b/net/systemeD/halcyon/styleparser/StyleList.as @@ -26,6 +26,16 @@ package net.systemeD.halcyon.styleparser { if (sublayers.indexOf(s)==-1) { sublayers.push(s); } } + public function toString():String { + var str:String=''; + var k:String; + for (k in shapeStyles) { str+="- SS "+k+"="+shapeStyles[k]+"\n"; } + for (k in textStyles) { str+="- TS "+k+"="+textStyles[k]+"\n"; } + for (k in pointStyles) { str+="- PS "+k+"="+pointStyles[k]+"\n"; } + for (k in shieldStyles) { str+="- sS "+k+"="+shieldStyles[k]+"\n"; } + return str; + } + private function hasShapeStyles():Boolean { for (var a:String in shapeStyles ) { return true; }; return false; } private function hasTextStyles():Boolean { for (var a:String in textStyles ) { return true; }; return false; } private function hasPointStyles():Boolean { for (var a:String in pointStyles ) { return true; }; return false; } diff --git a/net/systemeD/potlatch2/RelationSelectPanel.mxml b/net/systemeD/potlatch2/RelationSelectPanel.mxml index 0f7301f3..93193768 100644 --- a/net/systemeD/potlatch2/RelationSelectPanel.mxml +++ b/net/systemeD/potlatch2/RelationSelectPanel.mxml @@ -49,7 +49,6 @@ var relation:Relation = conn.createRelation(tags, [new RelationMember(entity, '')], MainUndoStack.getGlobalStack().addAction) PopUpManager.removePopUp(this); - trace("edit relation "+id); var panel:RelationEditorPanel = RelationEditorPanel( PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true)); panel.setRelation(relation); diff --git a/net/systemeD/potlatch2/TagViewer.mxml b/net/systemeD/potlatch2/TagViewer.mxml index 65695a4f..086a0a39 100644 --- a/net/systemeD/potlatch2/TagViewer.mxml +++ b/net/systemeD/potlatch2/TagViewer.mxml @@ -487,7 +487,6 @@ var rel:Relation = selectedEntity as Relation // drop members - trace("Dropping "+rel.length+" members"); for (var i:int=rel.length-1 ; i>=0; i--) { rel.removeMemberByIndex(i); } @@ -504,9 +503,7 @@ e = conn.getRelation(id); } rel.appendMember(new RelationMember(e, memberObject.role)); - trace("added member "+memberObject.type+" "+id+" in role "+memberObject.role); } - trace("complete: relation "+rel.id+" now has "+rel.length+" members"); } private function editRelation(id:Number):void { @@ -549,7 +546,6 @@ } public function openDescription():void { - trace("open description here"); if ( feature != null && feature.hasHelpURL() ) navigateToURL(new URLRequest(feature.helpURL), "potlatch_help"); } diff --git a/net/systemeD/potlatch2/controller/ControllerState.as b/net/systemeD/potlatch2/controller/ControllerState.as index b7f0b590..42e12868 100644 --- a/net/systemeD/potlatch2/controller/ControllerState.as +++ b/net/systemeD/potlatch2/controller/ControllerState.as @@ -62,11 +62,16 @@ package net.systemeD.potlatch2.controller { var paint:MapPaint = getMapPaint(DisplayObject(event.target)); var focus:Entity = getTopLevelFocusEntity(entity); + if ( paint && paint.isBackground ) { + if ( event.type == MouseEvent.MOUSE_DOWN && ((event.shiftKey && event.ctrlKey) || event.altKey) ) { + // pull data out of vector background layer + if (entity is Way) { return new SelectedWay(paint.findSource().pullThrough(entity,controller.connection)); } + } + return (this is NoSelection) ? this : new NoSelection(); + } + if ( event.type == MouseEvent.MOUSE_DOWN ) { - if ( entity is Way && event.altKey && paint.isBackground ) { - // pull way out of vector background layer - return new SelectedWay(paint.findSource().pullThrough(entity,controller.connection)); - } else if ( entity is Way ) { + if ( entity is Way ) { // click way return new DragWay(focus as Way, event); } else if ( focus is Node ) { diff --git a/net/systemeD/potlatch2/controller/DragBackground.as b/net/systemeD/potlatch2/controller/DragBackground.as index 307695df..af966b75 100644 --- a/net/systemeD/potlatch2/controller/DragBackground.as +++ b/net/systemeD/potlatch2/controller/DragBackground.as @@ -11,7 +11,6 @@ package net.systemeD.potlatch2.controller { private var downY:Number; public function DragBackground(event:MouseEvent) { - trace ("starting DragBackground"); downX = event.localX; downY = event.localY; } diff --git a/net/systemeD/potlatch2/save/OAuthPanel.mxml b/net/systemeD/potlatch2/save/OAuthPanel.mxml index 5f892117..5f56f4a6 100644 --- a/net/systemeD/potlatch2/save/OAuthPanel.mxml +++ b/net/systemeD/potlatch2/save/OAuthPanel.mxml @@ -21,7 +21,7 @@ label="http://oauth.dev.openstreetmap.org/oauth/authorize?somekey" click="openURL(authoriseURL); tryAccessButton.enabled=true;"/> - Once you've authorised the access click the 'Try Access' button below + Once you've authorised the access click the 'Try Access' button below Access was denied, please check, and try again]]>