From 058364f4fd2e96d4e5193f130026eb2026954dae Mon Sep 17 00:00:00 2001 From: torsten Date: Mon, 8 Jun 2009 19:36:02 +0000 Subject: [PATCH] update metar data in textfield when metar changes during live data fetch --- gui/dialogs/weather_scenario.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gui/dialogs/weather_scenario.xml b/gui/dialogs/weather_scenario.xml index 4361ed97f..f1c08bede 100644 --- a/gui/dialogs/weather_scenario.xml +++ b/gui/dialogs/weather_scenario.xml @@ -213,6 +213,14 @@ setprop("sim/gui/dialogs/weather-scenario/metar", metar ); }); + var metarListener = setlistener( "environment/metar/data", func(n) { + var metar = n.getValue(); + if( metar == nil ) metar = ""; + metar = normalize_string(metar); + setprop("sim/gui/dialogs/weather-scenario/metar", metar ); + gui.dialog_update( "weather_scenario", "metar" ); + }, 1, 0); + #initialize the METAR source selection if( getprop( "environment/params/metar-updates-environment" ) == 0 ) { setprop("sim/gui/dialogs/weather-scenario/source-selection", "Disabled" ); @@ -256,6 +264,7 @@