source: titan/titan/moduleconfig.h @ 10994

Last change on this file since 10994 was 10877, checked in by nit, 12 years ago

[titan] change ca reset

File size: 2.1 KB
Line 
1#ifndef MODULECONFIG_H
2#define MODULECONFIG_H
3
4void screenmoduleconfig()
5{
6        int rcret = 0, i = 0;
7        struct skin* moduleconfig = getscreen("moduleconfig");
8        struct skin* listbox = getscreennode(moduleconfig, "listbox");
9        struct skin* tmp = NULL;
10        struct dvbdev* dvbnode = NULL;
11        char* tmpstr = NULL, *tmpnr = NULL;
12
13        listbox->aktline = 1;
14        listbox->aktpage = -1;
15
16start:
17        i = 0;
18        dvbnode = dvbdev;
19        tmp = NULL;
20        delmarkedscreennodes(moduleconfig, 1);
21
22        while(dvbnode != NULL)
23        {
24                if(dvbnode->type == CIDEV)
25                {
26                        i++;
27                        tmp = addlistbox(moduleconfig, listbox, tmp, 1);
28                        if(tmp != NULL)
29                        {
30                                tmpstr = ostrcat(tmpstr, _("Slot "), 1, 0);
31                                tmpnr = oitoa(i);
32                                tmpstr = ostrcat(tmpstr, tmpnr, 1, 1);
33                                tmpstr = ostrcat(tmpstr, ": ", 1, 0);
34                                if(dvbnode->caslot != NULL)
35                                {
36                                        if(dvbnode->caslot->name == NULL)
37                                                tmpstr = ostrcat(tmpstr, _("unknown"), 1, 0);
38                                        else
39                                                tmpstr = ostrcat(tmpstr, dvbnode->caslot->name, 1, 0);
40                                }
41                                tmpstr = ostrcat(tmpstr, "\n", 1, 0);
42                                tmpstr = ostrcat(tmpstr, _("Status: "), 1, 0);
43                                if(dvbnode->caslot != NULL)
44                                {
45                                        if(dvbnode->caslot->status == 0)
46                                                tmpstr = ostrcat(tmpstr, _("empty"), 1, 0);
47                                        if(dvbnode->caslot->status == 1)
48                                                tmpstr = ostrcat(tmpstr, _("initializing"), 1, 0);
49                                        if(dvbnode->caslot->status == 2)
50                                                tmpstr = ostrcat(tmpstr, _("ready"), 1, 0);
51                                }
52                                changetext(tmp, tmpstr);
53                                free(tmpstr); tmpstr = NULL;
54                                tmp->height = (listbox->fontsize * 2) + (2 * 2);
55                                tmp->type = TEXTBOX;
56                                tmp->handle = (void*)dvbnode;
57                        }
58                }
59                dvbnode = dvbnode->next;
60        }
61
62        drawscreen(moduleconfig, 0);
63        addscreenrc(moduleconfig, listbox);
64
65        while(1)
66        {
67                rcret = waitrc(moduleconfig, 2000, 0);
68
69                if(rcret == getrcconfigint("rcexit", NULL)) break;
70                if(rcret == getrcconfigint("rcok", NULL)) break;
71                if(listbox->select != NULL && listbox->select->handle != NULL && rcret == getrcconfigint("rcred", NULL))
72                {
73                        if(((struct dvbdev*)listbox->select->handle)->caslot != NULL)
74                                ((struct dvbdev*)listbox->select->handle)->caslot->status = 0;
75                }
76                if(rcret == RCTIMEOUT) goto start;
77        }
78
79        delmarkedscreennodes(moduleconfig, 1);
80        delownerrc(moduleconfig);
81        clearscreen(moduleconfig);
82}
83
84#endif
Note: See TracBrowser for help on using the repository browser.