1 | #ifndef SKINADJUST_H |
---|
2 | #define SKINADJUST_H |
---|
3 | |
---|
4 | void 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 | //hide picon path, set it fix to /mnt/swapextensions/usr/local/share/titan/picons |
---|
47 | piconpath->hidden = YES; |
---|
48 | addchoicebox(piconpath, "/mnt/swapextensions/usr/local/share/titan/picons", _("Flash (permanent)")); |
---|
49 | addchoicebox(piconpath, "/var/swap/usr/local/share/titan/picons", _("Stick or HDD")); |
---|
50 | addchoicebox(piconpath, "/var/usr/local/share/titan/picons", _("Flash (temporary)")); |
---|
51 | setchoiceboxselection(piconpath, getconfig("piconpath", NULL)); |
---|
52 | |
---|
53 | oleftoffset = getconfigint("fbleftoffset", NULL); |
---|
54 | orightoffset = getconfigint("fbrightoffset", NULL); |
---|
55 | otopoffset = getconfigint("fbtopoffset", NULL); |
---|
56 | obottomoffset = getconfigint("fbbottomoffset", NULL); |
---|
57 | |
---|
58 | addchoicebox(showrecfreesize, "0", _("no")); |
---|
59 | addchoicebox(showrecfreesize, "1", _("yes (Text in %)")); |
---|
60 | addchoicebox(showrecfreesize, "2", _("yes (Text in MB)")); |
---|
61 | setchoiceboxselection(showrecfreesize, getconfig("showrecfreesize", NULL)); |
---|
62 | |
---|
63 | addchoicebox(listboxselect, "0", _("press red")); |
---|
64 | |
---|
65 | drawscreen(skinadjust, 0, 0); |
---|
66 | addscreenrc(skinadjust, listbox); |
---|
67 | |
---|
68 | tmp = listbox->select; |
---|
69 | while(1) |
---|
70 | { |
---|
71 | int offsetchange = 0; |
---|
72 | addscreenrc(skinadjust, tmp); |
---|
73 | rcret = waitrc(skinadjust, 0, 0); |
---|
74 | tmp = listbox->select; |
---|
75 | |
---|
76 | addconfigscreencheck("fbleftoffset", leftoffset, "0"); |
---|
77 | if(status.leftoffset != getconfigint("fbleftoffset", NULL)) offsetchange = 1; |
---|
78 | status.leftoffset = getconfigint("fbleftoffset", NULL); |
---|
79 | |
---|
80 | addconfigscreencheck("fbrightoffset", rightoffset, "0"); |
---|
81 | if(status.rightoffset != getconfigint("fbrightoffset", NULL)) offsetchange = 1; |
---|
82 | status.rightoffset = getconfigint("fbrightoffset", NULL); |
---|
83 | |
---|
84 | addconfigscreencheck("fbtopoffset", topoffset, "0"); |
---|
85 | if(status.topoffset != getconfigint("fbtopoffset", NULL)) offsetchange = 1; |
---|
86 | status.topoffset = getconfigint("fbtopoffset", NULL); |
---|
87 | |
---|
88 | addconfigscreencheck("fbbottomoffset", bottomoffset, "0"); |
---|
89 | if(status.bottomoffset != getconfigint("fbbottomoffset", NULL)) offsetchange = 1; |
---|
90 | status.bottomoffset = getconfigint("fbbottomoffset", NULL); |
---|
91 | |
---|
92 | if(offsetchange == 1 && (ostrcmp(getconfig("av_mode3d", NULL), "sbs") == 0 || ostrcmp(getconfig("av_mode3d", NULL), "tab") == 0)) clearfball(); |
---|
93 | |
---|
94 | drawscreen(skinadjust, 0, 0); |
---|
95 | |
---|
96 | if(rcret == getrcconfigint("rcexit", NULL)) |
---|
97 | { |
---|
98 | addconfigint("fbleftoffset", oleftoffset); |
---|
99 | status.leftoffset = getconfigint("fbleftoffset", NULL); |
---|
100 | addconfigint("fbrightoffset", orightoffset); |
---|
101 | status.rightoffset = getconfigint("fbrightoffset", NULL); |
---|
102 | addconfigint("fbtopoffset", otopoffset); |
---|
103 | status.topoffset = getconfigint("fbtopoffset", NULL); |
---|
104 | addconfigint("fbbottomoffset", obottomoffset); |
---|
105 | status.bottomoffset = getconfigint("fbbottomoffset", NULL); |
---|
106 | clearfball(); |
---|
107 | break; |
---|
108 | } |
---|
109 | |
---|
110 | if(rcret == getrcconfigint("rcred", NULL)) |
---|
111 | { |
---|
112 | if(listbox->select != NULL && ostrcmp(listbox->select->name, "listboxselect") == 0) |
---|
113 | { |
---|
114 | long oldlistboxselectcol = convertcol("listboxselect"); |
---|
115 | char* tmpstr = screencolorpicker(getskinconfig("listboxselect", NULL), 0, 0, 0); |
---|
116 | if(tmpstr != NULL) |
---|
117 | addskinconfigtmp("listboxselect", tmpstr); |
---|
118 | if(oldlistboxselectcol != convertcol("listboxselect")) reboot = 1; |
---|
119 | drawscreen(skinadjust, 0, 0); |
---|
120 | } |
---|
121 | |
---|
122 | continue; |
---|
123 | } |
---|
124 | |
---|
125 | if(rcret == getrcconfigint("rcok", NULL)) |
---|
126 | { |
---|
127 | int oldfontsizeadjust = getskinconfigint("fontsizeadjust", NULL); |
---|
128 | addskinconfigscreencheck("fontsizeadjust", fontsizeadjust, "0"); |
---|
129 | if(oldfontsizeadjust != getskinconfigint("fontsizeadjust", NULL)) reboot = 1; |
---|
130 | |
---|
131 | addskinconfigscreencheck("listboxselecttype", listboxselecttype, "0"); |
---|
132 | status.listboxselecttype = getskinconfigint("listboxselecttype", NULL); |
---|
133 | addskinconfigscreencheck("osdtransparent", osdtransparent, "0"); |
---|
134 | setosdtransparent(getskinconfigint("osdtransparent", NULL)); |
---|
135 | addconfigscreen("piconpath", piconpath); |
---|
136 | addconfigscreencheck("showrecfreesize", showrecfreesize, "0"); |
---|
137 | status.showrecfreesize = getconfigint("showrecfreesize", NULL); |
---|
138 | |
---|
139 | /* |
---|
140 | if(listbox->select != NULL && ostrcmp(listbox->select->name, "piconpath") == 0) |
---|
141 | { |
---|
142 | clearscreen(skinadjust); |
---|
143 | ret = screendir(listbox->select->ret, "", NULL, NULL, NULL, NULL, 0, "SELECT", 0, NULL, 0, NULL, 0, 700, 0, 650, 0, 0); |
---|
144 | if(ret != NULL) |
---|
145 | changeinput(listbox->select, ret); |
---|
146 | free(ret); |
---|
147 | |
---|
148 | drawscreen(skinadjust, 0, 0); |
---|
149 | continue; |
---|
150 | } |
---|
151 | */ |
---|
152 | |
---|
153 | writeskinconfigtmp(); |
---|
154 | if(reboot == 1) |
---|
155 | { |
---|
156 | textbox(_("Message"), _("Receiver now reboot !!!"), _("OK"), getrcconfigint("rcok", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
157 | oshutdown(3, 0); |
---|
158 | } |
---|
159 | |
---|
160 | break; |
---|
161 | } |
---|
162 | } |
---|
163 | |
---|
164 | delskinconfigtmpall(); |
---|
165 | delownerrc(skinadjust); |
---|
166 | clearscreen(skinadjust); |
---|
167 | } |
---|
168 | |
---|
169 | #endif |
---|