source: titan/plugins/tithek/tithek_settings.h @ 42657

Last change on this file since 42657 was 42657, checked in by obi, 6 years ago

tithek enable decription view on rcinfo

File size: 7.5 KB
RevLine 
[17717]1#ifndef TITHEK_SETTINGS_H
2#define TITHEK_SETTINGS_H
3
4void screentithek_settings()
5{
6        int rcret = 0;
7        struct skin* tmp = NULL;
8
9        struct skin* tithek_settings = getscreen("tithek_settings");
10        struct skin* listbox = getscreennode(tithek_settings, "listbox");
11        struct skin* view = getscreennode(tithek_settings, "view");
[20365]12        struct skin* cover = getscreennode(tithek_settings, "cover");
[18016]13        struct skin* pay = getscreennode(tithek_settings, "pay");
[20247]14        struct skin* picratio = getscreennode(tithek_settings, "picratio");
[22712]15        struct skin* hidxxx = getscreennode(tithek_settings, "hidxxx");
[41465]16//      struct skin* amazon_user = getscreennode(tithek_settings, "amazon_user");
17//      struct skin* amazon_pass = getscreennode(tithek_settings, "amazon_pass");
[39391]18        struct skin* vk_user = getscreennode(tithek_settings, "vk_user");
19        struct skin* vk_pass = getscreennode(tithek_settings, "vk_pass");
[41939]20        struct skin* kinox_url = getscreennode(tithek_settings, "kinox_url");
[42124]21        struct skin* kinox_pic = getscreennode(tithek_settings, "kinox_pic");
22        struct skin* kinox_localhoster = getscreennode(tithek_settings, "kinox_localhoster");
23
[40199]24        struct skin* autoupdate = getscreennode(tithek_settings, "autoupdate");
[35352]25        struct skin* b3 = getscreennode(tithek_settings, "b3");
26        struct skin* b4 = getscreennode(tithek_settings, "b4");
[17717]27
[20365]28        addchoicebox(cover, "0", _("show auto entrys"));
29        addchoicebox(cover, "1", _("show 2 entrys"));
30        addchoicebox(cover, "2", _("show 6 entrys"));
31        addchoicebox(cover, "3", _("show 12 entrys")); 
32        addchoicebox(cover, "4", _("show 20 entrys"));
33        addchoicebox(cover, "5", _("show 30 entrys"));
[27312]34        addchoicebox(cover, "6", _("show in list"));
[42657]35//      addchoicebox(cover, "7", _("show description"));
[42641]36
[20365]37        setchoiceboxselection(cover, getconfig("tithek_cover", NULL));
38
[20247]39        addchoicebox(view, "0", _("show auto entrys"));
40        addchoicebox(view, "1", _("show 2 entrys"));
41        addchoicebox(view, "2", _("show 6 entrys"));
42        addchoicebox(view, "3", _("show 12 entrys"));   
43        addchoicebox(view, "4", _("show 20 entrys"));
44        addchoicebox(view, "5", _("show 30 entrys"));
[27312]45        addchoicebox(view, "6", _("show in list"));
[42657]46//      addchoicebox(view, "7", _("show description"));
[17717]47        setchoiceboxselection(view, getconfig("tithek_view", NULL));
48
[20247]49        addchoicebox(picratio, "0", _("no"));
50        addchoicebox(picratio, "1", _("yes")); 
51        setchoiceboxselection(picratio, getconfig("tithek_pic_ratio", NULL));
52
[18016]53        addchoicebox(pay, "0", _("no"));
54        addchoicebox(pay, "1", _("yes"));       
55        setchoiceboxselection(pay, getconfig("tithek_pay", NULL));
56
[22712]57        addchoicebox(hidxxx, "0", _("no"));
58        addchoicebox(hidxxx, "1", _("yes"));   
59        setchoiceboxselection(hidxxx, getconfig("tithek_hid_xxx", NULL));
60
[40195]61        addchoicebox(autoupdate, "0", _("no"));
62        addchoicebox(autoupdate, "1", _("yes"));       
63        setchoiceboxselection(autoupdate, getconfig("tithek_autoupdate", NULL));
[41465]64/*
[35286]65        changemask(amazon_user, "abcdefghijklmnopqrstuvwxyz");
[41939]66        if(getconfig("tithek_amazon_pass", NULL) == NULL)
67                changeinput(amazon_user, getconfig("tithek_amazon_user", NULL));
[35352]68        else
69                changeinput(amazon_user, "****");
[28637]70
[35286]71        changemask(amazon_pass, "abcdefghijklmnopqrstuvwxyz");
[41939]72        if(getconfig("tithek_amazon_pass", NULL) == NULL)
73                changeinput(amazon_pass, getconfig("tithek_amazon_pass", NULL));
[35352]74        else
75                changeinput(amazon_pass, "****");
[41465]76*/
[39391]77        changemask(vk_user, "abcdefghijklmnopqrstuvwxyz");
[41939]78        if(getconfig("tithek_vk_pass", NULL) == NULL)
79                changeinput(vk_user, getconfig("tithek_vk_user", NULL));
[39391]80        else
81                changeinput(vk_user, "****");
82
[41465]83        changemask(vk_pass, "abcdefghijklmnopqrstuvwxyz");
[41939]84        if(getconfig("tithek_vk_pass", NULL) == NULL)
85                changeinput(vk_pass, getconfig("tithek_vk_pass", NULL));
[39391]86        else
87                changeinput(vk_pass, "****");
88
[41939]89        changemask(kinox_url, "abcdefghijklmnopqrstuvwxyz");
90        changeinput(kinox_url, getconfig("tithek_kinox_url", NULL));
[41862]91
[42124]92        addchoicebox(kinox_pic, "0", _("no"));
93        addchoicebox(kinox_pic, "1", _("yes"));
94        setchoiceboxselection(kinox_pic, getconfig("tithek_kinox_pic", NULL));
95
96        addchoicebox(kinox_localhoster, "0", _("http"));
97        addchoicebox(kinox_localhoster, "1", _("https"));       
98        addchoicebox(kinox_localhoster, "2", _("cloudfare"));   
99        setchoiceboxselection(kinox_localhoster, getconfig("tithek_kinox_localhoster", NULL));
100
[41862]101        if(!file_exist("/mnt/swapextensions/etc/.codecpack") && !file_exist("/var/swap/etc/.codecpack") && !file_exist("/var/etc/.codecpack"))
[41939]102                kinox_url->hidden = YES;
[41862]103
[36083]104        b3->hidden = YES;
105        b4->hidden = YES;
106
[17717]107        drawscreen(tithek_settings, 0, 0);
108        addscreenrc(tithek_settings, listbox);
109
110        tmp = listbox->select;
111        while(1)
112        {
113                addscreenrc(tithek_settings, tmp);
114                rcret = waitrc(tithek_settings, 0, 0);
115                tmp = listbox->select;
116       
117                if(rcret == getrcconfigint("rcexit", NULL)) break;
118                if(rcret == getrcconfigint("rcok", NULL))
119                {
120                        addconfigscreencheck("tithek_view", view, NULL);
[20365]121                        addconfigscreencheck("tithek_cover", cover, NULL);
[18016]122                        addconfigscreencheck("tithek_pay", pay, NULL);
[20247]123                        addconfigscreencheck("tithek_pic_ratio", picratio, NULL);
[22712]124                        addconfigscreencheck("tithek_hid_xxx", hidxxx, NULL);
[40195]125                        addconfigscreencheck("tithek_autoupdate", autoupdate, NULL);
[41939]126                        addconfigscreen("tithek_kinox_url", kinox_url);
[42124]127                        addconfigscreencheck("tithek_kinox_pic", kinox_pic, NULL);
128                        addconfigscreencheck("tithek_kinox_localhoster", kinox_localhoster, NULL);
129
[41465]130/*
[35352]131                        if(amazon_user->ret != NULL && ostrcmp(amazon_user->ret, "****") != 0)
132                        {
133                                debug(99, "amazon_user: write");
134                                debug(99, "amazon_user: %s", amazon_user->ret);
[41939]135                                addconfigscreen("tithek_amazon_user", amazon_user);
[35352]136                        }
137                        else
138                        {
139                                debug(99, "amazon_user: skipped");
140                        }
141                        if(amazon_pass->ret != NULL && ostrcmp(amazon_pass->ret, "****") != 0)
142                        {
143                                debug(99, "amazon_pass: write");
144                                debug(99, "amazon_pass: %s", amazon_pass->ret);
[41939]145                                addconfigscreen("tithek_amazon_pass", amazon_pass);
[35352]146                        }
147                        else
148                        {
149                                debug(99, "amazon_pass: skipped");
150                        }
[41465]151*/
[39391]152                        if(vk_user->ret != NULL && ostrcmp(vk_user->ret, "****") != 0)
153                        {
154                                debug(99, "vk_user: write");
155                                debug(99, "vk_user: %s", vk_user->ret);
[41939]156                                addconfigscreen("tithek_vk_user", vk_user);
[39391]157                        }
158                        else
159                        {
160                                debug(99, "vk_user: skipped");
161                        }
162                        if(vk_pass->ret != NULL && ostrcmp(vk_pass->ret, "****") != 0)
163                        {
164                                debug(99, "vk_pass: write");
165                                debug(99, "vk_pass: %s", vk_pass->ret);
[41939]166                                addconfigscreen("tithek_vk_pass", vk_pass);
[39391]167                        }
168                        else
169                        {
170                                debug(99, "vk_pass: skipped");
171                        }
172
[35352]173                        writeallconfig(1);
174
[41465]175//                      debug(99, "amazon_user read: %s", getconfig("amazon_user", NULL));
176//                      debug(99, "amazon_pass read: %s", getconfig("amazon_pass", NULL));
[39391]177
[41939]178                        debug(99, "vk_user read: %s", getconfig("tithek_vk_user", NULL));
179                        debug(99, "vk_pass read: %s", getconfig("tithek_vk_pass", NULL));
[35352]180                       
[17717]181                        break;
182                }
183                else if(rcret == getrcconfigint("rcgreen", NULL))
184                {
185                        screenscreensaveradjust();
186                        drawscreen(tithek_settings, 0, 0);
[35352]187                }
188                else if(rcret == getrcconfigint("rcred", NULL))
189                {
190                        unlink("/mnt/network/cookies");
191                }
[36083]192
[41465]193                if(file_exist("/mnt/network/cookies") && (/*ostrcmp(listbox->select->name, "amazon_user") == 0 || ostrcmp(listbox->select->name, "amazon_pass") == 0 || */ostrcmp(listbox->select->name, "vk_user") == 0 || ostrcmp(listbox->select->name, "vk_pass") == 0))
[36083]194                        b4->hidden = NO;                       
195                else
196                        b4->hidden = YES;
197       
[41465]198                if(/*ostrcmp(listbox->select->name, "amazon_user") == 0 || ostrcmp(listbox->select->name, "amazon_pass") == 0 || */ostrcmp(listbox->select->name, "vk_user") == 0 || ostrcmp(listbox->select->name, "vk_pass") == 0)
[36083]199                        b3->hidden = NO;
200                else
201                        b3->hidden = YES;
202
203                drawscreen(tithek_settings, 0, 0);
[35352]204        }
[17717]205
206        delownerrc(tithek_settings);
207        clearscreen(tithek_settings);
208}
209
210#endif
Note: See TracBrowser for help on using the repository browser.