1
0
Fork 0

Csaba/Jester :

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.
This commit is contained in:
fredb 2008-12-12 20:09:55 +00:00
parent 117dac8b4f
commit a9a4fc67e0
2 changed files with 67 additions and 5 deletions

View file

@ -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>

View file

@ -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);