Module: nagvis
Branch: master
Commit: 03a68cb9be3bc71646e7502e33eb38bfccd49a2a
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=03a68cb9be3bc71646e7502e33eb38bfccd49a2a

Author: Andriy Skuratov <[email protected]>
Date:   Tue Aug 25 17:48:58 2009 +0300

gmap:Location dialog enhensed with the locations list.

---

 uifx/src/modules/gmap/mate/UIInitEM.mxml       |    1 +
 uifx/src/modules/gmap/view/DialogLocation.mxml |   19 ++++++++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/uifx/src/modules/gmap/mate/UIInitEM.mxml 
b/uifx/src/modules/gmap/mate/UIInitEM.mxml
index 826b095..ffb6544 100644
--- a/uifx/src/modules/gmap/mate/UIInitEM.mxml
+++ b/uifx/src/modules/gmap/mate/UIInitEM.mxml
@@ -73,6 +73,7 @@
        </Injectors>
 
        <Injectors target="{DialogLocation}" debug="true">
+               <PropertyInjector targetKey="locations" 
source="{LocationsData}"/>
                <PropertyInjector targetKey="location" 
source="{CurrentLocation}" sourceKey="location"/>
                <PropertyInjector targetKey="hosts" source="{HostsData}"/>
                <PropertyInjector targetKey="hostgroups" 
source="{HostGroupsData}"/>
diff --git a/uifx/src/modules/gmap/view/DialogLocation.mxml 
b/uifx/src/modules/gmap/view/DialogLocation.mxml
index 39464fc..2d29c8f 100644
--- a/uifx/src/modules/gmap/view/DialogLocation.mxml
+++ b/uifx/src/modules/gmap/view/DialogLocation.mxml
@@ -27,6 +27,7 @@
 >
        <mx:Script>
                <![CDATA[
+                       import modules.gmap.data.LocationsData;
                        import mx.formatters.SwitchSymbolFormatter;
                        import modules.gmap.events.NagiosObjectEvent;
                        import mx.events.CloseEvent;
@@ -48,6 +49,8 @@
                        public var services : ArrayCollection;
                        public var servicegroups : ArrayCollection;
 
+                       [Bindable] public var locations:LocationsData;
+
                        private var _location : Location;
 
                        public function set location(location : Location) : void
@@ -58,6 +61,7 @@
 
                                        if (location)
                                        {
+                                               locationsList.selectedItem = 
location;
                                                locName.text = location.label;
                                                locLat.text = 
LatLng.fromUrlValue(location.point).lat().toString();
                                                locLng.text = 
LatLng.fromUrlValue(location.point).lng().toString();
@@ -66,14 +70,12 @@
 
                                                if (location.id && 
location.id.length > 0)
                                                {
-                                                       title.text = "Location 
- Edit Details";
                                                        addButton.visible = 
false;
                                                        saveButton.visible = 
true;
                                                        deleteButton.visible = 
true;
                                                }
                                                else
                                                {
-                                                       title.text = "Location 
- Add New";
                                                        addButton.visible = 
true;
                                                        saveButton.visible = 
false;
                                                        deleteButton.visible = 
false;
@@ -142,7 +144,7 @@
                                        }
                                        else
                                        {
-                                               title.text = "Location";
+                                               locationsList.selectedIndex = 
-1;
                                                locName.text = "";
                                                locLat.text = "";
                                                locLng.text = "";
@@ -386,11 +388,14 @@
                        <menuitem data="browse" label="Browse..."/>
                </root>
        </mx:XML>
-       <mx:HBox left="10" right="15" top="10" height="20">
+       <mx:HBox left="10" right="15" top="10">
                <mx:Image id="logo" 
source="@Embed(source='modules/gmap/img/pin.png')"/>
-               <mx:Label id="title" text="Location"/>
-               <mx:Spacer width="100%"/>
-               <mx:Image id="close"
+               <mx:ComboBox id="locationsList" width="100%" 
+                       prompt="Location" selectedIndex="-1" 
+                       dataProvider="{locations}"
+                       change="dispatchEvent(new 
LocationEvent(LocationEvent.SELECTED, locationsList.selectedItem as Location))"
+               />
+               <mx:Image id="close" height="22" verticalAlign="middle"
                        
source="@Embed(source='modules/gmap/img/control_fastforward.png')"
                        click="setCurrentState('right-contracted'); 
event.stopImmediatePropagation()"
                />


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to