Changeset 40893 for titan/plugins/tithek/tithek.h
- Timestamp:
- 09/02/17 21:42:56 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tithek/tithek.h
r40856 r40893 944 944 tmp->posx = posx; 945 945 946 printf("flag=%d\n", titheknode->flag); 947 printf("title=%s\n", titheknode->title); 948 printf("menutitle=%s\n", titheknode->menutitle); 949 printf("skin title=%s\n", title); 950 printf("titheklink=%s\n", titheklink); 951 946 debug(99, "--- START ----------------------------------------------------"); 952 947 if(title != NULL) 953 948 tmpstr1 = ostrcat(title, " - ", 0, 0); … … 955 950 tmpstr1 = ostrcat(titheknode->menutitle, " - ", 0, 0); 956 951 957 tmpstr2 = ostrcat(tmpstr1, titheknode->title, 0, 0); 958 959 printf("tmpstr2=%s\n", tmpstr2); 952 tmpstr1 = ostrcat(tmpstr1, titheknode->title, 1, 0); 953 954 // tmpstr2 = createfilename(tmpstr1, titheknode->menutitle); 955 tmpstr2 = createfilename(tmpstr1, NULL, 0); 956 int new = 0; 957 if(file_exist(tmpstr2)) 958 { 959 new = 1; 960 debug(99, "found oldfile %s", tmpstr2); 961 } 962 free(tmpstr2), tmpstr2 = NULL; 963 964 tmpstr2 = createfilename(tmpstr1, NULL, 1); 965 int fav = 0; 966 if(file_exist(tmpstr2)) 967 { 968 fav = 1; 969 debug(99, "found oldfav %s", tmpstr2); 970 } 971 free(tmpstr2), tmpstr2 = NULL; 972 960 973 free(tmpstr1), tmpstr1 = NULL; 961 free(tmpstr2), tmpstr2 = NULL; 962 963 char* title2 = ostrcat(titheknode->title, NULL, 0, 0); 964 char* filename = createfilename(tmpstr2, title2); 965 // char* filename = createfilename(tmpstr2, titheknode->title); 966 free(title2), title2 = NULL; 967 debug(99, "filename: %s", filename); 968 free(filename), filename = NULL; 969 970 971 if(python == 0 && titheknode->flag == 14) 972 tmp->fontcol = 0xff0000; 974 975 debug(99, "--- END -----------------------------------------------------"); 976 977 if(fav == 1) 978 // tmp->fontcol = 0x0091c9; //get favcol=0091c9 979 tmp->fontcol = convertcol("favcol"); 980 else if(new == 1) 981 tmp->fontcol = convertcol("green"); 982 else if(python == 0 && titheknode->flag == 14) 983 tmp->fontcol = convertcol("red"); 973 984 else if(python == 1 && titheknode->flag == 14) 974 tmp->fontcol = 0xffffff; 975 //tmp->fontcol = 0x00ff00; 985 tmp->fontcol = convertcol("white"); 976 986 else 977 tmp->fontcol = 0xffffff; 978 //tmp->fontcol = 0x0000ff; 987 tmp->fontcol = convertcol("white"); 979 988 980 989 tmp->halign = CENTER; … … 1021 1030 } 1022 1031 1032 //void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag) 1023 1033 void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag) 1024 1034 { 1035 1036 debug(99, "removefav title: %s", title); 1037 debug(99, "removefav menutitle: %s", menutitle); 1038 1025 1039 int count = 0, i = 0; 1026 char* tmpstr = NULL, *tmpstr1 = NULL, * input = NULL;1040 char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *input = NULL; 1027 1041 struct splitstr* ret = NULL; 1028 1042 … … 1053 1067 } 1054 1068 else 1069 { 1055 1070 printf("remove: %s\n", ret[i].part); 1071 1072 // tmpstr2 = createfilename(fullmenutitle, title, 1); 1073 tmpstr2 = createfilename(menutitle, title, 1); 1074 1075 debug(99, "tmpstr2: %s", tmpstr2); 1076 1077 if(file_exist(tmpstr2)) 1078 { 1079 unlink(tmpstr2); 1080 debug(99, "remove favorite color entry %s", tmpstr2); 1081 } 1082 free(tmpstr2), tmpstr2 = NULL; 1083 } 1056 1084 } 1057 1085 } … … 1078 1106 } 1079 1107 1108 //void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag) 1080 1109 void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag) 1081 1110 { … … 1126 1155 else 1127 1156 savefile = ostrcat(getconfig("tithek_fav", NULL), NULL, 0, 0); 1157 1158 // char* title2 = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0); 1159 // char* filename = createfilename(title, title2); 1160 // char* filename = createfilename(title, ((struct tithek*)listbox->select->handle)->title); 1161 1162 1163 // debug(99, "fullmenutitle: %s", fullmenutitle); 1164 debug(99, "menutitle: %s", menutitle); 1165 debug(99, "title: %s", title); 1166 1167 1168 tmpstr = createfilename(menutitle, title, 1); 1169 // tmpstr = createfilename(fullmenutitle, title, 1); 1170 1171 debug(99, "tmpstr: %s", tmpstr); 1172 1173 if(!file_exist(tmpstr)) 1174 { 1175 writesys(tmpstr, "1", 0); 1176 debug(99, "add favorite color entry %s", tmpstr); 1177 } 1178 free(tmpstr), tmpstr = NULL; 1128 1179 1129 1180 input = ostrcat(input, title, 1, 0); … … 1179 1230 } 1180 1231 1232 //void editfav(char* title, char* link, char* pic, char* localname, char* menutitle, char* fullmenutitle, int flag) 1181 1233 void editfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag) 1182 1234 { … … 1217 1269 { 1218 1270 drawscreen(load, 0, 0); 1271 // addfav(skin_title->ret, skin_link->ret, skin_pic->ret, skin_localname->ret, skin_menutitle->ret, fullmenutitle, atoi(skin_type->ret)); 1219 1272 addfav(skin_title->ret, skin_link->ret, skin_pic->ret, skin_localname->ret, skin_menutitle->ret, atoi(skin_type->ret)); 1220 1273 clearscreen(load); … … 1609 1662 { 1610 1663 char* title2 = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0); 1611 char* filename = createfilename(title, title2 );1664 char* filename = createfilename(title, title2, 0); 1612 1665 // char* filename = createfilename(title, ((struct tithek*)listbox->select->handle)->title); 1613 1666 free(title2), title2 = NULL; 1614 1667 debug(99, "filename: %s", filename); 1668 1669 if(!file_exist(filename)) 1670 { 1671 writesys(filename, "1", 0); 1672 debug(99, "create newfile %s", filename); 1673 } 1615 1674 1616 1675 char* keyconf = NULL; … … 2523 2582 { 2524 2583 removefav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag); 2584 // removefav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, title, ((struct tithek*)listbox->select->handle)->flag); 2585 2525 2586 pagecount = createtithekplay(titheklink, grid, listbox, countlabel, title, 0); 2526 2587 if(pagecount == 0) return; … … 2538 2599 if(textbox(_("Message"), _("Add this link as Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 5, 0) == 1) 2539 2600 { 2540 addfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag); 2601 // addfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, title, ((struct tithek*)listbox->select->handle)->flag); 2602 addfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, title, ((struct tithek*)listbox->select->handle)->flag); 2541 2603 } 2542 2604 } … … 2550 2612 if(textbox(_("Message"), _("Edit this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 800, 200, 5, 0) == 1) 2551 2613 { 2614 // editfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, title, ((struct tithek*)listbox->select->handle)->flag); 2552 2615 editfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag); 2553 2616 pagecount = createtithekplay(titheklink, grid, listbox, countlabel, title, 0);
Note: See TracChangeset
for help on using the changeset viewer.