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

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