1 | #ifndef SCCONFIG_H
|
---|
2 | #define SCCONFIG_H
|
---|
3 |
|
---|
4 | void screenscconfig()
|
---|
5 | {
|
---|
6 | int rcret = 0, i = 0;
|
---|
7 | struct skin* scconfig = getscreen("scconfig");
|
---|
8 | struct skin* listbox = getscreennode(scconfig, "listbox");
|
---|
9 | struct skin* load = getscreen("loading");
|
---|
10 | struct dvbdev* dvbnode = NULL;
|
---|
11 | char* tmpstr = NULL, *tmpnr = NULL;
|
---|
12 | struct skin* tmp = NULL;
|
---|
13 |
|
---|
14 | listbox->aktline = 1;
|
---|
15 | listbox->aktpage = -1;
|
---|
16 |
|
---|
17 | start:
|
---|
18 | i = 0;
|
---|
19 | dvbnode = dvbdev;
|
---|
20 | tmp = NULL;
|
---|
21 | delmarkedscreennodes(scconfig, 1);
|
---|
22 |
|
---|
23 | while(dvbnode != NULL)
|
---|
24 | {
|
---|
25 | if(dvbnode->type == SCDEV)
|
---|
26 | {
|
---|
27 | i++;
|
---|
28 | tmp = addlistbox(scconfig, listbox, tmp, 1);
|
---|
29 | if(tmp != NULL)
|
---|
30 | {
|
---|
31 | tmpstr = ostrcat(tmpstr, _("Slot "), 1, 0);
|
---|
32 | tmpnr = oitoa(i);
|
---|
33 | tmpstr = ostrcat(tmpstr, tmpnr, 1, 1);
|
---|
34 | tmpstr = ostrcat(tmpstr, ": ", 1, 0);
|
---|
35 |
|
---|
36 | uint32_t status = 0;
|
---|
37 | dvbnode->fd = scopendirect(dvbnode->dev);
|
---|
38 | scgetiscardpresent(dvbnode, &status);
|
---|
39 | scclose(dvbnode, -1);
|
---|
40 |
|
---|
41 | if(status == 1)
|
---|
42 | tmpstr = ostrcat(tmpstr, _("card present"), 1, 0);
|
---|
43 | else
|
---|
44 | tmpstr = ostrcat(tmpstr, _("card not present"), 1, 0);
|
---|
45 |
|
---|
46 | changetext(tmp, tmpstr);
|
---|
47 | free(tmpstr); tmpstr = NULL;
|
---|
48 | tmp->height = listbox->fontsize + 2;
|
---|
49 | tmp->handle = (void*)dvbnode;
|
---|
50 | }
|
---|
51 | }
|
---|
52 | dvbnode = dvbnode->next;
|
---|
53 | }
|
---|
54 |
|
---|
55 | drawscreen(scconfig, 0, 0);
|
---|
56 | addscreenrc(scconfig, listbox);
|
---|
57 |
|
---|
58 | while(1)
|
---|
59 | {
|
---|
60 | rcret = waitrc(scconfig, 2000, 0);
|
---|
61 |
|
---|
62 | if(rcret == getrcconfigint("rcexit", NULL)) break;
|
---|
63 | if(rcret == getrcconfigint("rcok", NULL)) break;
|
---|
64 |
|
---|
65 | if(listbox->select != NULL && listbox->select->handle != NULL && rcret == getrcconfigint("rcred", NULL))
|
---|
66 | {
|
---|
67 | clearscreen(scconfig);
|
---|
68 | struct dvbdev *dvbtmp = ((struct dvbdev*)listbox->select->handle);
|
---|
69 | if(dvbtmp != NULL)
|
---|
70 | {
|
---|
71 | drawscreen(load, 0, 0);
|
---|
72 | dvbtmp->fd = scopendirect(dvbtmp->dev);
|
---|
73 | scsetreset(dvbtmp);
|
---|
74 | scclose(dvbtmp, -1);
|
---|
75 | clearscreen(load);
|
---|
76 | }
|
---|
77 | drawscreen(scconfig, 0, 0);
|
---|
78 | }
|
---|
79 |
|
---|
80 | if(rcret == RCTIMEOUT) goto start;
|
---|
81 | }
|
---|
82 |
|
---|
83 | delmarkedscreennodes(scconfig, 1);
|
---|
84 | delownerrc(scconfig);
|
---|
85 | clearscreen(scconfig);
|
---|
86 | }
|
---|
87 |
|
---|
88 | #endif
|
---|