Rev 7506 | Rev 7518 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7506 | Rev 7515 | ||
---|---|---|---|
Line 707... | Line 707... | ||
707 | void Line_ReDraw(dword bgcol, filenum){ |
707 | void Line_ReDraw(dword bgcol, filenum){ |
708 | dword text_col=0, |
708 | dword text_col=0, |
709 | ext1, attr, |
709 | ext1, attr, |
710 | file_offet, |
710 | file_offet, |
711 | file_name_off, |
711 | file_name_off, |
- | 712 | file_size=0, |
|
712 | y=filenum*files.item_h+files.y, |
713 | y=filenum*files.item_h+files.y, |
713 | icon_y = files.item_h-icon_size/2+1+y; |
714 | icon_y = files.item_h-icon_size/2+1+y; |
714 | BDVK file; |
715 | BDVK file; |
715 | char temp_path[sizeof(file_path)]; |
716 | char temp_path[sizeof(file_path)]; |
716 | char label_file_name[4096]; |
717 | char label_file_name[4096]; |
Line 725... | Line 726... | ||
725 | attr = ESDWORD[file_offet]; |
726 | attr = ESDWORD[file_offet]; |
726 | file.selected = ESBYTE[file_offet+7]; |
727 | file.selected = ESBYTE[file_offet+7]; |
727 | file.sizelo = ESDWORD[file_offet+32]; |
728 | file.sizelo = ESDWORD[file_offet+32]; |
728 | file.sizehi = ESDWORD[file_offet+36]; |
729 | file.sizehi = ESDWORD[file_offet+36]; |
729 | file_name_off = file_offet+40; |
730 | file_name_off = file_offet+40; |
- | 731 | sprintf(#temp_path,"%s/%s",#path,file_name_off); |
|
Line 730... | Line 732... | ||
730 | 732 | ||
731 | if (! TestBit(attr, 4) ) //file or folder? |
733 | if (! TestBit(attr, 4) ) //file or folder? |
732 | { |
734 | { |
733 | ext1 = strrchr(file_name_off,'.') + file_name_off; |
735 | ext1 = strrchr(file_name_off,'.') + file_name_off; |
734 | if (ext1==file_name_off) ext1 = NULL; //if no extension then show nothing |
- | |
735 | WriteText( |
- | |
736 | 7-strlen(ConvertSize64(file.sizelo, file.sizehi))*6+files.x+files.w - 58, |
- | |
737 | files.text_y+y+1, |
- | |
738 | files.font_type, |
- | |
739 | 0, |
736 | if (ext1==file_name_off) ext1 = NULL; //if no extension then show nothing |
740 | ConvertSize64(file.sizelo, file.sizehi) |
- | |
741 | ); |
737 | file_size = ConvertSize64(file.sizelo, file.sizehi); |
742 | if (ext1) && (strlen(ext1)<9) WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, 0, ext1); |
738 | if (ext1) && (strlen(ext1)<9) WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, 0, ext1); |
743 | } |
739 | } |
744 | else |
740 | else |
745 | { |
741 | { |
746 | if (!strcmp(file_name_off,"..")) ext1=" |
742 | if (!strcmp(file_name_off,"..")) ext1=" |
747 | ext1=" |
743 | ext1=" |
748 | WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, 0, ext1); |
744 | WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, 0, ext1); |
- | 745 | } |
|
749 | } |
746 | if (chrnum(#path, '/')==1) file_size = GetDeviceSizeLabel(#temp_path); |
- | 747 | } |
|
750 | } |
748 | if (file_size) WriteText(7-strlen(file_size)*6+files.x+files.w-58, |
751 | sprintf(#temp_path,"%s/%s",#path,file_name_off); |
749 | files.text_y+y+1, files.font_type, 0, file_size); |
Line 752... | Line 750... | ||
752 | DrawIconByExtension(#temp_path, ext1, files.x+4, icon_y, bgcol); |
750 | DrawIconByExtension(#temp_path, ext1, files.x+4, icon_y, bgcol); |
753 | 751 | ||
754 | if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden? |
752 | if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden? |
Line 1165... | Line 1163... | ||
1165 | return; |
1163 | return; |
1166 | } |
1164 | } |
1167 | } |
1165 | } |
1168 | } |
1166 | } |
Line -... | Line 1167... | ||
- | 1167 | ||
- | 1168 | dword GetDeviceSizeLabel(dword path) |
|
- | 1169 | { |
|
- | 1170 | BDVK bdvk; |
|
- | 1171 | char cdname[8]; |
|
- | 1172 | if (ESBYTE[path+1] == '/') path++; |
|
- | 1173 | if (ESBYTE[path+1] == 'c') && (ESBYTE[path+2] == 'd') |
|
- | 1174 | && (ESBYTE[path+4] == 0) { |
|
- | 1175 | //hack for http://board.kolibrios.org/viewtopic.php?p=72293#p72279 |
|
- | 1176 | strcpy(#cdname, path); |
|
- | 1177 | strcat(#cdname, "/1"); |
|
- | 1178 | path = #cdname; |
|
- | 1179 | } |
|
- | 1180 | GetFileInfo(path, #bdvk); |
|
- | 1181 | return ConvertSize64(bdvk.sizelo, bdvk.sizehi); |
|
- | 1182 | } |
|
1169 | 1183 | ||
1170 | int GetRealFileCountInFolder(dword folder_path) |
1184 | int GetRealFileCountInFolder(dword folder_path) |
1171 | { |
1185 | { |
1172 | int fcount; |
1186 | int fcount; |