make manual input work
This commit is contained in:
parent
7b7966dbb1
commit
ff8992d1a2
1 changed files with 17 additions and 13 deletions
|
@ -49,6 +49,10 @@
|
||||||
<command>dialog-apply</command>
|
<command>dialog-apply</command>
|
||||||
<object-name>source-selection</object-name>
|
<object-name>source-selection</object-name>
|
||||||
</binding>
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-update</command>
|
||||||
|
<object-name>metar</object-name>
|
||||||
|
</binding>
|
||||||
</combo>
|
</combo>
|
||||||
|
|
||||||
<textbox>
|
<textbox>
|
||||||
|
@ -81,7 +85,7 @@
|
||||||
<slider>20</slider>
|
<slider>20</slider>
|
||||||
<editable>true</editable>
|
<editable>true</editable>
|
||||||
<wrap>true</wrap>
|
<wrap>true</wrap>
|
||||||
<live>true</live>
|
<live>false</live>
|
||||||
<property>sim/gui/dialogs/weather-scenario/metar</property>
|
<property>sim/gui/dialogs/weather-scenario/metar</property>
|
||||||
</textbox>
|
</textbox>
|
||||||
|
|
||||||
|
@ -165,7 +169,7 @@
|
||||||
if( src[i] == `\n` or src[i] == `\r` )
|
if( src[i] == `\n` or src[i] == `\r` )
|
||||||
src[i] = ` `;
|
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;
|
continue;
|
||||||
|
|
||||||
dst = dst ~ " ";
|
dst = dst ~ " ";
|
||||||
|
@ -186,6 +190,17 @@
|
||||||
return nil;
|
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) {
|
var propertyChangeListener = setlistener( "sim/gui/dialogs/weather-scenario/source-selection", func(n) {
|
||||||
description = "";
|
description = "";
|
||||||
metar = "nil";
|
metar = "nil";
|
||||||
|
@ -209,17 +224,6 @@
|
||||||
setprop( "sim/gui/dialogs/weather-scenario/metar", normalize_string(getprop("environment/metar/data")) );
|
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
|
# fill the METAR source combo box
|
||||||
var combo = findElementByName( dlg_root, "source-selection" );
|
var combo = findElementByName( dlg_root, "source-selection" );
|
||||||
var wsn = props.globals.getNode( "/environment/weather-scenarios" );
|
var wsn = props.globals.getNode( "/environment/weather-scenarios" );
|
||||||
|
|
Loading…
Add table
Reference in a new issue