Debian Codegraph @

gui/dialogs/terrasync.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2
3 <PropertyList>
4 <name>terrasync</name>
5
6 <nasal>
7 <open>
8 <![CDATA[
9 var computeStatusText = func {
10 # first, check if the system is actually enabled
11 if (!getprop('/sim/terrasync/enabled'))
12 return "Downloading disabled";
13
14 # only happens if terrasync failed to activate, so
15 # indicates a problem
16 if (!getprop('/sim/terrasync/active'))
17 return "Automatic download inactive";
18
19 # we need to suggest some remedial action here!
20 if (getprop('/sim/terrasync/stalled'))
21 return "Downloading has stalled. Check your network connection and settings";
22
23 if (getprop('/sim/terrasync/busy')) {
24 var kbytesSec = getprop('/sim/terrasync/transfer-rate-bytes-sec') / 1024;
25 return sprintf('Downloading: %dKB/sec', int(kbytesSec));
26 }
27
28 # we are enabled but not busy, so idle
29 return "Ready";
30 }
31
32 # timer function, update summary status string
33 var updateStatusText = func {
34 var s = computeStatusText();
35 setprop("/sim/gui/dialogs/terrasync/status", s);
36
37 var msg = "";
38 if (getprop("/sim/terrasync/available")) {
39 if (getprop("/sim/terrasync/enabled"))
40 msg = "Automatic download active; monitor your bandwidth on metered connection.";
41 } else {
42 if (getprop("/sim/terrasync/intialized"))
43 msg = "Automatic download not active.";
44 else
45 msg = "Automatic download not supported.";
46 }
47 setprop("/sim/terrasync/ui-message-node", msg);
48 }
49
50 # the TerraSync properties of interest are tied, so we can't use a
51 # listener. Let's poll while the dialog is open; not ideal but not
52 # a major problem.
53 var statusTimer = maketimer(0.4, updateStatusText);
54 statusTimer.start();
55 updateStatusText();
56
57 setprop("/sim/gui/dialogs/terrasync/display-mode", "0");
58 ]]>
59 </open>
60
61 <close>
62 statusTimer.stop();
63 statusTimer = nil;
64 </close>
65
66 </nasal>
67
68 <layout>vbox</layout>
69 <default-padding>3</default-padding>
70
71 <group>
72 <layout>hbox</layout>
73 <default-padding>1</default-padding>
74
75 <text>
76 <label>Automatic Download of Scenery and Data (TerraSync)</label>
77 </text>
78
79 <empty><stretch>1</stretch></empty>
80
81 <button>
82 <legend>X</legend>
83 <key>Esc</key>
84 <pref-width>20</pref-width>
85 <pref-height>20</pref-height>
86 <binding>
87 <command>dialog-close</command>
88 </binding>
89 </button>
90 </group>
91
92 <hrule/>
93
94 <group>
95 <layout>vbox</layout>
96 <padding>5</padding>
97
98 <group>
99 <layout>hbox</layout>
100 <halign>left</halign>
101
102 <text>
103 <name>message</name>
104 <color>
105 <red>1.0</red>
106 <green>0.4</green>
107 <blue>0.4</blue>
108 </color>
109 <property>/sim/terrasync/ui-message-node</property>
110 <live>true</live>
111 </text>
112 </group>
113
114 <group>
115 <layout>hbox</layout>
116 <halign>left</halign>
117
118 <checkbox>
119 <name>terrasync-enabled</name>
120 <halign>left</halign>
121 <property>/sim/terrasync/enabled</property>
122 <label>Enable automatic scenery download</label>
123 <live>true</live>
124 <binding>
125 <command>dialog-apply</command>
126 <object-name>terrasync-enabled</object-name>
127 </binding>
128 <enable>
129 <not-equals>
130 <property>/sim/terrasync/scenery-dir</property>
131 <value></value>
132 </not-equals>
133 </enable>
134 </checkbox>
135 </group>
136
137 <group>
138 <layout>hbox</layout>
139 <halign>left</halign>
140
141 <!-- only for a gap -->
142 <text>
143 <label> </label>
144 </text>
145
146 <checkbox>
147 <name>ai-data-enabled</name>
148 <halign>left</halign>
149 <property>/sim/terrasync/ai-data-enabled</property>
150 <label>Update AI Traffic during FG start</label>
151 <live>true</live>
152 <binding>
153 <command>dialog-apply</command>
154 <object-name>ai-data-enabled</object-name>
155 </binding>
156 <enable>
157 <property>/sim/terrasync/enabled</property>
158 <property>/sim/traffic-manager/enabled</property>
159 </enable>
160 </checkbox>
161
162 <button>
163 <legend>Update Now</legend>
164 <equal>true</equal>
165 <enable>
166 <property>/sim/terrasync/enabled</property>
167 <property>/sim/traffic-manager/enabled</property>
168 <property>/sim/terrasync/ai-data-enabled</property>
169 </enable>
170 <binding>
171 <command>property-assign</command>
172 <property>/sim/terrasync/ai-data-enabled</property>
173 <value>1</value>
174 </binding>
175 <binding>
176 <command>property-assign</command>
177 <property>/sim/terrasync/ai-data-update-now</property>
178 <value>1</value>
179 </binding>
180 </button>
181
182 <!-- <checkbox>
183 <name>other-data-enabled</name>
184 <halign>left</halign>
185 <property>/sim/terrasync/other-data-enabled</property>
186 <label>Download other data files</label>
187 <live>true</live>
188 <binding>
189 <command>dialog-apply</command>
190 <object-name>other-data-enabled</object-name>
191 </binding>
192 <enable>
193 <property>/sim/terrasync/enabled</property>
194 </enable>
195 </checkbox> -->
196 </group>
197
198 <group>
199 <layout>hbox</layout>
200 <halign>center</halign>
201
202 <text>
203 <name>warning_text</name>
204 <color>
205 <red>1.0</red>
206 <green>0.4</green>
207 <blue>0.4</blue>
208 <alpha>1</alpha>
209 </color>
210 <label/>
211 </text>
212 </group>
213 </group>
214
215 <hrule/>
216
217 <group>
218 <layout>vbox</layout>
219 <halign>left</halign>
220 <default-padding>5</default-padding>
221
222 <group>
223 <layout>hbox</layout>
224 <halign>left</halign>
225
226 <button>
227 <legend>Information</legend>
228 <equal>true</equal>
229 <binding>
230 <command>property-assign</command>
231 <property>/sim/gui/dialogs/terrasync/display-mode</property>
232 <value>0</value>
233 </binding>
234 </button>
235
236 <button>
237 <legend>Log</legend>
238 <equal>true</equal>
239 <binding>
240 <command>property-assign</command>
241 <property>/sim/gui/dialogs/terrasync/display-mode</property>
242 <value>1</value>
243 </binding>
244 </button>
245 </group>
246
247 <!-- 'tabbed' group controlled by display-mode property -->
248 <group>
249 <layout>hbox</layout>
250 <halign>left</halign>
251
252 <group>
253 <layout>table</layout>
254 <halign>fill</halign>
255 <valign>fill</valign>
256 <default-padding>0</default-padding>
257
258 <group>
259 <layout>table</layout>
260 <halign>left</halign>
261 <valign>top</valign>
262 <equal>false</equal>
263
264 <row>0</row>
265 <col>0</col>
266 <visible>
267 <equals>
268 <property>/sim/gui/dialogs/terrasync/display-mode</property>
269 <value>0</value>
270 </equals>
271 </visible>
272
273 <text>
274 <row>0</row>
275 <col>0</col>
276
277 <halign>left</halign>
278 <label>Status:</label>
279 <live>true</live>
280 <color>
281 <red>0.7</red>
282 <green>0.7</green>
283 <blue>0.7</blue>
284 <alpha>1</alpha>
285 </color>
286 </text>
287
288 <text>
289 <row>0</row>
290 <col>1</col>
291 <colspan>2</colspan>
292
293 <halign>left</halign>
294 <!-- status text is generated by Nasal dynamically -->
295 <property>/sim/gui/dialogs/terrasync/status</property>
296 <live>true</live>
297 <halign>right</halign>
298 <color>
299 <red>0.7</red>
300 <green>0.7</green>
301 <blue>0.7</blue>
302 <alpha>1</alpha>
303 </color>
304 </text>
305
306 <text>
307 <halign>left</halign>
308 <row>1</row>
309 <col>0</col>
310 <label>KBytes downloaded:</label>
311 <color>
312 <red>0.7</red>
313 <green>0.7</green>
314 <blue>0.7</blue>
315 <alpha>1</alpha>
316 </color>
317 </text>
318 <text>
319 <row>1</row>
320 <col>1</col>
321 <format>%d</format>
322 <property>/sim/terrasync/downloaded-kbytes</property>
323 <live>true</live>
324 <halign>right</halign>
325 <stretch>true</stretch>
326 <color>
327 <red>0.7</red>
328 <green>0.7</green>
329 <blue>0.7</blue>
330 <alpha>1</alpha>
331 </color>
332 </text>
333
334 <text>
335 <halign>left</halign>
336 <row>2</row>
337 <col>0</col>
338 <label>Processed elements:</label>
339 <color>
340 <red>0.7</red>
341 <green>0.7</green>
342 <blue>0.7</blue>
343 <alpha>1</alpha>
344 </color>
345 </text>
346 <text>
347 <row>2</row>
348 <col>1</col>
349 <format>%s</format>
350 <property>/sim/terrasync/update-count</property>
351 <live>true</live>
352 <stretch>true</stretch>
353 <halign>right</halign>
354 <color>
355 <red>0.7</red>
356 <green>0.7</green>
357 <blue>0.7</blue>
358 <alpha>1</alpha>
359 </color>
360 </text>
361
362 <text>
363 <halign>left</halign>
364 <row>3</row>
365 <col>0</col>
366 <label>Processed scenery tiles:</label>
367 <color>
368 <red>0.7</red>
369 <green>0.7</green>
370 <blue>0.7</blue>
371 <alpha>1</alpha>
372 </color>
373 </text>
374 <text>
375 <row>3</row>
376 <col>1</col>
377 <format>%s</format>
378 <property>/sim/terrasync/tile-count</property>
379 <live>true</live>
380 <stretch>true</stretch>
381 <halign>right</halign>
382 <color>
383 <red>0.7</red>
384 <green>0.7</green>
385 <blue>0.7</blue>
386 <alpha>1</alpha>
387 </color>
388 </text>
389
390 <text>
391 <halign>left</halign>
392 <row>4</row>
393 <col>0</col>
394 <label>Number of errors:</label>
395 <color>
396 <red>0.7</red>
397 <green>0.7</green>
398 <blue>0.7</blue>
399 <alpha>1</alpha>
400 </color>
401 </text>
402 <text>
403 <row>4</row>
404 <col>1</col>
405 <format>%s</format>
406 <property>/sim/terrasync/error-count</property>
407 <live>true</live>
408 <stretch>true</stretch>
409 <halign>right</halign>
410 <color>
411 <red>0.7</red>
412 <green>0.7</green>
413 <blue>0.7</blue>
414 <alpha>1</alpha>
415 </color>
416 </text>
417 </group>
418
419 <loglist>
420 <row>0</row>
421 <col>0</col>
422
423 <visible>
424 <equals>
425 <property>/sim/gui/dialogs/terrasync/display-mode</property>
426 <value>1</value>
427 </equals>
428 </visible>
429
430 <halign>fill</halign>
431 <valign>fill</valign>
432 <stretch>true</stretch>
433 <pref-width>600</pref-width>
434 <pref-height>300</pref-height>
435 <logclass>terrasync</logclass>
436 </loglist>
437 </group>
438 </group> <!-- end of tabbed group -->
439 </group>
440
441 <hrule/>
442
443 <group>
444 <layout>hbox</layout>
445 <default-padding>3</default-padding>
446 <empty><stretch>true</stretch></empty>
447
448 <button>
449 <legend>Close</legend>
450 <equal>true</equal>
451 <key>Esc</key>
452 <binding>
453 <command>dialog-close</command>
454 </binding>
455 </button>
456
457 <empty><stretch>true</stretch></empty>
458 </group>
459
460 </PropertyList>