Remove licence status display
[potlatch2.git] / net / systemeD / potlatch2 / dialogs / OptionsDialog.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2 <s:TitleWindow
3         xmlns:fx="http://ns.adobe.com/mxml/2009"
4         xmlns:mx="library://ns.adobe.com/flex/mx"
5         xmlns:s="library://ns.adobe.com/flex/spark"
6         title="Options"
7         width="350" height="250">
8
9     <s:layout>
10       <s:VerticalLayout
11           paddingLeft="5" paddingRight="5"
12           paddingTop="5" paddingBottom="5" />
13     </s:layout>
14
15         <s:CheckBox width="100%" label="Show toolbox" selected="true" id="tbcheck"
16             change="FlexGlobals.topLevelApplication.toolbox.toggle()" />
17
18         <s:CheckBox width="100%" label="Use custom cursors" selected="true" id="cursorcheck"
19             change="FlexGlobals.topLevelApplication.theController.cursorsEnabled=cursorcheck.selected" />
20
21     <s:CheckBox width="100%" label="Highlight unedited TIGER (US roads)" selected="false" id="tigercheck"
22         change="tigerToggle()" />
23
24         <s:CheckBox width="100%" label="Show mouse latitude/longitude" selected="false" id="latlongcheck"
25                 change="FlexGlobals.topLevelApplication.coordsbox.visible=latlongcheck.selected" />
26
27         <s:HGroup width="100%" verticalAlign="middle">
28       <s:Label text="Simplify accuracy: "/>
29       <mx:HSlider id="simplifyslider"
30                 minimum="1" maximum="5"
31                 dataTipPlacement="top" tickColor="black" labels="[High,Low]"
32                 snapInterval="1" tickInterval="1"
33                 allowTrackClick="true" liveDragging="true"
34                 change="simplifySet();"/>
35         </s:HGroup>
36
37     <s:controlBarContent>
38       <s:Button id="ok" label="OK" click="PopUpManager.removePopUp(this);" styleName="titleWindowButton" />
39     </s:controlBarContent>
40
41     <s:controlBarLayout>
42       <s:HorizontalLayout horizontalAlign="right"
43           paddingLeft="5" paddingRight="5"
44           paddingTop="5" paddingBottom="5" />
45     </s:controlBarLayout>
46
47   <fx:Script><![CDATA[
48     import mx.managers.PopUpManager;
49     import mx.events.CloseEvent;
50     import mx.core.Application;
51     import mx.core.FlexGlobals;
52     import net.systemeD.halcyon.Globals;
53     import net.systemeD.halcyon.Map;
54     import net.systemeD.halcyon.connection.Connection;
55     import net.systemeD.halcyon.connection.StatusFetcher;
56
57         private var userState:SharedObject=SharedObject.getLocal("user_state","/");
58     
59     public function init():void {
60         PopUpManager.addPopUp(this, Application(FlexGlobals.topLevelApplication), true);
61         PopUpManager.centerPopUp(this);
62         this.addEventListener(CloseEvent.CLOSE, optionsDialog_close);
63
64         tbcheck.selected = FlexGlobals.topLevelApplication.toolbox.visible;
65         cursorcheck.selected = FlexGlobals.topLevelApplication.theController.cursorsEnabled;
66         tigercheck.selected = userState.data['tiger_highlighted'];
67         latlongcheck.selected = FlexGlobals.topLevelApplication.coordsbox.visible;
68                 simplifyslider.value = userState.data['simplify_tolerance'] ? userState.data['simplify_tolerance']/0.00001 : 5;
69     }
70     
71     private function optionsDialog_close(evt:CloseEvent):void {
72         PopUpManager.removePopUp(this);
73     }
74
75     private function tigerToggle():void {
76         Globals.vars.highlightTiger = tigercheck.selected;
77         FlexGlobals.topLevelApplication.theMap.redraw();
78
79         userState.setProperty("tiger_highlighted",tigercheck.selected);
80         try { userState.flush(); } catch (e:Error) {}
81     }
82
83         private function simplifySet():void {
84         userState.setProperty("simplify_tolerance",simplifyslider.value*0.00001);
85         try { userState.flush(); } catch (e:Error) {}
86         }
87         
88               ]]>
89   </fx:Script>
90 </s:TitleWindow>