1 | #ifndef SETTINGS_AUTOSTART_H |
---|
2 | #define SETTINGS_AUTOSTART_H |
---|
3 | |
---|
4 | void screensettings_autostart_default() |
---|
5 | { |
---|
6 | int rcret = 0; |
---|
7 | struct skin* settings_autostart = getscreen("settings_autostart_default"); |
---|
8 | struct skin* listbox = getscreennode(settings_autostart, "listbox"); |
---|
9 | struct skin* node = NULL; |
---|
10 | struct skin* tmp = NULL; |
---|
11 | |
---|
12 | addscreenrc(settings_autostart, listbox); |
---|
13 | listbox->aktline = 1; |
---|
14 | listbox->aktpage = 1; |
---|
15 | |
---|
16 | // int i = 0; |
---|
17 | // changetitletext(settings_autostart, _("Autostart Defaults")); |
---|
18 | |
---|
19 | if(file_exist("/etc/.usbimage")) |
---|
20 | { |
---|
21 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
22 | if(node != NULL) |
---|
23 | { |
---|
24 | node->type = CHOICEBOX; |
---|
25 | changetext(node, _("fsckroot")); changename(node, "fsckroot"); |
---|
26 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
27 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
28 | } |
---|
29 | } |
---|
30 | |
---|
31 | /* |
---|
32 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
33 | if(node != NULL) |
---|
34 | { |
---|
35 | node->type = CHOICEBOX; |
---|
36 | changetext(node, _("bootstop")); changename(node, "bootstop"); |
---|
37 | for(i=0; i <= 20; i++) |
---|
38 | { |
---|
39 | char* tmpnr = NULL; |
---|
40 | tmpnr = oitoa(i); |
---|
41 | addchoicebox(node, tmpnr, _(tmpnr)); |
---|
42 | free(tmpnr); tmpnr = NULL; |
---|
43 | } |
---|
44 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
45 | } |
---|
46 | */ |
---|
47 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
48 | if(node != NULL) |
---|
49 | { |
---|
50 | node->type = CHOICEBOX; |
---|
51 | changetext(node, _("debug")); changename(node, "debug"); |
---|
52 | addchoicebox(node, "high", _("high")); addchoicebox(node, "low", _("low")); |
---|
53 | addchoicebox(node, "off", _("off")); |
---|
54 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
55 | } |
---|
56 | |
---|
57 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
58 | if(node != NULL) |
---|
59 | { |
---|
60 | node->type = CHOICEBOX; |
---|
61 | changetext(node, _("showip")); changename(node, "showip"); |
---|
62 | addchoicebox(node, "status", _("status")); addchoicebox(node, "ip", _("ip")); |
---|
63 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
64 | } |
---|
65 | /* |
---|
66 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
67 | if(node != NULL) |
---|
68 | { |
---|
69 | node->type = CHOICEBOX; |
---|
70 | changetext(node, _("updatelist")); changename(node, "updatelist"); |
---|
71 | for(i=0; i <= 20; i++) |
---|
72 | { |
---|
73 | char* tmpnr = NULL; |
---|
74 | tmpnr = oitoa(i); |
---|
75 | addchoicebox(node, tmpnr, _(tmpnr)); |
---|
76 | free(tmpnr); tmpnr = NULL; |
---|
77 | } |
---|
78 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
79 | } |
---|
80 | */ |
---|
81 | |
---|
82 | drawscreen(settings_autostart, 0, 0); |
---|
83 | tmp = listbox->select; |
---|
84 | |
---|
85 | while(1) |
---|
86 | { |
---|
87 | addscreenrc(settings_autostart, tmp); |
---|
88 | rcret = waitrc(settings_autostart, 0, 0); |
---|
89 | tmp = listbox->select; |
---|
90 | |
---|
91 | if(listbox->select != NULL) |
---|
92 | { |
---|
93 | addownconfigscreentmp(listbox->select->name, listbox->select); |
---|
94 | } |
---|
95 | |
---|
96 | if(rcret == getrcconfigint("rcexit", NULL)) { |
---|
97 | |
---|
98 | break; |
---|
99 | } |
---|
100 | if(rcret == getrcconfigint("rcok", NULL)) { |
---|
101 | writeownconfigtmp(); |
---|
102 | writeallconfig(1); |
---|
103 | break; |
---|
104 | } |
---|
105 | } |
---|
106 | |
---|
107 | delownconfigtmpall(); |
---|
108 | delmarkedscreennodes(settings_autostart, 1); |
---|
109 | delownerrc(settings_autostart); |
---|
110 | clearscreen(settings_autostart); |
---|
111 | } |
---|
112 | |
---|
113 | void screensettings_autostart_audiovideo() |
---|
114 | { |
---|
115 | int rcret = 0; |
---|
116 | struct skin* settings_autostart = getscreen("settings_autostart_audiovideo"); |
---|
117 | struct skin* listbox = getscreennode(settings_autostart, "listbox"); |
---|
118 | struct skin* node = NULL; |
---|
119 | struct skin* tmp = NULL; |
---|
120 | |
---|
121 | addscreenrc(settings_autostart, listbox); |
---|
122 | listbox->aktline = 1; |
---|
123 | listbox->aktpage = 1; |
---|
124 | |
---|
125 | // changetitletext(settings_autostart, _("Autostart Defaults")); |
---|
126 | |
---|
127 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
128 | if(node != NULL) |
---|
129 | { |
---|
130 | node->type = CHOICEBOX; |
---|
131 | changetext(node, _("Bootlogo")); changename(node, "bootlogo"); |
---|
132 | addchoicebox(node, "y", _("yes")); addchoicebox(node, "n", _("no")); |
---|
133 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
134 | } |
---|
135 | |
---|
136 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
137 | if(node != NULL) |
---|
138 | { |
---|
139 | node->type = CHOICEBOX; |
---|
140 | changetext(node, _("Boot RGB Fix")); changename(node, "bootrgbfix"); |
---|
141 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
142 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
143 | } |
---|
144 | /* |
---|
145 | if(isfile("/var/bin/audio.elf") || isfile("/boot/audio.old.elf")) |
---|
146 | { |
---|
147 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
148 | if(node != NULL) |
---|
149 | { |
---|
150 | node->type = CHOICEBOX; |
---|
151 | changetext(node, _("Old Audiofw")); changename(node, "oldaudiofw"); |
---|
152 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
153 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
154 | } |
---|
155 | } |
---|
156 | */ |
---|
157 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
158 | if(node != NULL) |
---|
159 | { |
---|
160 | node->type = CHOICEBOX; |
---|
161 | changetext(node, _("No Audiosync")); changename(node, "noaudiosync"); |
---|
162 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
163 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
164 | } |
---|
165 | /* |
---|
166 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
167 | if(node != NULL) |
---|
168 | { |
---|
169 | node->type = CHOICEBOX; |
---|
170 | changetext(node, _("Boot Resolution")); changename(node, "BootResolution"); |
---|
171 | addchoicebox(node, "low", _("low")); addchoicebox(node, "high", _("high")); |
---|
172 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
173 | } |
---|
174 | |
---|
175 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
176 | if(node != NULL) |
---|
177 | { |
---|
178 | node->type = CHOICEBOX; |
---|
179 | changetext(node, _("Poweroff")); changename(node, "poweroff"); |
---|
180 | addchoicebox(node, "y", _("yes")); addchoicebox(node, "n", _("no")); |
---|
181 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
182 | } |
---|
183 | |
---|
184 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
185 | if(node != NULL) |
---|
186 | { |
---|
187 | node->type = CHOICEBOX; |
---|
188 | changetext(node, _("Scart On Standby")); changename(node, "scartonstandby"); |
---|
189 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
190 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
191 | } |
---|
192 | */ |
---|
193 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
194 | if(node != NULL) |
---|
195 | { |
---|
196 | node->type = CHOICEBOX; |
---|
197 | changetext(node, _("HighSR")); changename(node, "HighSR"); |
---|
198 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
199 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
200 | } |
---|
201 | |
---|
202 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
203 | if(node != NULL) |
---|
204 | { |
---|
205 | node->type = CHOICEBOX; |
---|
206 | changetext(node, _("swts")); changename(node, "swts"); |
---|
207 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
208 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
209 | } |
---|
210 | |
---|
211 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
212 | if(node != NULL) |
---|
213 | { |
---|
214 | node->type = CHOICEBOX; |
---|
215 | changetext(node, _("Cam Routing")); changename(node, "camrouting"); |
---|
216 | addchoicebox(node, "0", _("no")); addchoicebox(node, "1", _("yes")); |
---|
217 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
218 | } |
---|
219 | |
---|
220 | if(checkbox("UFS910") == 1) |
---|
221 | { |
---|
222 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
223 | if(node != NULL) |
---|
224 | { |
---|
225 | node->type = CHOICEBOX; |
---|
226 | changetext(node, _("useUnknown910")); changename(node, "useUnknown910"); |
---|
227 | addchoicebox(node, "1", _("yes")); addchoicebox(node, "0", _("no")); |
---|
228 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
229 | } |
---|
230 | } |
---|
231 | |
---|
232 | drawscreen(settings_autostart, 0, 0); |
---|
233 | tmp = listbox->select; |
---|
234 | |
---|
235 | while(1) |
---|
236 | { |
---|
237 | addscreenrc(settings_autostart, tmp); |
---|
238 | rcret = waitrc(settings_autostart, 0, 0); |
---|
239 | tmp = listbox->select; |
---|
240 | |
---|
241 | if(listbox->select != NULL) |
---|
242 | { |
---|
243 | addownconfigscreentmp(listbox->select->name, listbox->select); |
---|
244 | } |
---|
245 | |
---|
246 | if(rcret == getrcconfigint("rcexit", NULL)) { |
---|
247 | |
---|
248 | break; |
---|
249 | } |
---|
250 | if(rcret == getrcconfigint("rcok", NULL)) { |
---|
251 | writeownconfigtmp(); |
---|
252 | writeallconfig(1); |
---|
253 | break; |
---|
254 | } |
---|
255 | } |
---|
256 | |
---|
257 | delownconfigtmpall(); |
---|
258 | delmarkedscreennodes(settings_autostart, 1); |
---|
259 | delownerrc(settings_autostart); |
---|
260 | clearscreen(settings_autostart); |
---|
261 | } |
---|
262 | |
---|
263 | void screensettings_autostart_usb() |
---|
264 | { |
---|
265 | int rcret = 0; |
---|
266 | struct skin* settings_autostart = getscreen("settings_autostart_usb"); |
---|
267 | struct skin* listbox = getscreennode(settings_autostart, "listbox"); |
---|
268 | struct skin* node = NULL; |
---|
269 | struct skin* tmp = NULL; |
---|
270 | |
---|
271 | addscreenrc(settings_autostart, listbox); |
---|
272 | listbox->aktline = 1; |
---|
273 | listbox->aktpage = 1; |
---|
274 | |
---|
275 | int i = 0; |
---|
276 | int tmpsize = 0; |
---|
277 | |
---|
278 | // changetitletext(settings_autostart, _("Autostart USB")); |
---|
279 | |
---|
280 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
281 | if(node != NULL) |
---|
282 | { |
---|
283 | node->type = CHOICEBOX; |
---|
284 | changetext(node, _("Load Partition")); changename(node, "loadpartition"); |
---|
285 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
286 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
287 | } |
---|
288 | /* |
---|
289 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
290 | if(node != NULL) |
---|
291 | { |
---|
292 | node->type = CHOICEBOX; |
---|
293 | changetext(node, _("Fsck Record")); changename(node, "fsckrecord"); |
---|
294 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
295 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
296 | } |
---|
297 | */ |
---|
298 | |
---|
299 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
300 | if(node != NULL) |
---|
301 | { |
---|
302 | node->type = CHOICEBOX; |
---|
303 | changetext(node, _("Ntfs Write")); |
---|
304 | changename(node, "ntfs_write"); |
---|
305 | addchoicebox(node, "0", _("no")); |
---|
306 | addchoicebox(node, "1", _("ntfs-3g")); |
---|
307 | addchoicebox(node, "2", _("ntfsmount")); |
---|
308 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
309 | } |
---|
310 | |
---|
311 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
312 | if(node != NULL) |
---|
313 | { |
---|
314 | node->type = CHOICEBOX; |
---|
315 | changetext(node, _("Swap")); changename(node, "swap"); |
---|
316 | addchoicebox(node, "y", _("yes")); addchoicebox(node, "n", _("no")); |
---|
317 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
318 | } |
---|
319 | |
---|
320 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
321 | if(node != NULL) |
---|
322 | { |
---|
323 | node->type = CHOICEBOX; |
---|
324 | changetext(node, _("Swap Size")); changename(node, "swapsize"); |
---|
325 | tmpsize = 16384; |
---|
326 | for(i=0; i < 7; i++) |
---|
327 | { |
---|
328 | char* tmpnr = NULL; |
---|
329 | tmpnr = oitoa(tmpsize); |
---|
330 | addchoicebox(node, tmpnr, _(tmpnr)); |
---|
331 | free(tmpnr); tmpnr = NULL; |
---|
332 | tmpsize = tmpsize * 2; |
---|
333 | } |
---|
334 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
335 | } |
---|
336 | /* |
---|
337 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
338 | if(node != NULL) |
---|
339 | { |
---|
340 | node->type = CHOICEBOX; |
---|
341 | changetext(node, _("Fsck Swap")); changename(node, "fsckswap"); |
---|
342 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
343 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
344 | } |
---|
345 | |
---|
346 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
347 | if(node != NULL) |
---|
348 | { |
---|
349 | node->type = CHOICEBOX; |
---|
350 | changetext(node, _("Record Max Sectors")); changename(node, "RecordMaxSectors"); |
---|
351 | tmpsize = 80; |
---|
352 | for(i=0; i < 13; i++) |
---|
353 | { |
---|
354 | char* tmpnr = NULL; |
---|
355 | tmpnr = oitoa(tmpsize); |
---|
356 | addchoicebox(node, tmpnr, _(tmpnr)); |
---|
357 | free(tmpnr); tmpnr = NULL; |
---|
358 | tmpsize = tmpsize + 80; |
---|
359 | } |
---|
360 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
361 | } |
---|
362 | |
---|
363 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
364 | if(node != NULL) |
---|
365 | { |
---|
366 | node->type = CHOICEBOX; |
---|
367 | changetext(node, _("Swap Max Sectors")); changename(node, "SwapMaxSectors"); |
---|
368 | tmpsize = 80; |
---|
369 | for(i=0; i < 13; i++) |
---|
370 | { |
---|
371 | char* tmpnr = NULL; |
---|
372 | tmpnr = oitoa(tmpsize); |
---|
373 | addchoicebox(node, tmpnr, _(tmpnr)); |
---|
374 | free(tmpnr); tmpnr = NULL; |
---|
375 | tmpsize = tmpsize + 80; |
---|
376 | } |
---|
377 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
378 | } |
---|
379 | */ |
---|
380 | drawscreen(settings_autostart, 0, 0); |
---|
381 | tmp = listbox->select; |
---|
382 | |
---|
383 | while(1) |
---|
384 | { |
---|
385 | addscreenrc(settings_autostart, tmp); |
---|
386 | rcret = waitrc(settings_autostart, 0, 0); |
---|
387 | tmp = listbox->select; |
---|
388 | |
---|
389 | if(listbox->select != NULL) |
---|
390 | { |
---|
391 | addownconfigscreentmp(listbox->select->name, listbox->select); |
---|
392 | } |
---|
393 | |
---|
394 | if(rcret == getrcconfigint("rcexit", NULL)) { |
---|
395 | |
---|
396 | break; |
---|
397 | } |
---|
398 | if(rcret == getrcconfigint("rcok", NULL)) { |
---|
399 | writeownconfigtmp(); |
---|
400 | writeallconfig(1); |
---|
401 | break; |
---|
402 | } |
---|
403 | } |
---|
404 | |
---|
405 | delownconfigtmpall(); |
---|
406 | delmarkedscreennodes(settings_autostart, 1); |
---|
407 | delownerrc(settings_autostart); |
---|
408 | clearscreen(settings_autostart); |
---|
409 | } |
---|
410 | |
---|
411 | void screensettings_autostart_emu() |
---|
412 | { |
---|
413 | int rcret = 0; |
---|
414 | struct skin* settings_autostart = getscreen("settings_autostart_emu"); |
---|
415 | struct skin* listbox = getscreennode(settings_autostart, "listbox"); |
---|
416 | struct skin* node = NULL; |
---|
417 | struct skin* tmp = NULL; |
---|
418 | |
---|
419 | addscreenrc(settings_autostart, listbox); |
---|
420 | listbox->aktline = 1; |
---|
421 | listbox->aktpage = 1; |
---|
422 | |
---|
423 | // changetitletext(settings_autostart, _("Autostart EMU")); |
---|
424 | |
---|
425 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
426 | if(node != NULL) |
---|
427 | { |
---|
428 | node->type = CHOICEBOX; |
---|
429 | changetext(node, _("Emu Control")); changename(node, "emucontrol"); |
---|
430 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
431 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
432 | } |
---|
433 | |
---|
434 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
435 | if(node != NULL) |
---|
436 | { |
---|
437 | node->type = CHOICEBOX; |
---|
438 | changetext(node, _("ftdi")); changename(node, "ftdi"); |
---|
439 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
440 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
441 | } |
---|
442 | |
---|
443 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
444 | if(node != NULL) |
---|
445 | { |
---|
446 | node->type = CHOICEBOX; |
---|
447 | changetext(node, _("pl2303")); changename(node, "pl2303"); |
---|
448 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
449 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
450 | } |
---|
451 | |
---|
452 | drawscreen(settings_autostart, 0, 0); |
---|
453 | tmp = listbox->select; |
---|
454 | |
---|
455 | while(1) |
---|
456 | { |
---|
457 | addscreenrc(settings_autostart, tmp); |
---|
458 | rcret = waitrc(settings_autostart, 0, 0); |
---|
459 | tmp = listbox->select; |
---|
460 | |
---|
461 | if(listbox->select != NULL) |
---|
462 | { |
---|
463 | addownconfigscreentmp(listbox->select->name, listbox->select); |
---|
464 | } |
---|
465 | |
---|
466 | if(rcret == getrcconfigint("rcexit", NULL)) { |
---|
467 | |
---|
468 | break; |
---|
469 | } |
---|
470 | if(rcret == getrcconfigint("rcok", NULL)) { |
---|
471 | writeownconfigtmp(); |
---|
472 | writeallconfig(1); |
---|
473 | break; |
---|
474 | } |
---|
475 | } |
---|
476 | |
---|
477 | delownconfigtmpall(); |
---|
478 | delmarkedscreennodes(settings_autostart, 1); |
---|
479 | delownerrc(settings_autostart); |
---|
480 | clearscreen(settings_autostart); |
---|
481 | } |
---|
482 | |
---|
483 | void screensettings_autostart_safety() |
---|
484 | { |
---|
485 | int rcret = 0; |
---|
486 | struct skin* settings_autostart = getscreen("settings_autostart_safety"); |
---|
487 | struct skin* listbox = getscreennode(settings_autostart, "listbox"); |
---|
488 | struct skin* node = NULL; |
---|
489 | struct skin* tmp = NULL; |
---|
490 | |
---|
491 | addscreenrc(settings_autostart, listbox); |
---|
492 | listbox->aktline = 1; |
---|
493 | listbox->aktpage = 1; |
---|
494 | |
---|
495 | // changetitletext(settings_autostart, _("Autostart Child Safety")); |
---|
496 | |
---|
497 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
498 | if(node != NULL) |
---|
499 | { |
---|
500 | node->type = CHOICEBOX; |
---|
501 | changetext(node, _("Parental")); changename(node, "Parental"); |
---|
502 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
503 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
504 | } |
---|
505 | |
---|
506 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
507 | if(node != NULL) |
---|
508 | { |
---|
509 | node->type = INPUTBOXNUM; |
---|
510 | changetext(node, _("Pin")); changename(node, "Pin"); |
---|
511 | addchoicebox(node, "n", _("no")); |
---|
512 | if(getownconfig(node->name) != NULL) |
---|
513 | changeinput(node, getownconfig(node->name)); |
---|
514 | else |
---|
515 | changeinput(node, "0000"); |
---|
516 | } |
---|
517 | |
---|
518 | drawscreen(settings_autostart, 0, 0); |
---|
519 | tmp = listbox->select; |
---|
520 | |
---|
521 | while(1) |
---|
522 | { |
---|
523 | addscreenrc(settings_autostart, tmp); |
---|
524 | rcret = waitrc(settings_autostart, 0, 0); |
---|
525 | tmp = listbox->select; |
---|
526 | |
---|
527 | if(listbox->select != NULL) |
---|
528 | { |
---|
529 | addownconfigscreentmp(listbox->select->name, listbox->select); |
---|
530 | } |
---|
531 | |
---|
532 | if(rcret == getrcconfigint("rcexit", NULL)) { |
---|
533 | |
---|
534 | break; |
---|
535 | } |
---|
536 | if(rcret == getrcconfigint("rcok", NULL)) { |
---|
537 | writeownconfigtmp(); |
---|
538 | writeallconfig(1); |
---|
539 | break; |
---|
540 | } |
---|
541 | } |
---|
542 | |
---|
543 | delownconfigtmpall(); |
---|
544 | delmarkedscreennodes(settings_autostart, 1); |
---|
545 | delownerrc(settings_autostart); |
---|
546 | clearscreen(settings_autostart); |
---|
547 | } |
---|
548 | |
---|
549 | void screensettings_autostart_network() |
---|
550 | { |
---|
551 | int rcret = 0; |
---|
552 | struct skin* settings_autostart = getscreen("settings_autostart_network"); |
---|
553 | struct skin* listbox = getscreennode(settings_autostart, "listbox"); |
---|
554 | struct skin* node = NULL; |
---|
555 | struct skin* tmp = NULL; |
---|
556 | |
---|
557 | addscreenrc(settings_autostart, listbox); |
---|
558 | listbox->aktline = 1; |
---|
559 | listbox->aktpage = 1; |
---|
560 | |
---|
561 | // changetitletext(settings_autostart, "Autostart NETWORK"); |
---|
562 | |
---|
563 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
564 | if(node != NULL) |
---|
565 | { |
---|
566 | node->type = CHOICEBOX; |
---|
567 | changetext(node, _("nfs server")); changename(node, "nfsserver"); |
---|
568 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
569 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
570 | } |
---|
571 | |
---|
572 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
573 | if(node != NULL) |
---|
574 | { |
---|
575 | node->type = CHOICEBOX; |
---|
576 | changetext(node, _("samba server")); changename(node, "sambaserver"); |
---|
577 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
578 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
579 | } |
---|
580 | |
---|
581 | node = addlistbox(settings_autostart, listbox, node, 1); |
---|
582 | if(node != NULL) |
---|
583 | { |
---|
584 | node->type = CHOICEBOX; |
---|
585 | changetext(node, _("scan wlan")); changename(node, "wlan"); |
---|
586 | addchoicebox(node, "n", _("no")); addchoicebox(node, "y", _("yes")); |
---|
587 | setchoiceboxselection(node, getownconfig(node->name)); |
---|
588 | } |
---|
589 | |
---|
590 | drawscreen(settings_autostart, 0, 0); |
---|
591 | tmp = listbox->select; |
---|
592 | |
---|
593 | while(1) |
---|
594 | { |
---|
595 | addscreenrc(settings_autostart, tmp); |
---|
596 | rcret = waitrc(settings_autostart, 0, 0); |
---|
597 | tmp = listbox->select; |
---|
598 | |
---|
599 | if(listbox->select != NULL) |
---|
600 | { |
---|
601 | addownconfigscreentmp(listbox->select->name, listbox->select); |
---|
602 | } |
---|
603 | |
---|
604 | if(rcret == getrcconfigint("rcexit", NULL)) { |
---|
605 | |
---|
606 | break; |
---|
607 | } |
---|
608 | if(rcret == getrcconfigint("rcok", NULL)) { |
---|
609 | writeownconfigtmp(); |
---|
610 | writeallconfig(1); |
---|
611 | break; |
---|
612 | } |
---|
613 | } |
---|
614 | |
---|
615 | delownconfigtmpall(); |
---|
616 | delmarkedscreennodes(settings_autostart, 1); |
---|
617 | delownerrc(settings_autostart); |
---|
618 | clearscreen(settings_autostart); |
---|
619 | } |
---|
620 | |
---|
621 | #endif |
---|