diff --git a/gui/dialogs/weather_scenario.xml b/gui/dialogs/weather_scenario.xml index d18e9e217..9c8ca1a5a 100644 --- a/gui/dialogs/weather_scenario.xml +++ b/gui/dialogs/weather_scenario.xml @@ -49,6 +49,10 @@ dialog-apply source-selection + + dialog-update + metar + @@ -81,7 +85,7 @@ 20 true true - true + false sim/gui/dialogs/weather-scenario/metar @@ -165,7 +169,7 @@ if( src[i] == `\n` or src[i] == `\r` ) src[i] = ` `; - if( i != 0 and src[i] == 32 and src[i-1] == 32 ) + if( i != 0 and src[i] == ` ` and src[i-1] == ` ` ) continue; dst = dst ~ " "; @@ -186,6 +190,17 @@ return nil; } + var findElementByName = func(rootN, name) { + foreach( var child; rootN.getChildren() ) { + var n = child.getNode( "name" ); + if( n != nil and n.getValue() == name ) + return child; + var f = findElementByName(child,name); + if( f != nil ) return f; + } + return nil; + }; + var propertyChangeListener = setlistener( "sim/gui/dialogs/weather-scenario/source-selection", func(n) { description = ""; metar = "nil"; @@ -209,17 +224,6 @@ setprop( "sim/gui/dialogs/weather-scenario/metar", normalize_string(getprop("environment/metar/data")) ); - var findElementByName = func(rootN, name) { - foreach( var child; rootN.getChildren() ) { - var n = child.getNode( "name" ); - if( n != nil and n.getValue() == name ) - return child; - var f = findElementByName(child,name); - if( f != nil ) return f; - } - return nil; - }; - # fill the METAR source combo box var combo = findElementByName( dlg_root, "source-selection" ); var wsn = props.globals.getNode( "/environment/weather-scenarios" );