1 | #ifndef AAFPANEL_SETTINGS_AUTOSTART_H |
---|
2 | #define AAFPANEL_SETTINGS_AUTOSTART_H |
---|
3 | |
---|
4 | // mode 0 = Defaults |
---|
5 | // mode 1 = Audio/Video/Sat |
---|
6 | // mode 2 = USB Device |
---|
7 | // mode 3 = Cam/Emu |
---|
8 | // mode 4 = Network |
---|
9 | // mode 5 = Child safety |
---|
10 | |
---|
11 | void screenaafpanel_settings_autostart(int mode) |
---|
12 | { |
---|
13 | int rcret = 0; |
---|
14 | struct skin* aaf_config = getscreen("aafpanel_config"); |
---|
15 | struct skin* listbox = getscreennode(aaf_config, "listbox"); |
---|
16 | struct skin* node = NULL; |
---|
17 | struct skin* tmp = NULL; |
---|
18 | |
---|
19 | addscreenrc(aaf_config, listbox); |
---|
20 | listbox->aktline = 1; |
---|
21 | listbox->aktpage = 1; |
---|
22 | |
---|
23 | if (mode == 0){ |
---|
24 | int i = 0; |
---|
25 | |
---|
26 | changetitle(aaf_config, _("AAF autostart Defaults")); |
---|
27 | |
---|
28 | if(file_exist("/etc/.usbimage")){ |
---|
29 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
30 | node->type = CHOICEBOX; |
---|
31 | changetext(node, _("fsckroot")); changename(node, "fsckroot"); |
---|
32 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
33 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
34 | } |
---|
35 | |
---|
36 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
37 | node->type = CHOICEBOX; |
---|
38 | changetext(node, _("bootstop")); changename(node, "bootstop"); |
---|
39 | for(i=0; i <= 20; i++) |
---|
40 | { |
---|
41 | char* tmpnr = NULL; |
---|
42 | tmpnr = oitoa(i); |
---|
43 | addchoicebox(node, tmpnr, _(tmpnr)); |
---|
44 | free(tmpnr); tmpnr = NULL; |
---|
45 | } |
---|
46 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
47 | |
---|
48 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
49 | node->type = CHOICEBOX; |
---|
50 | changetext(node, _("debug")); changename(node, "debug"); |
---|
51 | addchoicebox(node, "high", _("high")); addchoicebox(node, "low", _("low")); |
---|
52 | addchoicebox(node, "off", _("off")); |
---|
53 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
54 | |
---|
55 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
56 | node->type = CHOICEBOX; |
---|
57 | changetext(node, _("logto")); changename(node, "logto"); |
---|
58 | addchoicebox(node, "normal", _("normal")); addchoicebox(node, "hdd", _("hdd")); |
---|
59 | addchoicebox(node, "swap", _("swap")); addchoicebox(node, "off", _("off")); |
---|
60 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
61 | |
---|
62 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
63 | node->type = CHOICEBOX; |
---|
64 | changetext(node, _("errorboot")); changename(node, "errorboot"); |
---|
65 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
66 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
67 | |
---|
68 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
69 | node->type = CHOICEBOX; |
---|
70 | changetext(node, _("repairmodus")); changename(node, "repairmodus"); |
---|
71 | addchoicebox(node, "1", _("always")); addchoicebox(node, "0", _("off")); |
---|
72 | addchoicebox(node, "2", _("at bootloop")); |
---|
73 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
74 | |
---|
75 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
76 | node->type = CHOICEBOX; |
---|
77 | changetext(node, _("rmcrashlog")); changename(node, "rmcrashlog"); |
---|
78 | addchoicebox(node, "y", _("yes")); addchoicebox(node, "n", _("no")); |
---|
79 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
80 | |
---|
81 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
82 | node->type = CHOICEBOX; |
---|
83 | changetext(node, _("rmemthy")); changename(node, "rmemthy"); |
---|
84 | addchoicebox(node, "y", _("yes")); addchoicebox(node, "n", _("no")); |
---|
85 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
86 | |
---|
87 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
88 | node->type = CHOICEBOX; |
---|
89 | changetext(node, _("plugload")); changename(node, "plugload"); |
---|
90 | addchoicebox(node, "y", _("yes")); addchoicebox(node, "n", _("no")); |
---|
91 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
92 | |
---|
93 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
94 | node->type = CHOICEBOX; |
---|
95 | changetext(node, _("progressbar")); changename(node, "progressbar"); |
---|
96 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
97 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
98 | |
---|
99 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
100 | node->type = CHOICEBOX; |
---|
101 | changetext(node, _("showip")); changename(node, "showip"); |
---|
102 | addchoicebox(node, "status", _("status")); addchoicebox(node, "ip", _("ip")); |
---|
103 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
104 | |
---|
105 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
106 | node->type = CHOICEBOX; |
---|
107 | changetext(node, _("showtvinfo")); changename(node, "showtvinfo"); |
---|
108 | addchoicebox(node, "y", _("yes")); addchoicebox(node, "n", _("no")); |
---|
109 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
110 | |
---|
111 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
112 | node->type = CHOICEBOX; |
---|
113 | changetext(node, _("playlist")); changename(node, "playlist"); |
---|
114 | addchoicebox(node, "y", _("yes")); addchoicebox(node, "n", _("no")); |
---|
115 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
116 | |
---|
117 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
118 | node->type = CHOICEBOX; |
---|
119 | changetext(node, _("updatelist")); changename(node, "updatelist"); |
---|
120 | for(i=0; i <= 20; i++) |
---|
121 | { |
---|
122 | char* tmpnr = NULL; |
---|
123 | tmpnr = oitoa(i); |
---|
124 | addchoicebox(node, tmpnr, _(tmpnr)); |
---|
125 | free(tmpnr); tmpnr = NULL; |
---|
126 | } |
---|
127 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
128 | } |
---|
129 | |
---|
130 | if (mode == 1){ |
---|
131 | |
---|
132 | changetitle(aaf_config, _("AAF autostart Defaults")); |
---|
133 | |
---|
134 | if(isfile("/var/bin/audio.elf") || isfile("/boot/audio.old.elf")){ |
---|
135 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
136 | node->type = CHOICEBOX; |
---|
137 | changetext(node, _("Old Audiofw")); changename(node, "oldaudiofw"); |
---|
138 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
139 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
140 | } |
---|
141 | |
---|
142 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
143 | node->type = CHOICEBOX; |
---|
144 | changetext(node, _("No Audiosync")); changename(node, "noaudiosync"); |
---|
145 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
146 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
147 | |
---|
148 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
149 | node->type = CHOICEBOX; |
---|
150 | changetext(node, _("Boot Resolution")); changename(node, "BootResolution"); |
---|
151 | addchoicebox(node, "low", _("low")); addchoicebox(node, "high", _("high")); |
---|
152 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
153 | |
---|
154 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
155 | node->type = CHOICEBOX; |
---|
156 | changetext(node, _("Bootlogo")); changename(node, "bootlogo"); |
---|
157 | addchoicebox(node, "y", _("yes")); addchoicebox(node, "n", _("no")); |
---|
158 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
159 | |
---|
160 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
161 | node->type = CHOICEBOX; |
---|
162 | changetext(node, _("Poweroff")); changename(node, "poweroff"); |
---|
163 | addchoicebox(node, "y", _("yes")); addchoicebox(node, "n", _("no")); |
---|
164 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
165 | |
---|
166 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
167 | node->type = CHOICEBOX; |
---|
168 | changetext(node, _("Scart On Standby")); changename(node, "scartonstandby"); |
---|
169 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
170 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
171 | |
---|
172 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
173 | node->type = CHOICEBOX; |
---|
174 | changetext(node, _("HighSR")); changename(node, "HighSR"); |
---|
175 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
176 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
177 | |
---|
178 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
179 | node->type = CHOICEBOX; |
---|
180 | changetext(node, _("Tuner Sleep Off")); changename(node, "tuner_sleep_off"); |
---|
181 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
182 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
183 | |
---|
184 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
185 | node->type = CHOICEBOX; |
---|
186 | changetext(node, _("Boot RGB Fix")); changename(node, "bootrgbfix"); |
---|
187 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
188 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
189 | } |
---|
190 | |
---|
191 | if (mode == 2){ |
---|
192 | int i = 0; |
---|
193 | int tmpsize = 0; |
---|
194 | |
---|
195 | changetitle(aaf_config, _("AAF autostart USB")); |
---|
196 | |
---|
197 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
198 | node->type = CHOICEBOX; |
---|
199 | changetext(node, _("Load Partition")); changename(node, "loadpartition"); |
---|
200 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
201 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
202 | |
---|
203 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
204 | node->type = CHOICEBOX; |
---|
205 | changetext(node, _("Fsck Record")); changename(node, "fsckrecord"); |
---|
206 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
207 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
208 | |
---|
209 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
210 | node->type = CHOICEBOX; |
---|
211 | changetext(node, _("Swap")); changename(node, "swap"); |
---|
212 | addchoicebox(node, "y", _("yes")); addchoicebox(node, "n", _("no")); |
---|
213 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
214 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
215 | node->type = CHOICEBOX; |
---|
216 | changetext(node, _("Swap Size")); changename(node, "swapsize"); |
---|
217 | tmpsize = 16384; |
---|
218 | for(i=0; i < 7; i++) |
---|
219 | { |
---|
220 | char* tmpnr = NULL; |
---|
221 | tmpnr = oitoa(tmpsize); |
---|
222 | addchoicebox(node, tmpnr, _(tmpnr)); |
---|
223 | free(tmpnr); tmpnr = NULL; |
---|
224 | tmpsize = tmpsize * 2; |
---|
225 | } |
---|
226 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
227 | |
---|
228 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
229 | node->type = CHOICEBOX; |
---|
230 | changetext(node, _("Fsck Swap")); changename(node, "fsckswap"); |
---|
231 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
232 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
233 | |
---|
234 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
235 | node->type = CHOICEBOX; |
---|
236 | changetext(node, _("Record Max Sectors")); changename(node, "RecordMaxSectors"); |
---|
237 | tmpsize = 80; |
---|
238 | for(i=0; i < 13; i++) |
---|
239 | { |
---|
240 | char* tmpnr = NULL; |
---|
241 | tmpnr = oitoa(tmpsize); |
---|
242 | addchoicebox(node, tmpnr, _(tmpnr)); |
---|
243 | free(tmpnr); tmpnr = NULL; |
---|
244 | tmpsize = tmpsize + 80; |
---|
245 | } |
---|
246 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
247 | |
---|
248 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
249 | node->type = CHOICEBOX; |
---|
250 | changetext(node, _("Swap Max Sectors")); changename(node, "SwapMaxSectors"); |
---|
251 | tmpsize = 80; |
---|
252 | for(i=0; i < 13; i++) |
---|
253 | { |
---|
254 | char* tmpnr = NULL; |
---|
255 | tmpnr = oitoa(tmpsize); |
---|
256 | addchoicebox(node, tmpnr, _(tmpnr)); |
---|
257 | free(tmpnr); tmpnr = NULL; |
---|
258 | tmpsize = tmpsize + 80; |
---|
259 | } |
---|
260 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
261 | |
---|
262 | } |
---|
263 | |
---|
264 | if (mode == 3){ |
---|
265 | |
---|
266 | changetitle(aaf_config, _("AAF autostart EMU")); |
---|
267 | |
---|
268 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
269 | node->type = CHOICEBOX; |
---|
270 | changetext(node, _("Emu Control")); changename(node, "emucontrol"); |
---|
271 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
272 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
273 | |
---|
274 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
275 | node->type = CHOICEBOX; |
---|
276 | changetext(node, _("ftdi")); changename(node, "ftdi"); |
---|
277 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
278 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
279 | |
---|
280 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
281 | node->type = CHOICEBOX; |
---|
282 | changetext(node, _("pl2303")); changename(node, "pl2303"); |
---|
283 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
284 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
285 | |
---|
286 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
287 | node->type = CHOICEBOX; |
---|
288 | changetext(node, _("Nr Usbreaders")); changename(node, "nr_usbreaders"); |
---|
289 | addchoicebox(node, "2", _("2 readers")); addchoicebox(node, "3", _("3 readers")); |
---|
290 | addchoicebox(node, "4", _("4 readers")); addchoicebox(node, "5", _("5 readers")); |
---|
291 | addchoicebox(node, "6", _("6 readers")); addchoicebox(node, "7", _("7 readers")); |
---|
292 | addchoicebox(node, "0", _("not one")); addchoicebox(node, "1", _("1 reader")); |
---|
293 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
294 | |
---|
295 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
296 | node->type = CHOICEBOX; |
---|
297 | changetext(node, _("Iwatch")); changename(node, "iwatch"); |
---|
298 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
299 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
300 | } |
---|
301 | |
---|
302 | if (mode == 4){ |
---|
303 | |
---|
304 | changetitle(aaf_config, "AAF autostart NETWORK"); |
---|
305 | |
---|
306 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
307 | node->type = CHOICEBOX; |
---|
308 | changetext(node, _("nfs server")); changename(node, "nfsserver"); |
---|
309 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
310 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
311 | |
---|
312 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
313 | node->type = CHOICEBOX; |
---|
314 | changetext(node, _("samba server")); changename(node, "sambaserver"); |
---|
315 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
316 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
317 | |
---|
318 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
319 | node->type = CHOICEBOX; |
---|
320 | changetext(node, _("scan wlan")); changename(node, "wlan"); |
---|
321 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
322 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
323 | } |
---|
324 | |
---|
325 | if (mode == 5){ |
---|
326 | |
---|
327 | changetitle(aaf_config, _("AAF autostart Child Safety")); |
---|
328 | |
---|
329 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
330 | node->type = CHOICEBOX; |
---|
331 | changetext(node, _("Parental")); changename(node, "Parental"); |
---|
332 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
333 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
334 | |
---|
335 | node = addlistbox(aaf_config, listbox, node, 1); |
---|
336 | node->type = INPUTBOXNUM; |
---|
337 | changetext(node, _("Pin")); changename(node, "Pin"); |
---|
338 | addchoicebox(node, "n", _("no")); |
---|
339 | if(getownconfig(node->name) != NULL) |
---|
340 | changeinput(node, getownconfig(node->name)); |
---|
341 | else |
---|
342 | changeinput(node, "0000"); |
---|
343 | |
---|
344 | } |
---|
345 | |
---|
346 | drawscreen(aaf_config, 0); |
---|
347 | tmp = listbox->select; |
---|
348 | |
---|
349 | while(1) |
---|
350 | { |
---|
351 | addscreenrc(aaf_config, tmp); |
---|
352 | rcret = waitrc(aaf_config, 0, 0); |
---|
353 | tmp = listbox->select; |
---|
354 | |
---|
355 | if(listbox->select != NULL) |
---|
356 | { |
---|
357 | addownconfigscreentmp(listbox->select->name, listbox->select); |
---|
358 | } |
---|
359 | |
---|
360 | if(rcret == getrcconfigint("rcexit", NULL)) { |
---|
361 | |
---|
362 | break; |
---|
363 | } |
---|
364 | if(rcret == getrcconfigint("rcgreen", NULL)) { |
---|
365 | writeownconfigtmp(); |
---|
366 | writeallconfig(1); |
---|
367 | break; |
---|
368 | } |
---|
369 | } |
---|
370 | |
---|
371 | delownconfigtmpall(); |
---|
372 | delmarkedscreennodes(aaf_config, 1); |
---|
373 | delownerrc(aaf_config); |
---|
374 | clearscreen(aaf_config); |
---|
375 | } |
---|
376 | |
---|
377 | #endif |
---|