From d8c15c1e6031d8767bbeede827d47df33eac089c Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Mon, 11 Oct 2010 17:04:04 +0000 Subject: [PATCH] Make the mygpx dialog set up the tokens first --- net/systemeD/potlatch2/mygpx/MyGpxDialog.mxml | 8 +++----- net/systemeD/potlatch2/save/SaveManager.as | 13 ++++++++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/net/systemeD/potlatch2/mygpx/MyGpxDialog.mxml b/net/systemeD/potlatch2/mygpx/MyGpxDialog.mxml index 7ec0bde6..bb7ae519 100644 --- a/net/systemeD/potlatch2/mygpx/MyGpxDialog.mxml +++ b/net/systemeD/potlatch2/mygpx/MyGpxDialog.mxml @@ -11,15 +11,12 @@ import mx.core.Application; import net.systemeD.halcyon.connection.*; + import net.systemeD.potlatch2.save.*; public function init():void { PopUpManager.addPopUp(this, Application(Application.application), true); PopUpManager.centerPopUp(this); this.addEventListener(CloseEvent.CLOSE, myGpxDialog_close); - - // store whether the user has seen the help dialog before - var obj:SharedObject = SharedObject.getLocal("user_state"); - obj.setProperty("help_shown","true"); } private function myGpxDialog_close(evt:CloseEvent):void { @@ -27,8 +24,9 @@ } private function fetchList():void { + SaveManager.getAccessSorted(); Connection.getConnectionInstance().fetchUserTraces(); - results.text="yes"; + results.text="fetching..."; } ]]> diff --git a/net/systemeD/potlatch2/save/SaveManager.as b/net/systemeD/potlatch2/save/SaveManager.as index 6a3843bb..1a72797a 100644 --- a/net/systemeD/potlatch2/save/SaveManager.as +++ b/net/systemeD/potlatch2/save/SaveManager.as @@ -18,6 +18,17 @@ package net.systemeD.potlatch2.save { instance.save(instance.saveData); } + public static function getAccessSorted():void { + // hacky hack of pond-like clarity + instance.save(instance.doNothing); + } + + private function doNothing():void { + //hack hacky hack hack. Please look the other way... + Connection.getConnectionInstance().setAppID(consumer); + Connection.getConnectionInstance().setAuthToken(accessToken); + } + private function save(callback:Function):void { if ( consumer == null ) consumer = getConsumer(); @@ -29,7 +40,7 @@ package net.systemeD.potlatch2.save { else callback(); } - + private function getAccessToken():OAuthToken { var key:String = Connection.getParam("oauth_token", null); var secret:String = Connection.getParam("oauth_token_secret", null); -- 2.36.1