Remember licence status from one session to the next
authorRichard Fairhurst <richard@systemeD.net>
Tue, 1 Nov 2011 11:45:21 +0000 (11:45 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Tue, 1 Nov 2011 11:45:21 +0000 (11:45 +0000)
net/systemeD/potlatch2/options/OptionsDialog.mxml
potlatch2.mxml

index 33d45ec..6e3fdb2 100644 (file)
                var conn:Connection=Map(Globals.vars.root).editableLayer.connection;
                if (conn.statusFetcher) {
                        conn.statusFetcher=null;
+                       userState.setProperty("licence_status",false);
                } else {
                        conn.statusFetcher=new StatusFetcher("http://wtfe.gryph.de/api/0.6/userlist",conn);
                        conn.statusFetcher.fetch(conn.getAllLoadedEntities());
+                       userState.setProperty("licence_status",true);
                        // ** FIXME: needs to also switch map style
                }
        }
index edf3a33..932755e 100644 (file)
                        conn.addEventListener(MapEvent.ERROR, onMapError);
                        conn.addEventListener(AttentionEvent.ATTENTION, onAttention);
                        conn.addEventListener(AttentionEvent.ALERT, onAlert);
+                       if (params['licence_status']) conn.statusFetcher=new StatusFetcher("http://wtfe.gryph.de/api/0.6/userlist",conn);
                        theMap.addLayer(conn, Stylesheets.instance().selected, false, true);
 
             // Auto-load vector backgrounds from config
                        Imagery.instance().addEventListener(CollectionEvent.SELECT,
                                function(e:CollectionEvent):void { theMap.tileset.init(e.data, e.data!=''); }
                        );
-
+                       
                        // keyboard event attached to stage
                        stage.addEventListener(KeyboardEvent.KEY_UP, theMap.keyUpHandler);