Hi!
Reacting to a feature request, attached patch adds support for
parkpos selection in the "location on ground" dialog, and clears any
parkpos preset in the "airports" dialog.
Somebody please review and commit.
--
Thanks,
Csaba/Jester
Index: gui/dialogs/airports.xml
===================================================================
RCS file: /var/cvs/FlightGear-0.9/data/gui/dialogs/airports.xml,v
retrieving revision 1.11
diff -u -r1.11 airports.xml
--- gui/dialogs/airports.xml 30 Jul 2008 21:56:18 -0000 1.11
+++ gui/dialogs/airports.xml 9 Dec 2008 01:45:27 -0000
@@ -35,6 +35,7 @@
setprop("/sim/presets/glideslope-deg", 0);
setprop("/sim/presets/heading-deg", 0);
setprop("/sim/presets/runway", "");
+ setprop("/sim/presets/parkpos", "");
}
</open>
</nasal>
Index: gui/dialogs/location-on-ground.xml
===================================================================
RCS file: /var/cvs/FlightGear-0.9/data/gui/dialogs/location-on-ground.xml,v
retrieving revision 1.9
diff -u -r1.9 location-on-ground.xml
--- gui/dialogs/location-on-ground.xml 1 May 2008 21:15:41 -0000 1.9
+++ gui/dialogs/location-on-ground.xml 9 Dec 2008 01:45:27 -0000
@@ -17,6 +17,31 @@
apt.setValue("");
var rwy = dlg.getNode("runway", 1);
rwy.setValue("");
+ var parkpos = dlg.getNode("parkpos", 1);
+ parkpos.setValue("");
+
+ var mode = {
+ runway: dlg.getNode("use_runway", 1),
+ parkpos: dlg.getNode("use_parkpos", 1)
+ };
+
+ var set_radio = func(m) {
+ foreach (k; keys(mode)) {
+ mode[k].setBoolValue(m == k);
+ }
+ }
+
+ var initialized = 0;
+ foreach (k; keys(mode)) {
+ if (mode[k].getType() == "NONE" or initialized) {
+ mode[k].setBoolValue(0);
+ } else {
+ initialized += mode[k].getBoolValue();
+ }
+ }
+ if (!initialized) {
+ set_radio("runway");
+ }
</open>
</nasal>
@@ -24,21 +49,51 @@
<layout>table</layout>
<halign>center</halign>
<text>
- <row>0</row><col>0</col>
+ <row>0</row><col>1</col>
+ <halign>right</halign>
<label>Airport:</label>
</text>
<input>
- <row>0</row><col>1</col>
+ <row>0</row><col>2</col>
<property>/sim/gui/dialogs/location-on-ground/airport</property>
</input>
- <text>
+
+ <radio>
<row>1</row><col>0</col>
+ <property>/sim/gui/dialogs/location-on-ground/use_runway</property>
+ <live>true</live>
+ <binding>
+ <command>nasal</command>
+ <script>set_radio("runway")</script>
+ </binding>
+ </radio>
+ <text>
+ <row>1</row><col>1</col>
+ <halign>right</halign>
<label>Runway:</label>
</text>
<input>
- <row>1</row><col>1</col>
+ <row>1</row><col>2</col>
<property>/sim/gui/dialogs/location-on-ground/runway</property>
</input>
+ <radio>
+ <row>2</row><col>0</col>
+ <property>/sim/gui/dialogs/location-on-ground/use_parkpos</property>
+ <live>true</live>
+ <binding>
+ <command>nasal</command>
+ <script>set_radio("parkpos")</script>
+ </binding>
+ </radio>
+ <text>
+ <row>2</row><col>1</col>
+ <halign>right</halign>
+ <label>Parking:</label>
+ </text>
+ <input>
+ <row>2</row><col>2</col>
+ <property>/sim/gui/dialogs/location-on-ground/parkpos</property>
+ </input>
</group>
<group>
@@ -57,7 +112,13 @@
<command>nasal</command>
<script>
setprop("/sim/presets/airport-id", apt.getValue());
- setprop("/sim/presets/runway", rwy.getValue());
+ if (mode["runway"].getBoolValue()) {
+ setprop("/sim/presets/runway", rwy.getValue());
+ setprop("/sim/presets/parkpos", "");
+ } else {
+ setprop("/sim/presets/runway", "");
+ setprop("/sim/presets/parkpos", parkpos.getValue());
+ }
setprop("/sim/presets/longitude-deg", -9999);
setprop("/sim/presets/latitude-deg", -9999);
setprop("/sim/presets/altitude-ft", -9999);
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel