1 | #ifndef MODULECONFIG_H
|
---|
2 | #define MODULECONFIG_H
|
---|
3 |
|
---|
4 | void createchannelslotlist(struct skin* channelslotlist, struct skin* listbox, int slot)
|
---|
5 | {
|
---|
6 | struct channelslot *node = channelslot;
|
---|
7 | struct skin* tmp = NULL;
|
---|
8 |
|
---|
9 | while(node != NULL)
|
---|
10 | {
|
---|
11 | if(node->slot == slot)
|
---|
12 | {
|
---|
13 | struct channel* chnode = getchannel(node->serviceid, node->transponderid);
|
---|
14 | if(chnode != NULL)
|
---|
15 | {
|
---|
16 | tmp = addlistbox(channelslotlist, listbox, tmp, 1);
|
---|
17 | if(tmp != NULL)
|
---|
18 | {
|
---|
19 | changetext(tmp, chnode->name);
|
---|
20 | tmp->handle = (char*)node;
|
---|
21 | }
|
---|
22 | }
|
---|
23 | }
|
---|
24 | node = node->next;
|
---|
25 | }
|
---|
26 | }
|
---|
27 |
|
---|
28 | void screenchannelslot(int slot)
|
---|
29 | {
|
---|
30 | int rcret = 0;
|
---|
31 | struct skin* channelslotlist = getscreen("channelslotlist");
|
---|
32 | struct skin* listbox = getscreennode(channelslotlist, "listbox");
|
---|
33 | char* tmpstr = NULL, *tmpchannellist = NULL;
|
---|
34 |
|
---|
35 | if(status.servicetype == 0)
|
---|
36 | tmpchannellist = ostrcat(getconfig("channellist", NULL), NULL, 0, 0);
|
---|
37 | else
|
---|
38 | tmpchannellist = ostrcat(getconfig("rchannellist", NULL), NULL, 0, 0);
|
---|
39 |
|
---|
40 | channelslotlist->aktline = 1;
|
---|
41 | channelslotlist->aktpage = -1;
|
---|
42 |
|
---|
43 | createchannelslotlist(channelslotlist, listbox, slot);
|
---|
44 |
|
---|
45 | drawscreen(channelslotlist, 0, 0);
|
---|
46 | addscreenrc(channelslotlist, listbox);
|
---|
47 |
|
---|
48 | while(1)
|
---|
49 | {
|
---|
50 | rcret = waitrc(channelslotlist, 0, 0);
|
---|
51 |
|
---|
52 | if(rcret == getrcconfigint("rcok", NULL)) break;
|
---|
53 | if(rcret == getrcconfigint("rcred", NULL) && listbox->select != NULL && listbox->select->handle != NULL)
|
---|
54 | {
|
---|
55 | if(delchannelslot(((struct channelslot*)listbox->select->handle)->serviceid, ((struct channelslot*)listbox->select->handle)->transponderid) == 0)
|
---|
56 | {
|
---|
57 | listbox->aktline--;
|
---|
58 | listbox->aktpage = -1;
|
---|
59 | delmarkedscreennodes(channelslotlist, 1);
|
---|
60 | createchannelslotlist(channelslotlist, listbox, slot);
|
---|
61 | drawscreen(channelslotlist, 0, 0);
|
---|
62 | }
|
---|
63 | }
|
---|
64 | if(rcret == getrcconfigint("rcgreen", NULL))
|
---|
65 | {
|
---|
66 | clearscreen(channelslotlist);
|
---|
67 | int saveservicetype = status.servicetype;
|
---|
68 | struct channel* tmpchnode = NULL;
|
---|
69 |
|
---|
70 | screenchannellist(&tmpchnode, &tmpchannellist, 1);
|
---|
71 | status.servicetype = saveservicetype;
|
---|
72 |
|
---|
73 | if(tmpchnode != NULL && getchannelslot(tmpchnode->serviceid, tmpchnode->transponderid) == NULL)
|
---|
74 | {
|
---|
75 | tmpstr = ostrcat(oitoa(tmpchnode->transponderid), "#", 1, 0);
|
---|
76 | tmpstr = ostrcat(tmpstr, ollutoa(tmpchnode->serviceid), 1, 1);
|
---|
77 | tmpstr = ostrcat(tmpstr, "#", 1, 0);
|
---|
78 | tmpstr = ostrcat(tmpstr, oitoa(slot), 1, 1);
|
---|
79 | if(addchannelslot(tmpstr, 1, NULL) != NULL)
|
---|
80 | {
|
---|
81 | delmarkedscreennodes(channelslotlist, 1);
|
---|
82 | createchannelslotlist(channelslotlist, listbox, slot);
|
---|
83 | }
|
---|
84 | free(tmpstr); tmpstr = NULL;
|
---|
85 | }
|
---|
86 |
|
---|
87 | drawscreen(channelslotlist, 0, 0);
|
---|
88 | }
|
---|
89 | if(rcret == getrcconfigint("rcyellow", NULL))
|
---|
90 | {
|
---|
91 | clearscreen(channelslotlist);
|
---|
92 | struct mainbouquet* mbouquet = screenmainbouquet();
|
---|
93 |
|
---|
94 | mainbouquet2channelslot(mbouquet, slot);
|
---|
95 | delmarkedscreennodes(channelslotlist, 1);
|
---|
96 | createchannelslotlist(channelslotlist, listbox, slot);
|
---|
97 |
|
---|
98 | drawscreen(channelslotlist, 0, 0);
|
---|
99 | }
|
---|
100 | }
|
---|
101 |
|
---|
102 | delmarkedscreennodes(channelslotlist, 1);
|
---|
103 | delownerrc(channelslotlist);
|
---|
104 | clearscreen(channelslotlist);
|
---|
105 | }
|
---|
106 |
|
---|
107 | void screenchannelslotdel(int slot)
|
---|
108 | {
|
---|
109 | int rcret = 0;
|
---|
110 | struct skin* channelslotlist = getscreen("channelslotlist");
|
---|
111 | struct skin* listbox = getscreennode(channelslotlist, "listbox");
|
---|
112 | struct skin* titeltext = getscreennode(channelslotlist, "titletext");
|
---|
113 | char* tmpstr = NULL, *tmpchannellist = NULL;
|
---|
114 |
|
---|
115 | changetext(titeltext, "exclude Sender");
|
---|
116 |
|
---|
117 | if(status.servicetype == 0)
|
---|
118 | tmpchannellist = ostrcat(getconfig("channellist", NULL), NULL, 0, 0);
|
---|
119 | else
|
---|
120 | tmpchannellist = ostrcat(getconfig("rchannellist", NULL), NULL, 0, 0);
|
---|
121 |
|
---|
122 | channelslotlist->aktline = 1;
|
---|
123 | channelslotlist->aktpage = -1;
|
---|
124 |
|
---|
125 | createchannelslotlist(channelslotlist, listbox, slot);
|
---|
126 |
|
---|
127 | drawscreen(channelslotlist, 0, 0);
|
---|
128 | addscreenrc(channelslotlist, listbox);
|
---|
129 |
|
---|
130 | while(1)
|
---|
131 | {
|
---|
132 | rcret = waitrc(channelslotlist, 0, 0);
|
---|
133 |
|
---|
134 | if(rcret == getrcconfigint("rcok", NULL)) break;
|
---|
135 | if(rcret == getrcconfigint("rcred", NULL) && listbox->select != NULL && listbox->select->handle != NULL)
|
---|
136 | {
|
---|
137 | if(delchannelslot(((struct channelslot*)listbox->select->handle)->serviceid, ((struct channelslot*)listbox->select->handle)->transponderid) == 0)
|
---|
138 | {
|
---|
139 | listbox->aktline--;
|
---|
140 | listbox->aktpage = -1;
|
---|
141 | delmarkedscreennodes(channelslotlist, 1);
|
---|
142 | createchannelslotlist(channelslotlist, listbox, slot);
|
---|
143 | drawscreen(channelslotlist, 0, 0);
|
---|
144 | }
|
---|
145 | }
|
---|
146 | if(rcret == getrcconfigint("rcgreen", NULL))
|
---|
147 | {
|
---|
148 | clearscreen(channelslotlist);
|
---|
149 | int saveservicetype = status.servicetype;
|
---|
150 | struct channel* tmpchnode = NULL;
|
---|
151 |
|
---|
152 | screenchannellist(&tmpchnode, &tmpchannellist, 1);
|
---|
153 | status.servicetype = saveservicetype;
|
---|
154 |
|
---|
155 | if(tmpchnode != NULL && getchannelslot(tmpchnode->serviceid, tmpchnode->transponderid) == NULL)
|
---|
156 | {
|
---|
157 | tmpstr = ostrcat(oitoa(tmpchnode->transponderid), "#", 1, 0);
|
---|
158 | tmpstr = ostrcat(tmpstr, ollutoa(tmpchnode->serviceid), 1, 1);
|
---|
159 | tmpstr = ostrcat(tmpstr, "#", 1, 0);
|
---|
160 | tmpstr = ostrcat(tmpstr, oitoa(slot), 1, 1);
|
---|
161 | if(addchannelslot(tmpstr, 1, NULL) != NULL)
|
---|
162 | {
|
---|
163 | delmarkedscreennodes(channelslotlist, 1);
|
---|
164 | createchannelslotlist(channelslotlist, listbox, slot);
|
---|
165 | }
|
---|
166 | free(tmpstr); tmpstr = NULL;
|
---|
167 | }
|
---|
168 |
|
---|
169 | drawscreen(channelslotlist, 0, 0);
|
---|
170 | }
|
---|
171 | if(rcret == getrcconfigint("rcyellow", NULL))
|
---|
172 | {
|
---|
173 | clearscreen(channelslotlist);
|
---|
174 | struct mainbouquet* mbouquet = screenmainbouquet();
|
---|
175 |
|
---|
176 | mainbouquet2channelslot(mbouquet, slot);
|
---|
177 | delmarkedscreennodes(channelslotlist, 1);
|
---|
178 | createchannelslotlist(channelslotlist, listbox, slot);
|
---|
179 |
|
---|
180 | drawscreen(channelslotlist, 0, 0);
|
---|
181 | }
|
---|
182 | }
|
---|
183 |
|
---|
184 | delmarkedscreennodes(channelslotlist, 1);
|
---|
185 | delownerrc(channelslotlist);
|
---|
186 | clearscreen(channelslotlist);
|
---|
187 | }
|
---|
188 |
|
---|
189 | int checkdoublecaid(struct dvbdev* excdvbnode, char* caid)
|
---|
190 | {
|
---|
191 | struct dvbdev* dvbnode = dvbdev;
|
---|
192 |
|
---|
193 | if(caid == NULL) return 0;
|
---|
194 |
|
---|
195 | while(dvbnode != NULL)
|
---|
196 | {
|
---|
197 | if(dvbnode->type == CIDEV && dvbnode->caslot != NULL && dvbnode->caslot->caids != NULL && dvbnode != excdvbnode)
|
---|
198 | {
|
---|
199 | if(ostrstr(dvbnode->caslot->caids, caid) != NULL)
|
---|
200 | return 1;
|
---|
201 |
|
---|
202 | }
|
---|
203 | dvbnode = dvbnode->next;
|
---|
204 | }
|
---|
205 | return 0;
|
---|
206 | }
|
---|
207 |
|
---|
208 | void screencaidlock(struct dvbdev* dvbnode)
|
---|
209 | {
|
---|
210 | int rcret = -1, count = 0, i = 0;
|
---|
211 | struct skin* caidlock = getscreen("caidlock");
|
---|
212 | struct skin* listbox = getscreennode(caidlock, "listbox");
|
---|
213 | struct skin* tmp = NULL;
|
---|
214 | char* tmpstr = NULL, *configname = NULL, *caids = NULL;
|
---|
215 | struct splitstr* ret = NULL;
|
---|
216 |
|
---|
217 | listbox->aktline = 1;
|
---|
218 | listbox->aktpage = -1;
|
---|
219 |
|
---|
220 | if(dvbnode == NULL || dvbnode->caslot == NULL || dvbnode->caslot->caids == NULL) return;
|
---|
221 |
|
---|
222 | configname = ostrcat("camblacklist_", oitoa(dvbnode->devnr), 0, 1);
|
---|
223 | char* lockcaids = getconfig(configname, NULL);
|
---|
224 |
|
---|
225 | caids = ostrcat(dvbnode->caslot->caids, NULL, 0, 0);
|
---|
226 | ret = strsplit(caids, "#", &count);
|
---|
227 |
|
---|
228 | if(ret != NULL)
|
---|
229 | {
|
---|
230 | for(i = 0; i < count; i++)
|
---|
231 | {
|
---|
232 | tmp = addlistbox(caidlock, listbox, tmp, 1);
|
---|
233 | if(tmp != NULL)
|
---|
234 | {
|
---|
235 | tmp->type = CHOICEBOX;
|
---|
236 |
|
---|
237 | // show caid in hex
|
---|
238 | char* caid_hex = ostrcat(ret[i].part, NULL, 0, 0);
|
---|
239 | int caid_dec = atoi(ret[i].part);
|
---|
240 | sprintf(caid_hex, "%x", caid_dec);
|
---|
241 |
|
---|
242 | if(checkdoublecaid(dvbnode, ret[i].part) == 1)
|
---|
243 | {
|
---|
244 | tmpstr = ostrcat(tmpstr, ret[i].part, 1, 0);
|
---|
245 | if(caid_hex != NULL)
|
---|
246 | {
|
---|
247 | tmpstr = ostrcat(tmpstr, " (0x", 1, 0);
|
---|
248 | tmpstr = ostrcat(tmpstr, caid_hex, 1, 0);
|
---|
249 | tmpstr = ostrcat(tmpstr, ") (", 1, 0);
|
---|
250 | }
|
---|
251 | else
|
---|
252 | tmpstr = ostrcat(tmpstr, " (", 1, 0);
|
---|
253 |
|
---|
254 | tmpstr = ostrcat(tmpstr, _("double"), 1, 0);
|
---|
255 | tmpstr = ostrcat(tmpstr, ")", 1, 0);
|
---|
256 | }
|
---|
257 | else
|
---|
258 | {
|
---|
259 | tmpstr = ostrcat(tmpstr, ret[i].part, 1, 0);
|
---|
260 | if(caid_hex != NULL)
|
---|
261 | {
|
---|
262 | tmpstr = ostrcat(tmpstr, " (0x", 1, 0);
|
---|
263 | tmpstr = ostrcat(tmpstr, caid_hex, 1, 0);
|
---|
264 | tmpstr = ostrcat(tmpstr, ")", 1, 0);
|
---|
265 | }
|
---|
266 | }
|
---|
267 | free(caid_hex);
|
---|
268 |
|
---|
269 | changetext(tmp, tmpstr);
|
---|
270 | free(tmpstr); tmpstr = NULL;
|
---|
271 |
|
---|
272 | addchoicebox(tmp, "0", _("activate"));
|
---|
273 | addchoicebox(tmp, "1", _("deactivate"));
|
---|
274 | if(ostrstr(lockcaids, ret[i].part) != NULL)
|
---|
275 | setchoiceboxselection(tmp, "1");
|
---|
276 | else
|
---|
277 | setchoiceboxselection(tmp, "0");
|
---|
278 | changename(tmp, ret[i].part);
|
---|
279 | }
|
---|
280 | }
|
---|
281 | }
|
---|
282 |
|
---|
283 | free(caids); caids = NULL;
|
---|
284 | free(ret); ret = NULL;
|
---|
285 | drawscreen(caidlock, 0, 0);
|
---|
286 | addscreenrc(caidlock, listbox);
|
---|
287 |
|
---|
288 | tmp = listbox->select;
|
---|
289 | while(1)
|
---|
290 | {
|
---|
291 | addscreenrc(caidlock, tmp);
|
---|
292 | rcret = waitrc(caidlock, 0, 0);
|
---|
293 | tmp = listbox->select;
|
---|
294 |
|
---|
295 | if(rcret == getrcconfigint("rcexit", NULL)) break;
|
---|
296 | if(rcret == getrcconfigint("rcok", NULL))
|
---|
297 | {
|
---|
298 | tmp = listbox;
|
---|
299 | while(tmp != NULL)
|
---|
300 | {
|
---|
301 | if(tmp->del == 1 && ostrcmp(tmp->ret, "1") == 0)
|
---|
302 | {
|
---|
303 | tmpstr = ostrcat(tmpstr, "#", 1, 0);
|
---|
304 | tmpstr = ostrcat(tmpstr, tmp->name, 1, 0);
|
---|
305 | tmpstr = ostrcat(tmpstr, "#", 1, 0);
|
---|
306 | }
|
---|
307 | tmp = tmp->next;
|
---|
308 | }
|
---|
309 |
|
---|
310 | if(tmpstr != NULL)
|
---|
311 | addconfig(configname, tmpstr);
|
---|
312 | else
|
---|
313 | delconfig(configname);
|
---|
314 |
|
---|
315 | free(tmpstr); tmpstr = NULL;
|
---|
316 | break;
|
---|
317 | }
|
---|
318 | }
|
---|
319 |
|
---|
320 | free(configname); configname = NULL;
|
---|
321 | delmarkedscreennodes(caidlock, 1);
|
---|
322 | delownerrc(caidlock);
|
---|
323 | clearscreen(caidlock);
|
---|
324 | }
|
---|
325 |
|
---|
326 | void screenmoduleadjust()
|
---|
327 | {
|
---|
328 | int rcret = 0;
|
---|
329 |
|
---|
330 | struct skin* moduleadjust = getscreen("moduleadjust");
|
---|
331 | struct skin* listbox = getscreennode(moduleadjust, "listbox");
|
---|
332 | struct skin* nocamsg = getscreennode(moduleadjust, "nocamsg");
|
---|
333 | struct skin* camwait = getscreennode(moduleadjust, "camwait");
|
---|
334 | struct skin* checkcamdecrypt = getscreennode(moduleadjust, "checkcamdecrypt");
|
---|
335 | struct skin* caskipprivat = getscreennode(moduleadjust, "caskipprivat");
|
---|
336 | struct skin* casendallcaids = getscreennode(moduleadjust, "casendallcaids");
|
---|
337 | struct skin* extmoduldetect = getscreennode(moduleadjust, "extmoduldetect");
|
---|
338 |
|
---|
339 | struct skin* tmp = NULL;
|
---|
340 |
|
---|
341 | if(checkbox("ATEMIO7600") == 1 || checkbox("ATEMIO510") == 1 || checkbox("ATEVIO700") == 1 || checkbox("ATEVIO7000") == 1 || checkbox("WHITEBOX") == 1 || checkbox("ATEMIO520") == 1 || checkbox("ATEMIO530") == 1)
|
---|
342 | extmoduldetect->hidden = NO;
|
---|
343 | else
|
---|
344 | extmoduldetect->hidden = YES;
|
---|
345 |
|
---|
346 | addchoicebox(nocamsg, "0", _("yes"));
|
---|
347 | addchoicebox(nocamsg, "1", _("no"));
|
---|
348 | setchoiceboxselection(nocamsg, getconfig("nocamsg", NULL));
|
---|
349 |
|
---|
350 | addchoicebox(camwait, "25", _("slow"));
|
---|
351 | addchoicebox(camwait, "15", _("middle"));
|
---|
352 | addchoicebox(camwait, "5", _("fast"));
|
---|
353 | setchoiceboxselection(camwait, getconfig("camwait", NULL));
|
---|
354 |
|
---|
355 | addchoicebox(checkcamdecrypt, "0", _("no"));
|
---|
356 | addchoicebox(checkcamdecrypt, "1", _("yes"));
|
---|
357 | setchoiceboxselection(checkcamdecrypt, getconfig("checkcamdecrypt", NULL));
|
---|
358 |
|
---|
359 | addchoicebox(caskipprivat, "0", _("no"));
|
---|
360 | addchoicebox(caskipprivat, "1", _("yes"));
|
---|
361 | setchoiceboxselection(caskipprivat, getconfig("caskipprivat", NULL));
|
---|
362 |
|
---|
363 | addchoicebox(casendallcaids, "0", _("no"));
|
---|
364 | addchoicebox(casendallcaids, "1", _("yes"));
|
---|
365 | setchoiceboxselection(casendallcaids, getconfig("casendallcaids", NULL));
|
---|
366 |
|
---|
367 | addchoicebox(extmoduldetect, "0", _("no"));
|
---|
368 | addchoicebox(extmoduldetect, "1", _("yes"));
|
---|
369 | setchoiceboxselection(extmoduldetect, getownconfig("extmoduldetect"));
|
---|
370 |
|
---|
371 | drawscreen(moduleadjust, 0, 0);
|
---|
372 | addscreenrc(moduleadjust, listbox);
|
---|
373 |
|
---|
374 | tmp = listbox->select;
|
---|
375 | while(1)
|
---|
376 | {
|
---|
377 | addscreenrc(moduleadjust, tmp);
|
---|
378 | rcret = waitrc(moduleadjust, 0, 0);
|
---|
379 | tmp = listbox->select;
|
---|
380 |
|
---|
381 | if(rcret == getrcconfigint("rcexit", NULL)) break;
|
---|
382 | if(rcret == getrcconfigint("rcok", NULL))
|
---|
383 | {
|
---|
384 | addconfigscreencheck("nocamsg", nocamsg, "0");
|
---|
385 | addconfigscreencheck("camwait", camwait, "25");
|
---|
386 | addconfigscreencheck("checkcamdecrypt", checkcamdecrypt, "0");
|
---|
387 | addconfigscreencheck("caskipprivat", caskipprivat, "0");
|
---|
388 | status.caskipprivat = getconfigint("caskipprivat", NULL);
|
---|
389 | addconfigscreencheck("casendallcaids", casendallcaids, "0");
|
---|
390 | status.casendallcaids = getconfigint("casendallcaids", NULL);
|
---|
391 |
|
---|
392 | if(checkbox("ATEMIO7600") == 1 || checkbox("ATEMIO510") == 1 || checkbox("ATEVIO700") == 1 || checkbox("ATEVIO7000") == 1 || checkbox("WHITEBOX") == 1 || checkbox("ATEMIO520") == 1 || checkbox("ATEMIO530") == 1)
|
---|
393 | {
|
---|
394 | if(extmoduldetect->ret != NULL)
|
---|
395 | addownconfig("extmoduldetect", extmoduldetect->ret);
|
---|
396 | }
|
---|
397 |
|
---|
398 | break;
|
---|
399 | }
|
---|
400 | }
|
---|
401 |
|
---|
402 | delownerrc(moduleadjust);
|
---|
403 | clearscreen(moduleadjust);
|
---|
404 | }
|
---|
405 |
|
---|
406 | void screenmoduleconfig()
|
---|
407 | {
|
---|
408 | int rcret = 0, i = 0, reset = 0, allready = 1;
|
---|
409 | struct skin* moduleconfig = getscreen("moduleconfig");
|
---|
410 | struct skin* listbox = getscreennode(moduleconfig, "listbox");
|
---|
411 | struct skin* b3 = getscreennode(moduleconfig, "b3");
|
---|
412 | struct skin* b4 = getscreennode(moduleconfig, "b4");
|
---|
413 | struct skin* b5 = getscreennode(moduleconfig, "b5");
|
---|
414 | struct skin* b6 = getscreennode(moduleconfig, "b6");
|
---|
415 | struct skin* load = getscreen("loading");
|
---|
416 | struct skin* tmp = NULL;
|
---|
417 | struct dvbdev* dvbnode = NULL;
|
---|
418 | char* tmpstr = NULL, *tmpnr = NULL;
|
---|
419 |
|
---|
420 | listbox->aktline = 1;
|
---|
421 | listbox->aktpage = -1;
|
---|
422 |
|
---|
423 | b3->usesavebg = 1;
|
---|
424 | b4->usesavebg = 1;
|
---|
425 | b5->usesavebg = 1;
|
---|
426 | b6->usesavebg = 1;
|
---|
427 |
|
---|
428 | start:
|
---|
429 | i = 0, allready = 1;
|
---|
430 | dvbnode = dvbdev;
|
---|
431 | tmp = NULL;
|
---|
432 | delmarkedscreennodes(moduleconfig, 1);
|
---|
433 |
|
---|
434 | while(dvbnode != NULL)
|
---|
435 | {
|
---|
436 | if(dvbnode->type == CIDEV)
|
---|
437 | {
|
---|
438 | i++;
|
---|
439 | tmp = addlistbox(moduleconfig, listbox, tmp, 1);
|
---|
440 | if(tmp != NULL)
|
---|
441 | {
|
---|
442 | tmpstr = ostrcat(tmpstr, _("Slot "), 1, 0);
|
---|
443 | tmpnr = oitoa(i);
|
---|
444 | tmpstr = ostrcat(tmpstr, tmpnr, 1, 1);
|
---|
445 | tmpstr = ostrcat(tmpstr, ": ", 1, 0);
|
---|
446 | if(dvbnode->caslot != NULL)
|
---|
447 | {
|
---|
448 | if(dvbnode->caslot->name == NULL || dvbnode->caslot->status == 0)
|
---|
449 | tmpstr = ostrcat(tmpstr, _("unknown"), 1, 0);
|
---|
450 | else
|
---|
451 | tmpstr = ostrcat(tmpstr, dvbnode->caslot->name, 1, 0);
|
---|
452 | }
|
---|
453 | tmpstr = ostrcat(tmpstr, "\n", 1, 0);
|
---|
454 | tmpstr = ostrcat(tmpstr, _("Status: "), 1, 0);
|
---|
455 | if(dvbnode->caslot != NULL)
|
---|
456 | {
|
---|
457 | if(dvbnode->caslot->status == 0 || dvbnode->caslot->status == 100)
|
---|
458 | tmpstr = ostrcat(tmpstr, _("empty"), 1, 0);
|
---|
459 | if(dvbnode->caslot->status == 1)
|
---|
460 | tmpstr = ostrcat(tmpstr, _("initializing"), 1, 0);
|
---|
461 | if(dvbnode->caslot->status == 2)
|
---|
462 | tmpstr = ostrcat(tmpstr, _("ready"), 1, 0);
|
---|
463 | }
|
---|
464 | if(dvbnode->caslot->status != 2) allready = 0;
|
---|
465 | changetext(tmp, tmpstr);
|
---|
466 | free(tmpstr); tmpstr = NULL;
|
---|
467 | tmp->height = (listbox->fontsize * 2) + (2 * 2);
|
---|
468 | tmp->type = TEXTBOX;
|
---|
469 | tmp->handle = (void*)dvbnode;
|
---|
470 | }
|
---|
471 | tmp = addlistbox(moduleconfig, listbox, tmp, 1);
|
---|
472 | if(tmp != NULL)
|
---|
473 | {
|
---|
474 | tmpstr = ostrcat(tmpstr, "camtype_", 1, 0);
|
---|
475 | tmpstr = ostrcat(tmpstr, oitoa(i - 1), 1, 1);
|
---|
476 | tmp->type = CHOICEBOX;
|
---|
477 | changetext(tmp, _("Module Type"));
|
---|
478 | addchoicebox(tmp, "0", _("Single Service"));
|
---|
479 | addchoicebox(tmp, "1", _("Multiple Service"));
|
---|
480 | setchoiceboxselection(tmp, getconfig(tmpstr, NULL));
|
---|
481 | changename(tmp, tmpstr);
|
---|
482 | free(tmpstr); tmpstr = NULL;
|
---|
483 | }
|
---|
484 | tmp = addlistbox(moduleconfig, listbox, tmp, 1);
|
---|
485 | if(tmp != NULL)
|
---|
486 | {
|
---|
487 | tmp->height = 20;
|
---|
488 | tmp->deaktivcol = 1;
|
---|
489 | }
|
---|
490 | }
|
---|
491 | dvbnode = dvbnode->next;
|
---|
492 | }
|
---|
493 | if(allready == 1) reset = 0;
|
---|
494 |
|
---|
495 |
|
---|
496 | clearscreen(load);
|
---|
497 | drawscreen(moduleconfig, 0, 0);
|
---|
498 | if(reset > 0)
|
---|
499 | {
|
---|
500 | reset--;
|
---|
501 | drawscreen(load, 0, 0);
|
---|
502 | }
|
---|
503 | addscreenrc(moduleconfig, listbox);
|
---|
504 |
|
---|
505 | tmp = listbox->select;
|
---|
506 | int count = 0;
|
---|
507 | while(1)
|
---|
508 | {
|
---|
509 | if(listbox->select != NULL && (listbox->select->type & CHOICEBOX))
|
---|
510 | addscreenrc(moduleconfig, tmp);
|
---|
511 | rcret = waitrc(moduleconfig, 2000, 0);
|
---|
512 | tmp = listbox->select;
|
---|
513 |
|
---|
514 | printf("listbox->select->text: %s\n",listbox->select->text);
|
---|
515 | printf("listbox->select->name: %s\n",listbox->select->name);
|
---|
516 |
|
---|
517 | if(listbox->select != NULL && listbox->select->handle != NULL && ostrstr(listbox->select->text, "Status: empty") == NULL)
|
---|
518 | // if(listbox->select != NULL && listbox->select->handle != NULL)
|
---|
519 | {
|
---|
520 | b3->hidden = NO;
|
---|
521 | b4->hidden = NO;
|
---|
522 | b5->hidden = NO;
|
---|
523 | b6->hidden = NO;
|
---|
524 | }
|
---|
525 | else
|
---|
526 | {
|
---|
527 | b3->hidden = YES;
|
---|
528 | b4->hidden = YES;
|
---|
529 | b5->hidden = YES;
|
---|
530 | b6->hidden = YES;
|
---|
531 | }
|
---|
532 | count++;
|
---|
533 | printf("count: %d\n",count);
|
---|
534 | printf("reset: %d\n",reset);
|
---|
535 |
|
---|
536 | clearscreen(load);
|
---|
537 | drawscreen(moduleconfig, 0, 0);
|
---|
538 | if(reset > 0) drawscreen(load, 0, 0);
|
---|
539 |
|
---|
540 | if(rcret == getrcconfigint("rcexit", NULL)) break;
|
---|
541 | if(rcret == getrcconfigint("rcok", NULL))
|
---|
542 | {
|
---|
543 | tmp = listbox;
|
---|
544 | while(tmp != NULL)
|
---|
545 | {
|
---|
546 | if(ostrncmp("camtype_", tmp->name, 8) == 0)
|
---|
547 | addconfigscreencheck(tmp->name, tmp, "0");
|
---|
548 | tmp = tmp->next;
|
---|
549 | }
|
---|
550 | break;
|
---|
551 | }
|
---|
552 | if(listbox->select != NULL && listbox->select->handle != NULL && rcret == getrcconfigint("rcred", NULL))
|
---|
553 | {
|
---|
554 | if(((struct dvbdev*)listbox->select->handle)->caslot != NULL)
|
---|
555 | {
|
---|
556 | ((struct dvbdev*)listbox->select->handle)->caslot->status = 100;
|
---|
557 | reset = 5;
|
---|
558 | drawscreen(load, 0, 0);
|
---|
559 | }
|
---|
560 | }
|
---|
561 | if(listbox->select != NULL && listbox->select->handle != NULL && rcret == getrcconfigint("rcgreen", NULL))
|
---|
562 | {
|
---|
563 | if((struct dvbdev*)listbox->select->handle != NULL)
|
---|
564 | {
|
---|
565 | drawscreen(load, 0, 0);
|
---|
566 | caappmenu((struct dvbdev*)listbox->select->handle);
|
---|
567 | sleep(7);
|
---|
568 | reset = 0;
|
---|
569 | }
|
---|
570 | }
|
---|
571 | if(listbox->select != NULL && listbox->select->handle != NULL && rcret == getrcconfigint("rcyellow", NULL))
|
---|
572 | {
|
---|
573 | if((struct dvbdev*)listbox->select->handle != NULL)
|
---|
574 | {
|
---|
575 | screencaidlock((struct dvbdev*)listbox->select->handle);
|
---|
576 | reset = 0;
|
---|
577 | }
|
---|
578 | }
|
---|
579 | if(listbox->select != NULL && listbox->select->handle != NULL && rcret == getrcconfigint("rcblue", NULL))
|
---|
580 | {
|
---|
581 | clearscreen(moduleconfig);
|
---|
582 | screenchannelslot(((struct dvbdev*)listbox->select->handle)->devnr);
|
---|
583 | drawscreen(moduleconfig, 0, 0);
|
---|
584 | }
|
---|
585 | if(listbox->select != NULL && listbox->select->handle != NULL && rcret == getrcconfigint("rc0", NULL))
|
---|
586 | {
|
---|
587 | clearscreen(moduleconfig);
|
---|
588 | screenchannelslotdel(5);
|
---|
589 | drawscreen(moduleconfig, 0, 0);
|
---|
590 | }
|
---|
591 | if(rcret == getrcconfigint("rcmenu", NULL))
|
---|
592 | {
|
---|
593 | screenmoduleadjust();
|
---|
594 | reset = 0;
|
---|
595 | drawscreen(moduleconfig, 0, 0);
|
---|
596 | }
|
---|
597 |
|
---|
598 | if(rcret == RCTIMEOUT) goto start;
|
---|
599 | }
|
---|
600 |
|
---|
601 | delmarkedscreennodes(moduleconfig, 1);
|
---|
602 | delownerrc(moduleconfig);
|
---|
603 | clearscreen(load);
|
---|
604 | clearscreen(moduleconfig);
|
---|
605 | }
|
---|
606 |
|
---|
607 | #endif
|
---|