Debian Codegraph @

gui/dialogs/flight-recorder-load.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2
3 <PropertyList>
4 <name>flight-recorder-load</name>
5 <layout>vbox</layout>
6 <resizable>true</resizable>
7 <default-padding>3</default-padding>
8
9 <nasal>
10 <open><![CDATA[
11 var DialogController = {
12 new : func( dlgRoot ) {
13 var obj = { parents: [DialogController] };
14 obj.dlgRoot = dlgRoot;
15 obj.updateCombo();
16 return obj;
17 },
18 updateCombo : func {
19 fgcommand("load-tape", props.Node.new({"tape": "",
20 "same-aircraft": getprop("/sim/gui/dialogs/flightrecorder/show-matching-aircraft-only")}));
21
22 var combo = gui.findElementByName( me.dlgRoot, "selected-tape" );
23 combo.removeChildren("value");
24
25 var i = 0;
26 var name = 1;
27 while (name != nil)
28 {
29 var name = getprop("/sim/replay/tape-list/tape[" ~ i ~ "]");
30 if (name != nil)
31 {
32 combo.getNode("value[" ~ i ~ "]", 1).setValue(name);
33 if (i==0)
34 {
35 setprop("/sim/gui/dialogs/flightrecorder/selected-tape", name);
36 }
37 }
38 i += 1;
39 }
40 if (i == 1)
41 {
42 setprop("/sim/gui/dialogs/flightrecorder/selected-tape", "No tapes in selected directory!");
43 me.haveData = 0;
44 }
45 else
46 {
47 me.haveData = 1;
48 }
49 me.preview();
50 },
51 preview: func {
52 var tape = getprop("/sim/gui/dialogs/flightrecorder/selected-tape");
53 setprop("/sim/gui/dialogs/flightrecorder/preview/aircraft-description", "");
54 setprop("/sim/gui/dialogs/flightrecorder/preview/version/flightgear", "");
55 setprop("/sim/gui/dialogs/flightrecorder/preview/user-data/description", "");
56 setprop("/sim/gui/dialogs/flightrecorder/preview/tape-duration-str", "");
57 setprop("/sim/gui/dialogs/flightrecorder/preview/aircraft-version", "");
58 setprop("/sim/gui/dialogs/flightrecorder/preview/aircraft-type", "");
59 setprop("/sim/gui/dialogs/flightrecorder/preview/closest-airport-id", "");
60 setprop("/sim/gui/dialogs/flightrecorder/preview/author-name", "");
61 setprop("/sim/gui/dialogs/flightrecorder/warning", "");
62 if (!me.haveData)
63 tape = "";
64 fgcommand("load-tape", props.Node.new({"tape": tape, "preview": 1} ) );
65 var actype = getprop("/sim/gui/dialogs/flightrecorder/preview/aircraft-type");
66 if ((actype != "")and(actype != getprop("/sim/aircraft")))
67 {
68 setprop("/sim/gui/dialogs/flightrecorder/warning",
69 "Tape was recorded for another aircraft (" ~ actype ~ "). It may not work (properly). Good luck! :)");
70 }
71 },
72 close: func {},
73 redraw: func{gui.dialog_update("flight-recorder-load", "selected-tape");},
74 };
75 var setdefault = func (prop, value) { if (getprop(prop) == nil) setprop(prop, value);}
76 setdefault("/sim/gui/dialogs/flightrecorder/show-matching-aircraft-only", 1);
77 var controller = DialogController.new( cmdarg() );
78 ]]></open>
79 </nasal>
80 <!--
81
82 -->
83
84 <!-- titlebar -->
85 <group>
86 <layout>hbox</layout>
87
88 <text>
89 <label>Load Flight Recorder Tape</label>
90 </text>
91
92 <empty><stretch>1</stretch></empty>
93
94 <button>
95 <legend>X</legend>
96 <key>Esc</key>
97 <pref-width>20</pref-width>
98 <pref-height>20</pref-height>
99 <binding>
100 <command>dialog-close</command>
101 </binding>
102 </button>
103 </group>
104 <hrule/>
105
106 <!-- main dialog area -->
107
108 <group>
109 <layout>table</layout>
110
111 <text>
112 <row>0</row><col>0</col>
113 <label>Tape Directory:</label>
114 <halign>left</halign>
115 <valign>top</valign>
116 </text>
117 <text>
118 <row>0</row><col>1</col>
119 <halign>left</halign>
120 <valign>top</valign>
121 <label>MMMMMMMMMMMMMMMMM</label>
122 <stretch>1</stretch>
123 <format>%s</format>
124 <property>/sim/replay/tape-directory</property>
125 <live>true</live>
126 <color>
127 <red>0.7</red>
128 <green>0.7</green>
129 <blue>0.7</blue>
130 <alpha>1</alpha>
131 </color>
132 </text>
133 <button>
134 <equal>false</equal>
135 <row>0</row><col>2</col>
136 <legend>Change</legend>
137 <halign>left</halign>
138 <valign>top</valign>
139 <binding>
140 <command>nasal</command>
141 <script><![CDATA[
142 var set_tapedir_sel = gui.DirSelector.new(
143 func(result) { setprop("/sim/replay/tape-directory", result.getValue());
144 controller.updateCombo();controller.redraw();
145 },
146 "Select Tape Directory", "Ok", getprop("/sim/replay/tape-directory"));
147 set_tapedir_sel.open();
148 ]]></script>
149 </binding>
150 </button>
151
152 <text>
153 <row>1</row><col>0</col>
154 <label>Hide Mismatching Tapes:</label>
155 <halign>left</halign>
156 </text>
157 <checkbox>
158 <row>1</row><col>1</col>
159 <name>matching-aircraft</name>
160 <halign>left</halign>
161 <property>/sim/gui/dialogs/flightrecorder/show-matching-aircraft-only</property>
162 <live>true</live>
163 <binding>
164 <command>dialog-apply</command>
165 <object-name>matching-aircraft</object-name>
166 </binding>
167 <binding>
168 <command>nasal</command>
169 <script>controller.updateCombo();controller.redraw();</script>
170 </binding>
171 <label>(Don't show tapes from other aircraft)</label>
172 </checkbox>
173
174 <text>
175 <row>2</row><col>0</col>
176 <label>Selected Tape:</label>
177 <halign>left</halign>
178 </text>
179 <combo>
180 <name>selected-tape</name>
181 <halign>left</halign>
182 <row>2</row><col>1</col>
183 <pref-width>300</pref-width>
184 <property>/sim/gui/dialogs/flightrecorder/selected-tape</property>
185 <editable>false</editable>
186 <live>true</live>
187 <binding>
188 <command>dialog-apply</command>
189 <object-name>selected-tape</object-name>
190 </binding>
191 <binding>
192 <command>nasal</command>
193 <script>controller.preview();controller.redraw();</script>
194 </binding>
195 </combo>
196
197 <hrule><row>3</row><col>0</col><colspan>3</colspan></hrule>
198
199 <text>
200 <row>5</row><col>0</col><colspan>3</colspan>
201 <label>Tape Recording Details</label>
202 <halign>center</halign>
203 </text>
204
205 <text>
206 <row>6</row><col>0</col>
207 <label>Author/Pilot:</label>
208 <halign>left</halign>
209 </text>
210 <text>
211 <row>6</row><col>1</col>
212 <format>%s</format>
213 <property>/sim/gui/dialogs/flightrecorder/preview/user-data/author-name</property>
214 <live>true</live>
215 <halign>left</halign>
216 <color>
217 <red>0.8</red>
218 <green>0.8</green>
219 <blue>0.0</blue>
220 <alpha>1</alpha>
221 </color>
222 </text>
223
224 <text>
225 <row>8</row><col>0</col>
226 <label>Aircraft:</label>
227 <halign>left</halign>
228 </text>
229 <text>
230 <row>8</row><col>1</col>
231 <format>%s</format>
232 <property>/sim/gui/dialogs/flightrecorder/preview/aircraft-description</property>
233 <live>true</live>
234 <halign>left</halign>
235 <color>
236 <red>0.8</red>
237 <green>0.8</green>
238 <blue>0.0</blue>
239 <alpha>1</alpha>
240 </color>
241 </text>
242
243 <text>
244 <row>10</row><col>0</col>
245 <label>Aircraft Version:</label>
246 <halign>left</halign>
247 </text>
248 <text>
249 <row>10</row><col>1</col>
250 <format>%s</format>
251 <property>/sim/gui/dialogs/flightrecorder/preview/aircraft-version</property>
252 <live>true</live>
253 <halign>left</halign>
254 <color>
255 <red>0.8</red>
256 <green>0.8</green>
257 <blue>0.0</blue>
258 <alpha>1</alpha>
259 </color>
260 </text>
261
262 <text>
263 <row>14</row><col>0</col>
264 <label>Airport (nearby):</label>
265 <halign>left</halign>
266 </text>
267 <text>
268 <row>14</row><col>1</col>
269 <format>%s</format>
270 <property>/sim/gui/dialogs/flightrecorder/preview/closest-airport-id</property>
271 <live>true</live>
272 <halign>left</halign>
273 <color>
274 <red>0.8</red>
275 <green>0.8</green>
276 <blue>0.0</blue>
277 <alpha>1</alpha>
278 </color>
279 </text>
280
281 <text>
282 <row>18</row><col>0</col>
283 <label>Tape Duration:</label>
284 <halign>left</halign>
285 </text>
286 <text>
287 <row>18</row><col>1</col>
288 <property>/sim/gui/dialogs/flightrecorder/preview/tape-duration-str</property>
289 <halign>left</halign>
290 <live>true</live>
291 <color>
292 <red>0.8</red>
293 <green>0.8</green>
294 <blue>0.0</blue>
295 <alpha>1</alpha>
296 </color>
297 </text>
298
299 <text>
300 <row>22</row><col>0</col>
301 <label>Tape Size (bytes)</label>
302 <halign>left</halign>
303 </text>
304 <text>
305 <row>22</row><col>1</col>
306 <property>/sim/gui/dialogs/flightrecorder/preview/tape-size-str</property>
307 <halign>left</halign>
308 <live>true</live>
309 <color>
310 <red>0.8</red>
311 <green>0.8</green>
312 <blue>0.0</blue>
313 <alpha>1</alpha>
314 </color>
315 </text>
316
317 <text>
318 <row>26</row><col>0</col>
319 <label>FG Version (recorder):</label>
320 <halign>left</halign>
321 </text>
322 <text>
323 <row>26</row><col>1</col>
324 <property>/sim/gui/dialogs/flightrecorder/preview/version/flightgear</property>
325 <halign>left</halign>
326 <live>true</live>
327 <color>
328 <red>0.8</red>
329 <green>0.8</green>
330 <blue>0.0</blue>
331 <alpha>1</alpha>
332 </color>
333 </text>
334
335 <text>
336 <row>29</row>
337 <col>0</col>
338 <colspan>3</colspan>
339 <label>Description:</label>
340 <halign>left</halign>
341 <valign>top</valign>
342 </text>
343 </group>
344
345 <group>
346 <layout>vbox</layout>
347 <stretch>10</stretch>
348 <halign>fill</halign>
349 <valign>fill</valign>
350 <textbox>
351 <wrap>false</wrap>
352 <live>true</live>
353 <name>description-string</name>
354 <halign>fill</halign>
355 <valign>fill</valign>
356 <stretch>1</stretch>
357 <pref-width>550</pref-width>
358 <pref-height>150</pref-height>
359 <editable>false</editable>
360 <top-line>1</top-line>
361 <property>/sim/gui/dialogs/flightrecorder/preview/user-data/description</property>
362 <binding>
363 <command>dialog-apply</command>
364 <object-name>description-string</object-name>
365 </binding>
366 </textbox>
367 <text>
368 <valign>top</valign>
369 <stretch>true</stretch>
370 <property>/sim/gui/dialogs/flightrecorder/warning</property>
371 <halign>left</halign>
372 <live>true</live>
373 <color>
374 <red>1.0</red>
375 <green>0.4</green>
376 <blue>0.4</blue>
377 <alpha>1</alpha>
378 </color>
379 </text>
380 </group>
381
382 <hrule/>
383
384 <group>
385 <layout>vbox</layout>
386 <checkbox>
387 <property>/sim/gui/dialogs/flightrecorder-load/create-video</property>
388 <halign>left</halign>
389 <label>Auto-create video</label>
390 <binding>
391 <command>dialog-apply</command>
392 </binding>
393 </checkbox>
394 <input>
395 <property>/sim/gui/dialogs/flightrecorder-load/fixed-dt</property>
396 <halign>left</halign>
397 <label>Fixed dt</label>
398 <binding>
399 <command>dialog-apply</command>
400 </binding>
401 </input>
402 </group>
403
404 <hrule/>
405
406 <!-- button area -->
407 <hrule/>
408 <group>
409 <layout>hbox</layout>
410 <default-padding>10</default-padding>
411 <empty><stretch>true</stretch></empty>
412
413 <button>
414 <legend>Load</legend>
415 <equal>true</equal>
416 <binding>
417 <command>dialog-apply</command>
418 </binding>
419 <binding>
420 <command>nasal</command>
421 <script>
422 # close old replay dialog and delay loading - until current replay was properly stopped
423 fgcommand("dialog-close", props.Node.new({ "dialog-name": "replay" }));
424 setprop("/sim/replay/disable", 0);
425 settimer(func {
426 var Config = props.Node.new({
427 "tape": getprop("/sim/gui/dialogs/flightrecorder/selected-tape", ""),
428 "same-aircraft": 0,
429 "create-video": getprop("/sim/gui/dialogs/flightrecorder-load/create-video"),
430 "fixed-dt": getprop("/sim/gui/dialogs/flightrecorder-load/fixed-dt"),
431 });
432 if (fgcommand("load-tape", Config))
433 gui.showDialog("replay");
434 }, 0.2);
435 </script>
436 </binding>
437 <binding>
438 <command>dialog-close</command>
439 </binding>
440 </button>
441
442 <button>
443 <legend>Cancel</legend>
444 <default>true</default>
445 <equal>true</equal>
446 <binding>
447 <command>dialog-close</command>
448 </binding>
449 </button>
450
451 <empty><stretch>true</stretch></empty>
452 </group>
453
454 </PropertyList>