source: titan/titan/skinadjust.h @ 23360

Last change on this file since 23360 was 23360, checked in by nit, 11 years ago

fix

File size: 6.6 KB
Line 
1#ifndef SKINADJUST_H
2#define SKINADJUST_H
3
4void screenskinadjust()
5{
6        int rcret = 0, oleftoffset = 0, orightoffset = 0, otopoffset = 0, obottomoffset = 0, reboot = 0;
7        struct skin* skinadjust = getscreen("skinadjust");
8        struct skin* listbox = getscreennode(skinadjust, "listbox");
9        struct skin* fontsizeadjust = getscreennode(skinadjust, "fontsizeadjust");
10        struct skin* listboxselecttype = getscreennode(skinadjust, "listboxselecttype");
11        struct skin* osdtransparent = getscreennode(skinadjust, "osdtransparent");
12        struct skin* leftoffset = getscreennode(skinadjust, "leftoffset");
13        struct skin* rightoffset = getscreennode(skinadjust, "rightoffset");
14        struct skin* topoffset = getscreennode(skinadjust, "topoffset");
15        struct skin* bottomoffset = getscreennode(skinadjust, "bottomoffset");
16        struct skin* piconpath = getscreennode(skinadjust, "piconpath");
17        struct skin* showrecfreesize = getscreennode(skinadjust, "showrecfreesize");
18        struct skin* listboxselect = getscreennode(skinadjust, "listboxselect");
19        struct skin* tmp = NULL;
20        char* ret = NULL;
21
22        changeinput(fontsizeadjust, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n-15\n-14\n-13\n-12\n-11\n-10\n-9\n-8\n-7\n-6\n-5\n-4\n-3\n-2\n-1");
23        setchoiceboxselection(fontsizeadjust, getskinconfig("fontsizeadjust", NULL));
24
25        addchoicebox(listboxselecttype, "0", _("border"));
26        addchoicebox(listboxselecttype, "1", _("bar"));
27        addchoicebox(listboxselecttype, "2", _("text"));
28        addchoicebox(listboxselecttype, "3", _("picture"));
29        setchoiceboxselection(listboxselecttype, getskinconfig("listboxselecttype", NULL));
30       
31        changeinput(osdtransparent, "0\n5\n10\n15\n20\n25\n30\n35\n40\n45\n50\n55\n60\n65\n70");
32        setchoiceboxselection(osdtransparent, getskinconfig("osdtransparent", NULL));
33
34        changeinput(leftoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
35        setchoiceboxselection(leftoffset, getconfig("fbleftoffset", NULL));
36
37        changeinput(rightoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
38        setchoiceboxselection(rightoffset, getconfig("fbrightoffset", NULL));
39
40        changeinput(topoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
41        setchoiceboxselection(topoffset, getconfig("fbtopoffset", NULL));
42
43        changeinput(bottomoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
44        setchoiceboxselection(bottomoffset, getconfig("fbbottomoffset", NULL));
45
46  addchoicebox(piconpath, "/mnt/swapextensions/usr/local/share/titan/picons", _("Flash (permanent)"));
47        addchoicebox(piconpath, "/var/swap/usr/local/share/titan/picons", _("Stick or HDD"));
48        addchoicebox(piconpath, "/var/usr/local/share/titan/picons", _("Flash (temporary)"));
49        setchoiceboxselection(piconpath, getconfig("piconpath", NULL));
50
51        oleftoffset = getconfigint("fbleftoffset", NULL);
52        orightoffset = getconfigint("fbrightoffset", NULL);
53        otopoffset = getconfigint("fbtopoffset", NULL);
54        obottomoffset = getconfigint("fbbottomoffset", NULL);
55
56        addchoicebox(showrecfreesize, "0", _("no"));
57        addchoicebox(showrecfreesize, "1", _("yes (Text in %)"));
58        addchoicebox(showrecfreesize, "2", _("yes (Text in MB)"));
59        setchoiceboxselection(showrecfreesize, getconfig("showrecfreesize", NULL));
60       
61        addchoicebox(listboxselect, "0", _("press red"));
62
63        drawscreen(skinadjust, 0, 0);
64        addscreenrc(skinadjust, listbox);
65
66        tmp = listbox->select;
67        while(1)
68        {
69                int offsetchange = 0;
70                addscreenrc(skinadjust, tmp);
71                rcret = waitrc(skinadjust, 0, 0);
72                tmp = listbox->select;
73
74                addconfigscreencheck("fbleftoffset", leftoffset, "0");
75                if(status.leftoffset != getconfigint("fbleftoffset", NULL)) offsetchange = 1;
76                status.leftoffset = getconfigint("fbleftoffset", NULL);
77               
78                addconfigscreencheck("fbrightoffset", rightoffset, "0");
79                if(status.rightoffset != getconfigint("fbrightoffset", NULL)) offsetchange = 1;
80                status.rightoffset = getconfigint("fbrightoffset", NULL);
81               
82                addconfigscreencheck("fbtopoffset", topoffset, "0");
83                if(status.topoffset != getconfigint("fbtopoffset", NULL)) offsetchange = 1;
84                status.topoffset = getconfigint("fbtopoffset", NULL);
85               
86                addconfigscreencheck("fbbottomoffset", bottomoffset, "0");
87                if(status.bottomoffset != getconfigint("fbbottomoffset", NULL)) offsetchange = 1;
88                status.bottomoffset = getconfigint("fbbottomoffset", NULL);
89               
90                if(offsetchange == 1 && (ostrcmp(getconfig("av_mode3d", NULL), "sbs") == 0 || ostrcmp(getconfig("av_mode3d", NULL), "tab") == 0)) clearfball();
91               
92                drawscreen(skinadjust, 0, 0);
93
94                if(rcret == getrcconfigint("rcexit", NULL))
95                {
96                        addconfigint("fbleftoffset", oleftoffset);
97                        status.leftoffset = getconfigint("fbleftoffset", NULL);
98                        addconfigint("fbrightoffset", orightoffset);
99                        status.rightoffset = getconfigint("fbrightoffset", NULL);
100                        addconfigint("fbtopoffset", otopoffset);
101                        status.topoffset = getconfigint("fbtopoffset", NULL);
102                        addconfigint("fbbottomoffset", obottomoffset);
103                        status.bottomoffset = getconfigint("fbbottomoffset", NULL);
104                        clearfball();
105                        break;
106                }
107               
108                if(rcret == getrcconfigint("rcred", NULL))
109                {
110                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "listboxselect") == 0)
111                        {
112                                long oldlistboxselectcol = convertcol("listboxselect");
113                                char* tmpstr = screencolorpicker(getskinconfig("listboxselect", NULL), 0, 0, 0);
114                                if(tmpstr != NULL)
115                                        addskinconfigtmp("listboxselect", tmpstr);
116                                if(oldlistboxselectcol != convertcol("listboxselect")) reboot = 1;
117                                drawscreen(skinadjust, 0, 0);
118                        }
119                       
120                        continue;               
121                }
122
123                if(rcret == getrcconfigint("rcok", NULL))
124                {
125                        int oldfontsizeadjust = getskinconfigint("fontsizeadjust", NULL);
126                        addskinconfigscreencheck("fontsizeadjust", fontsizeadjust, "0");
127                        if(oldfontsizeadjust != getskinconfigint("fontsizeadjust", NULL)) reboot = 1;                   
128                       
129                        addskinconfigscreencheck("listboxselecttype", listboxselecttype, "0");
130                        status.listboxselecttype = getskinconfigint("listboxselecttype", NULL);
131                        addskinconfigscreencheck("osdtransparent", osdtransparent, "0");
132                        setosdtransparent(getskinconfigint("osdtransparent", NULL));
133                        addconfigscreen("piconpath", piconpath);
134                        addconfigscreencheck("showrecfreesize", showrecfreesize, "0");
135                        status.showrecfreesize = getconfigint("showrecfreesize", NULL);
136
137                        /*
138                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "piconpath") == 0)
139                        {
140                                clearscreen(skinadjust);
141                                ret = screendir(listbox->select->ret, "", NULL, NULL, NULL, NULL, 0, "SELECT", 0, NULL, 0, NULL, 0, 700, 0, 650, 0, 0);
142                                if(ret != NULL)
143                                        changeinput(listbox->select, ret);
144                                free(ret);
145
146                                drawscreen(skinadjust, 0, 0);
147                                continue;
148                        }
149                        */
150
151      writeskinconfigtmp();
152      if(reboot == 1)
153                        {
154                                textbox(_("Message"), _("Receiver now reboot !!!"), _("OK"), getrcconfigint("rcok", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0);
155                                oshutdown(3, 0);
156                        }
157     
158                        break;
159                }
160        }
161
162  delskinconfigtmpall();
163        delownerrc(skinadjust);
164        clearscreen(skinadjust);
165}
166
167#endif
Note: See TracBrowser for help on using the repository browser.