Eolite 3.35: autodetect apps, show app icons

git-svn-id: svn://kolibrios.org@6757 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2016-11-25 14:15:30 +00:00
parent 69d1122a04
commit ae17e1bd38
5 changed files with 26 additions and 10 deletions

View File

@ -666,6 +666,7 @@ void Line_ReDraw(dword bgcol, filenum){
y=filenum*files.item_h+files.y,
icon_y = files.item_h/2-7+y;
BDVK file;
char temp_path[sizeof(file_path)];
char label_file_name[4096];
if (filenum==-1) return;
DrawBar(files.x,y,3,files.item_h,bgcol);
@ -693,7 +694,8 @@ void Line_ReDraw(dword bgcol, filenum){
WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, 0, ext1);
}
}
DrawIconByExtension(ext1, files.x+3, icon_y, bgcol);
sprintf(#temp_path,"%s/%s",#path,file_name_off);
DrawIconByExtension(#temp_path, ext1, files.x+3, icon_y, bgcol);
if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden?
if (bgcol!=0xFFFfff)

View File

@ -27,8 +27,9 @@ char *ext[]={
"grf", 25,
0,0};
void DrawIconByExtension(dword extension, xx, yy, fairing_color)
void DrawIconByExtension(dword file_path, extension, xx, yy, fairing_color)
{
char BYTE_HEAD_FILE[4];
int i;
dword icon_n=0;
if (extension) for (i=0; ext[i]!=0; i+=2;)
@ -38,6 +39,13 @@ void DrawIconByExtension(dword extension, xx, yy, fairing_color)
icon_n = ext[i+1];
break;
}
}
else if (file_path)
{
//if (!strncmp(file_path, "/rd/1",5)) || (!strncmp(file_path, "/tmp",4)) {
ReadFile(0,4,#BYTE_HEAD_FILE,file_path);
IF(DSDWORD[#BYTE_HEAD_FILE]=='KCPK')||(DSDWORD[#BYTE_HEAD_FILE]=='UNEM') icon_n = 6;
//}
}
ficons_pal[0] = fairing_color;
PutPaletteImage(icon_n*16*15+#ficons,16,15,xx,yy,8,#ficons_pal);

View File

@ -57,7 +57,7 @@ void Operation_Draw_Progress(dword filename) {
}
copy_bar.width = Dialog_Form.cwidth-32 - 100;
DisplayOperationForm();
DrawIconByExtension(filename+strrchr(filename,'.'), 16, 19, system.color.work);
DrawIconByExtension(filename, filename+strrchr(filename,'.'), 16, 19, system.color.work);
DrawBar(45, 32, Dialog_Form.cwidth-45, 15, system.color.work);
WriteText(45, 32, 0x90, 0x000000, filename);
progressbar_draw stdcall (#copy_bar);

View File

@ -345,6 +345,8 @@ void properties_dialog()
void DrawPropertiesWindow()
{
dword ext1;
char temp_path[sizeof(file_path)];
DefineAndDrawWindow(Form.left + 150,150,305,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0);
if ( !asm test path_to_file_ed.flags, 2)
{
@ -381,7 +383,7 @@ void DrawPropertiesWindow()
if (selected_count)
{
DrawIconByExtension(NULL, 18, 49, system.color.work);
DrawIconByExtension(NULL, NULL, 18, 49, system.color.work);
sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count);
WriteText(50, 49, 0x90, system.color.work_text, #folder_info);
sprintf(#element_size_label,"%s (%d %s)",ConvertSize(size_dir),size_dir,SET_BYTE_LANG);
@ -390,10 +392,14 @@ void DrawPropertiesWindow()
else
{
if ( file_info_general.isfolder )
DrawIconByExtension("<DIR>", 18, 49, system.color.work);
else
DrawIconByExtension(#file_name2+strrchr(#file_name2,'.'), 18, 49, system.color.work);
DrawIconByExtension(NULL, "<DIR>", 18, 49, system.color.work);
else {
sprintf(#temp_path,"%s/%s",#path,#file_name2);
debugln(#temp_path);
ext1 = strrchr(#file_name2,'.');
if (ext1) ext1 += #file_name2;
DrawIconByExtension(#temp_path, ext1, 18, 49, system.color.work);
}
WriteText(50, 40, 0x90, system.color.work_text, PR_T_NAME);
edit_box_draw stdcall (#file_name_ed);

View File

@ -1,5 +1,5 @@
#define TITLE "Eolite File Manager v3.72"
#define ABOUT_TITLE "EOLITE 3.72"
#define TITLE "Eolite File Manager v3.75"
#define ABOUT_TITLE "EOLITE 3.75"
#ifdef LANG_RUS
?define T_FILE "” ©«"