1
0
Fork 0

Correct margin for message text in the "Download scenery" dialog.

Minor correction for margin and padding for layout.
This commit is contained in:
Roman Ludwicki 2022-09-28 16:43:50 +02:00
parent 6c025f04b2
commit eed2bc3259

View file

@ -2,76 +2,75 @@
<PropertyList> <PropertyList>
<name>terrasync</name> <name>terrasync</name>
<nasal> <nasal>
<open> <open>
<![CDATA[ <![CDATA[
var computeStatusText = func {
# first, check if the system is actually enabled
if (!getprop('/sim/terrasync/enabled'))
return "Downloading disabled";
var computeStatusText = func { # only happens if terrasync failed to activate, so
# first, check if the system is actually enabled # indicates a problem
if (!getprop('/sim/terrasync/enabled')) if (!getprop('/sim/terrasync/active'))
return "Downloading disabled"; return "Automatic download inactive";
# only happens if terrasync failed to activate, so # we need to suggest some remedial action here!
# indicates a problem if (getprop('/sim/terrasync/stalled'))
if (!getprop('/sim/terrasync/active')) return "Downloading has stalled. Check your network connection and settings";
return "Automatic download inactive";
# we need to suggest some remedial action here! if (getprop('/sim/terrasync/busy')) {
if (getprop('/sim/terrasync/stalled')) var kbytesSec = getprop('/sim/terrasync/transfer-rate-bytes-sec') / 1024;
return "Downloading has stalled. Check your network connection and settings"; return sprintf('Downloading: %dKB/sec', int(kbytesSec));
}
if (getprop('/sim/terrasync/busy')) { # we are enabled but not busy, so idle
var kbytesSec = getprop('/sim/terrasync/transfer-rate-bytes-sec') / 1024; return "Ready";
return sprintf('Downloading: %dKB/sec', int(kbytesSec)); }
}
# we are enabled but not busy, so idle # timer function, update summary status string
return "Ready"; var updateStatusText = func {
} var s = computeStatusText();
setprop("/sim/gui/dialogs/terrasync/status", s);
# timer function, update summary status string var msg = "";
var updateStatusText = func { if (getprop("/sim/terrasync/available")) {
var s = computeStatusText(); if (getprop("/sim/terrasync/enabled"))
setprop("/sim/gui/dialogs/terrasync/status", s); msg = "Automatic download active; monitor your bandwidth on metered connection.";
} else {
if (getprop("/sim/terrasync/intialized"))
msg = "Automatic download not active.";
else
msg = "Automatic download not supported.";
}
setprop("/sim/terrasync/ui-message-node", msg);
}
var msg = ""; # the TerraSync properties of interest are tied, so we can't use a
if (getprop("/sim/terrasync/available")) { # listener. Let's poll while the dialog is open; not ideal but not
if (getprop("/sim/terrasync/enabled")) # a major problem.
msg = "Automatic download active; monitor your bandwidth on metered connection."; var statusTimer = maketimer(0.4, updateStatusText);
} else { statusTimer.start();
if (getprop("/sim/terrasync/intialized")) updateStatusText();
msg = "Automatic download not active.";
else
msg = "Automatic download not supported.";
}
setprop("/sim/terrasync/ui-message-node", msg);
}
# the TerraSync properties of interest are tied, so we can't use a setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
# listener. Let's poll while the dialog is open; not ideal but not ]]>
# a major problem. </open>
var statusTimer = maketimer(0.4, updateStatusText);
statusTimer.start();
updateStatusText();
setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
]]>
</open>
<close> <close>
statusTimer.stop(); statusTimer.stop();
statusTimer = nil; statusTimer = nil;
</close> </close>
</nasal> </nasal>
<layout>vbox</layout> <layout>vbox</layout>
<default-padding>3</default-padding>
<group> <group>
<layout>hbox</layout> <layout>hbox</layout>
<default-padding>4</default-padding> <default-padding>1</default-padding>
<empty><stretch>1</stretch></empty> <empty><stretch>1</stretch></empty>
@ -86,7 +85,6 @@ setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
<pref-height>16</pref-height> <pref-height>16</pref-height>
<legend></legend> <legend></legend>
<keynum>27</keynum> <keynum>27</keynum>
<border>2</border>
<binding> <binding>
<command>dialog-close</command> <command>dialog-close</command>
</binding> </binding>
@ -95,40 +93,33 @@ setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
<hrule/> <hrule/>
<text>
<name>message</name>
<color>
<red>1.0</red>
<green>0.4</green>
<blue>0.4</blue>
</color>
<halign>left</halign>
<property>/sim/terrasync/ui-message-node</property>
<live>true</live>
</text>
<group> <group>
<layout>vbox</layout> <layout>vbox</layout>
<padding>5</padding>
<group> <group>
<layout>table</layout> <layout>hbox</layout>
<halign>left</halign> <halign>left</halign>
<equal>false</equal>
<!-- only for a gap -->
<text> <text>
<row>0</row> <name>message</name>
<col>0</col> <color>
<halign>center</halign> <red>1.0</red>
<label> </label> <green>0.4</green>
<blue>0.4</blue>
</color>
<property>/sim/terrasync/ui-message-node</property>
<live>true</live>
</text> </text>
</group>
<group>
<layout>hbox</layout>
<halign>left</halign>
<checkbox> <checkbox>
<name>terrasync-enabled</name> <name>terrasync-enabled</name>
<halign>left</halign> <halign>left</halign>
<row>0</row>
<col>1</col>
<colspan>3</colspan>
<property>/sim/terrasync/enabled</property> <property>/sim/terrasync/enabled</property>
<label>Enable automatic scenery download</label> <label>Enable automatic scenery download</label>
<live>true</live> <live>true</live>
@ -143,23 +134,20 @@ setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
</not-equals> </not-equals>
</enable> </enable>
</checkbox> </checkbox>
</group>
<group>
<layout>hbox</layout>
<halign>left</halign>
<!-- only for a gap --> <!-- only for a gap -->
<text> <text>
<row>1</row>
<col>1</col>
<halign>center</halign>
<label> </label> <label> </label>
</text> </text>
<checkbox> <checkbox>
<name>ai-data-enabled</name> <name>ai-data-enabled</name>
<halign>left</halign> <halign>left</halign>
<row>1</row>
<col>2</col>
<!--
<colspan>2</colspan>
-->
<property>/sim/terrasync/ai-data-enabled</property> <property>/sim/terrasync/ai-data-enabled</property>
<label>Update AI Traffic during FG start</label> <label>Update AI Traffic during FG start</label>
<live>true</live> <live>true</live>
@ -168,21 +156,18 @@ setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
<object-name>ai-data-enabled</object-name> <object-name>ai-data-enabled</object-name>
</binding> </binding>
<enable> <enable>
<property>/sim/terrasync/enabled</property> <property>/sim/terrasync/enabled</property>
<property>/sim/traffic-manager/enabled</property> <property>/sim/traffic-manager/enabled</property>
</enable> </enable>
</checkbox> </checkbox>
<button> <button>
<row>1</row>
<col>3</col>
<legend>Update Now</legend> <legend>Update Now</legend>
<border>2</border>
<equal>true</equal> <equal>true</equal>
<enable> <enable>
<property>/sim/terrasync/enabled</property> <property>/sim/terrasync/enabled</property>
<property>/sim/traffic-manager/enabled</property> <property>/sim/traffic-manager/enabled</property>
<property>/sim/terrasync/ai-data-enabled</property> <property>/sim/terrasync/ai-data-enabled</property>
</enable> </enable>
<binding> <binding>
<command>property-assign</command> <command>property-assign</command>
@ -196,12 +181,9 @@ setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
</binding> </binding>
</button> </button>
<!-- <checkbox> <!-- <checkbox>
<name>other-data-enabled</name> <name>other-data-enabled</name>
<halign>left</halign> <halign>left</halign>
<row>2</row>
<col>2</col>
<colspan>2</colspan>
<property>/sim/terrasync/other-data-enabled</property> <property>/sim/terrasync/other-data-enabled</property>
<label>Download other data files</label> <label>Download other data files</label>
<live>true</live> <live>true</live>
@ -212,39 +194,40 @@ setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
<enable> <enable>
<property>/sim/terrasync/enabled</property> <property>/sim/terrasync/enabled</property>
</enable> </enable>
</checkbox> </checkbox> -->
--> </group>
<group>
<layout>hbox</layout>
<halign>center</halign>
<text> <text>
<name>warning_text</name> <name>warning_text</name>
<row>3</row>
<col>0</col><colspan>4</colspan>
<color> <color>
<red>1.0</red> <red>1.0</red>
<green>0.4</green> <green>0.4</green>
<blue>0.4</blue> <blue>0.4</blue>
<alpha>1</alpha> <alpha>1</alpha>
</color> </color>
<halign>center</halign>
<label/> <label/>
</text> </text>
</group> </group>
</group>
<hrule/> <hrule/>
<group>
<layout>vbox</layout>
<halign>left</halign>
<default-padding>5</default-padding>
<group> <group>
<layout>hbox</layout> <layout>hbox</layout>
<halign>left</halign> <halign>left</halign>
<default-padding>4</default-padding>
<!-- only for a gap -->
<text>
<halign>center</halign>
<label> </label>
</text>
<button> <button>
<legend>Information</legend> <legend>Information</legend>
<equal>true</equal>
<binding> <binding>
<command>property-assign</command> <command>property-assign</command>
<property>/sim/gui/dialogs/terrasync/display-mode</property> <property>/sim/gui/dialogs/terrasync/display-mode</property>
@ -252,14 +235,9 @@ setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
</binding> </binding>
</button> </button>
<!-- only for a gap -->
<text>
<halign>center</halign>
<label></label>
</text>
<button> <button>
<legend> Log </legend> <legend>Log</legend>
<equal>true</equal>
<binding> <binding>
<command>property-assign</command> <command>property-assign</command>
<property>/sim/gui/dialogs/terrasync/display-mode</property> <property>/sim/gui/dialogs/terrasync/display-mode</property>
@ -273,11 +251,6 @@ setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
<layout>hbox</layout> <layout>hbox</layout>
<halign>left</halign> <halign>left</halign>
<!-- gap -->
<text>
<label></label>
</text>
<group> <group>
<layout>table</layout> <layout>table</layout>
<halign>fill</halign> <halign>fill</halign>
@ -456,43 +429,34 @@ setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
</equals> </equals>
</visible> </visible>
<halign>fill</halign> <halign>fill</halign>
<valign>fill</valign> <valign>fill</valign>
<stretch>true</stretch> <stretch>true</stretch>
<pref-width>600</pref-width> <pref-width>600</pref-width>
<pref-height>300</pref-height> <pref-height>300</pref-height>
<logclass>terrasync</logclass> <logclass>terrasync</logclass>
<padding>6</padding>
</loglist> </loglist>
</group> </group>
<!-- gap -->
<text>
<label></label>
</text>
</group> <!-- end of tabbed group --> </group> <!-- end of tabbed group -->
</group>
<hrule/> <hrule/>
<group> <group>
<layout>hbox</layout> <layout>hbox</layout>
<default-padding>3</default-padding> <default-padding>3</default-padding>
<empty><stretch>true</stretch></empty> <empty><stretch>true</stretch></empty>
<button> <button>
<legend>Close</legend> <legend>Close</legend>
<border>2</border> <equal>true</equal>
<equal>true</equal> <key>Esc</key>
<key>Esc</key> <binding>
<binding> <command>dialog-close</command>
<command>dialog-close</command> </binding>
</binding> </button>
</button>
<empty><stretch>true</stretch></empty>
</group>
<empty><stretch>true</stretch></empty>
</group> </group>
</PropertyList> </PropertyList>