Debian Codegraph @

gui/dialogs/scenery_sources.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2
3 <!-- Sound control dialog -->
4
5 <PropertyList>
6 <name>scenery-sources</name>
7 <modal>false</modal>
8 <width>1000</width>
9 <layout>vbox</layout>
10
11 <group>
12 <layout>hbox</layout>
13
14 <text>
15 <label>Scenery Sources</label>
16 </text>
17
18 <empty><stretch>1</stretch></empty>
19
20 <button>
21 <legend>X</legend>
22 <key>Esc</key>
23 <pref-width>20</pref-width>
24 <pref-height>20</pref-height>
25 <binding>
26 <command>dialog-close</command>
27 </binding>
28 </button>
29 </group>
30
31 <hrule/>
32
33 <group>
34 <name>source-table</name>
35 <layout>table</layout>
36 <halign>fill</halign>
37
38 <text>
39 <row>0</row>
40 <col>0</col>
41 <label>Directory</label>
42 <padding>10</padding>
43 </text>
44
45 <text>
46 <row>0</row>
47 <col>1</col>
48 <label>Source</label>
49 <padding>10</padding>
50 </text>
51
52 <text>
53 <row>0</row>
54 <col>2</col>
55 <label>License</label>
56 <padding>10</padding>
57 </text>
58
59 <text>
60 <row>0</row>
61 <col>3</col>
62 <label>URL</label>
63 <padding>10</padding>
64 </text>
65
66 </group>
67
68 <hrule/>
69
70 <group>
71 <layout>hbox</layout>
72 <default-padding>10</default-padding>
73
74 <button>
75 <legend>Close</legend>
76 <default>true</default>
77 <key>Esc</key>
78 <binding>
79 <command>dialog-close</command>
80 </binding>
81 </button>
82 </group>
83
84 <nasal>
85 <open><![CDATA[
86 var dlg_root = cmdarg();
87
88 # Fill the table of scenery sources
89 var table = gui.findElementByName( dlg_root, "source-table" );
90 var row = 1;
91 var sources = props.globals.getNode( "scenery/sources" );
92 if( sources != nil ) {
93 var dirs = sources.getChildren("directory");
94 forindex (var i; dirs ) {
95 var path = dirs[i].getValue("path");
96 var path_txt = table.addChild("text");
97 path_txt.setValues( { row: row, col: 0, label: path, padding: 5, halign: "left"} );
98
99 var source = dirs[i].getChildren("source");
100 forindex (var j; source) {
101 var name = source[j].getValue("name");
102 var link = source[j].getValue("link");
103 var license = source[j].getValue("license");
104
105 var name_txt = table.addChild("text");
106 name_txt.setValues( { row: row, col: 1, label: name, padding: 5, halign: "left"} );
107
108 var license_txt = table.addChild("text");
109 license_txt.setValues( { row: row, col: 2, label: license, padding: 5, halign: "left"} );
110
111
112 if (link != "") {
113 var button = table.addChild("button");
114 button.setValues( { row: row, col: 3, legend: "Website", padding: 5, halign: "left",
115 binding: { command: "open-browser", url: link }
116 } );
117 }
118
119 row +=1;
120 }
121 }
122 } else {
123 var txt = table.addChild("text");
124 txt.setValues( { row: row, col: 0, colspan: 4, label: "No scenery source attributions found", padding: 10, halign: "center"} );
125 }
126 ]]></open>
127 </nasal>
128
129 </PropertyList>