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

Last change on this file since 40119 was 39391, checked in by obi, 7 years ago

tithek fix nba full streams, user needed a https://vk.com acc and add to tithek_settings

File size: 5.9 KB
Line 
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");
12        struct skin* cover = getscreennode(tithek_settings, "cover");
13        struct skin* pay = getscreennode(tithek_settings, "pay");
14        struct skin* picratio = getscreennode(tithek_settings, "picratio");
15        struct skin* hidxxx = getscreennode(tithek_settings, "hidxxx");
16        struct skin* amazon_user = getscreennode(tithek_settings, "amazon_user");
17        struct skin* amazon_pass = getscreennode(tithek_settings, "amazon_pass");
18        struct skin* vk_user = getscreennode(tithek_settings, "vk_user");
19        struct skin* vk_pass = getscreennode(tithek_settings, "vk_pass");
20        struct skin* b3 = getscreennode(tithek_settings, "b3");
21        struct skin* b4 = getscreennode(tithek_settings, "b4");
22
23        addchoicebox(cover, "0", _("show auto entrys"));
24        addchoicebox(cover, "1", _("show 2 entrys"));
25        addchoicebox(cover, "2", _("show 6 entrys"));
26        addchoicebox(cover, "3", _("show 12 entrys")); 
27        addchoicebox(cover, "4", _("show 20 entrys"));
28        addchoicebox(cover, "5", _("show 30 entrys"));
29        addchoicebox(cover, "6", _("show in list"));
30        setchoiceboxselection(cover, getconfig("tithek_cover", NULL));
31
32        addchoicebox(view, "0", _("show auto entrys"));
33        addchoicebox(view, "1", _("show 2 entrys"));
34        addchoicebox(view, "2", _("show 6 entrys"));
35        addchoicebox(view, "3", _("show 12 entrys"));   
36        addchoicebox(view, "4", _("show 20 entrys"));
37        addchoicebox(view, "5", _("show 30 entrys"));
38        addchoicebox(view, "6", _("show in list"));
39        setchoiceboxselection(view, getconfig("tithek_view", NULL));
40
41        addchoicebox(picratio, "0", _("no"));
42        addchoicebox(picratio, "1", _("yes")); 
43        setchoiceboxselection(picratio, getconfig("tithek_pic_ratio", NULL));
44
45        addchoicebox(pay, "0", _("no"));
46        addchoicebox(pay, "1", _("yes"));       
47        setchoiceboxselection(pay, getconfig("tithek_pay", NULL));
48
49        addchoicebox(hidxxx, "0", _("no"));
50        addchoicebox(hidxxx, "1", _("yes"));   
51        setchoiceboxselection(hidxxx, getconfig("tithek_hid_xxx", NULL));
52
53        changemask(amazon_user, "abcdefghijklmnopqrstuvwxyz");
54        if(getconfig("amazon_pass", NULL) == NULL)
55                changeinput(amazon_user, getconfig("amazon_user", NULL));
56        else
57                changeinput(amazon_user, "****");
58
59        changemask(amazon_pass, "abcdefghijklmnopqrstuvwxyz");
60        if(getconfig("amazon_pass", NULL) == NULL)
61                changeinput(amazon_pass, getconfig("amazon_pass", NULL));
62        else
63                changeinput(amazon_pass, "****");
64
65        changemask(vk_user, "abcdefghijklmnopqrstuvwxyz");
66        if(getconfig("vk_pass", NULL) == NULL)
67                changeinput(vk_user, getconfig("vk_user", NULL));
68        else
69                changeinput(vk_user, "****");
70
71        changemask(amazon_pass, "abcdefghijklmnopqrstuvwxyz");
72        if(getconfig("vk_pass", NULL) == NULL)
73                changeinput(vk_pass, getconfig("vk_pass", NULL));
74        else
75                changeinput(vk_pass, "****");
76
77        b3->hidden = YES;
78        b4->hidden = YES;
79
80        drawscreen(tithek_settings, 0, 0);
81        addscreenrc(tithek_settings, listbox);
82
83        tmp = listbox->select;
84        while(1)
85        {
86                addscreenrc(tithek_settings, tmp);
87                rcret = waitrc(tithek_settings, 0, 0);
88                tmp = listbox->select;
89       
90                if(rcret == getrcconfigint("rcexit", NULL)) break;
91                if(rcret == getrcconfigint("rcok", NULL))
92                {
93                        addconfigscreencheck("tithek_view", view, NULL);
94                        addconfigscreencheck("tithek_cover", cover, NULL);
95                        addconfigscreencheck("tithek_pay", pay, NULL);
96                        addconfigscreencheck("tithek_pic_ratio", picratio, NULL);
97                        addconfigscreencheck("tithek_hid_xxx", hidxxx, NULL);
98                        if(amazon_user->ret != NULL && ostrcmp(amazon_user->ret, "****") != 0)
99                        {
100                                debug(99, "amazon_user: write");
101                                debug(99, "amazon_user: %s", amazon_user->ret);
102                                addconfigscreen("amazon_user", amazon_user);
103                        }
104                        else
105                        {
106                                debug(99, "amazon_user: skipped");
107                        }
108                        if(amazon_pass->ret != NULL && ostrcmp(amazon_pass->ret, "****") != 0)
109                        {
110                                debug(99, "amazon_pass: write");
111                                debug(99, "amazon_pass: %s", amazon_pass->ret);
112                                addconfigscreen("amazon_pass", amazon_pass);
113                        }
114                        else
115                        {
116                                debug(99, "amazon_pass: skipped");
117                        }
118                        if(vk_user->ret != NULL && ostrcmp(vk_user->ret, "****") != 0)
119                        {
120                                debug(99, "vk_user: write");
121                                debug(99, "vk_user: %s", vk_user->ret);
122                                addconfigscreen("vk_user", vk_user);
123                        }
124                        else
125                        {
126                                debug(99, "vk_user: skipped");
127                        }
128                        if(vk_pass->ret != NULL && ostrcmp(vk_pass->ret, "****") != 0)
129                        {
130                                debug(99, "vk_pass: write");
131                                debug(99, "vk_pass: %s", vk_pass->ret);
132                                addconfigscreen("vk_pass", vk_pass);
133                        }
134                        else
135                        {
136                                debug(99, "vk_pass: skipped");
137                        }
138
139                        writeallconfig(1);
140
141                        debug(99, "amazon_user read: %s", getconfig("amazon_user", NULL));
142                        debug(99, "amazon_pass read: %s", getconfig("amazon_pass", NULL));
143
144                        debug(99, "vk_user read: %s", getconfig("vk_user", NULL));
145                        debug(99, "vk_pass read: %s", getconfig("vk_pass", NULL));
146                       
147                        break;
148                }
149                else if(rcret == getrcconfigint("rcgreen", NULL))
150                {
151                        screenscreensaveradjust();
152                        drawscreen(tithek_settings, 0, 0);
153                }
154                else if(rcret == getrcconfigint("rcred", NULL))
155                {
156                        unlink("/mnt/network/cookies");
157                }
158
159                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))
160                        b4->hidden = NO;                       
161                else
162                        b4->hidden = YES;
163       
164                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)
165                        b3->hidden = NO;
166                else
167                        b3->hidden = YES;
168
169                drawscreen(tithek_settings, 0, 0);
170        }
171
172        delownerrc(tithek_settings);
173        clearscreen(tithek_settings);
174}
175
176#endif
Note: See TracBrowser for help on using the repository browser.