Remove licence status display
authorRichard Fairhurst <richard@systemeD.net>
Tue, 11 Sep 2012 15:57:48 +0000 (16:57 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Tue, 11 Sep 2012 15:57:48 +0000 (16:57 +0100)
net/systemeD/halcyon/connection/StatusFetcher.as
net/systemeD/potlatch2/dialogs/OptionsDialog.mxml
potlatch2.mxml

index 91db46d..49225d4 100644 (file)
@@ -7,7 +7,7 @@ package net.systemeD.halcyon.connection {
        public class StatusFetcher {
 
                /* Class to fetch the status for newly loaded objects.
        public class StatusFetcher {
 
                /* Class to fetch the status for newly loaded objects.
-                  At present this is rather specialised to WTFE (wtfe.gryph.de).
+                  Not currently functional.
                */
 
                public var _url:String;
                */
 
                public var _url:String;
@@ -58,21 +58,7 @@ package net.systemeD.halcyon.connection {
                                        case "node":    entity=conn.getNode(exml.@id); break;
                                }
 
                                        case "node":    entity=conn.getNode(exml.@id); break;
                                }
 
-                               // **** Specific WTFE-parsing code starts here
-                               // FIXME: should be generalised
-                               //              if all users are "yes" or "auto", status is 'ok' (3, green)
-                               //              if first user is "no", status is 'no' (0, red)
-                               //              if any other users are no, status is 'partial' (1, softer red)
-                               //              otherwise, status is 'unsure' (2, yellow)
-                               var s:uint=3;   // ok
-                               for each (var user:XML in exml.user) {
-                                       if (user.@severity=='harmless' || user.@severity=='none') continue;     // ignore if harmless
-                                       if (user.@decision=='no' && user.@version=='first') { s=0; }            // no from v1
-                                       else if (user.@decision=='no') { s=Math.min(s,1); }                                     // no from later version
-                                       else if (user.@decision=='undecided' || user.@decision=='anonymous') { s=Math.min(s,2); }       // unsure
-                               }
-                               status=STATUSES[s];
-                               // **** Specific WTFE-parsing code ends here
+                               // FIXME: needs some code to parse the XML, and set 'status' accordingly
                                entity.setStatus(status);
                        }
                }
                                entity.setStatus(status);
                        }
                }
index 1870701..c312f86 100644 (file)
@@ -24,9 +24,6 @@
        <s:CheckBox width="100%" label="Show mouse latitude/longitude" selected="false" id="latlongcheck"
                change="FlexGlobals.topLevelApplication.coordsbox.visible=latlongcheck.selected" />
 
        <s:CheckBox width="100%" label="Show mouse latitude/longitude" selected="false" id="latlongcheck"
                change="FlexGlobals.topLevelApplication.coordsbox.visible=latlongcheck.selected" />
 
-    <s:CheckBox width="100%" label="Show licence status" selected="false" id="licencecheck"
-        change="licenceToggle()" />
-
        <s:HGroup width="100%" verticalAlign="middle">
       <s:Label text="Simplify accuracy: "/>
       <mx:HSlider id="simplifyslider"
        <s:HGroup width="100%" verticalAlign="middle">
       <s:Label text="Simplify accuracy: "/>
       <mx:HSlider id="simplifyslider"
@@ -68,7 +65,6 @@
         cursorcheck.selected = FlexGlobals.topLevelApplication.theController.cursorsEnabled;
         tigercheck.selected = userState.data['tiger_highlighted'];
         latlongcheck.selected = FlexGlobals.topLevelApplication.coordsbox.visible;
         cursorcheck.selected = FlexGlobals.topLevelApplication.theController.cursorsEnabled;
         tigercheck.selected = userState.data['tiger_highlighted'];
         latlongcheck.selected = FlexGlobals.topLevelApplication.coordsbox.visible;
-               licencecheck.selected = Map(Globals.vars.root).editableLayer.connection.statusFetcher!=null;
                simplifyslider.value = userState.data['simplify_tolerance'] ? userState.data['simplify_tolerance']/0.00001 : 5;
     }
     
                simplifyslider.value = userState.data['simplify_tolerance'] ? userState.data['simplify_tolerance']/0.00001 : 5;
     }
     
         userState.setProperty("simplify_tolerance",simplifyslider.value*0.00001);
         try { userState.flush(); } catch (e:Error) {}
        }
         userState.setProperty("simplify_tolerance",simplifyslider.value*0.00001);
         try { userState.flush(); } catch (e:Error) {}
        }
-
-       private function licenceToggle():void {
-               // ** FIXME: this is an inelegant patch for the short-term issue of highlighting licensing status
-               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/problems",conn);
-                       conn.statusFetcher.fetch(conn.getAllLoadedEntities());
-                       userState.setProperty("licence_status",true);
-                       // ** FIXME: needs to also switch map style
-               }
-       }
        
               ]]>
   </fx:Script>
        
               ]]>
   </fx:Script>
index 806f66c..af7976e 100644 (file)
                        conn.addEventListener(MapEvent.ERROR, onMapError);
                        conn.addEventListener(AttentionEvent.ATTENTION, onAttention);
                        conn.addEventListener(AttentionEvent.ALERT, onAlert);
                        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/problems",conn);
                        theMap.addLayer(conn, Stylesheets.instance().selected.url, false, true);
 
             // Auto-load vector backgrounds from config
                        theMap.addLayer(conn, Stylesheets.instance().selected.url, false, true);
 
             // Auto-load vector backgrounds from config