From ae17e1bd38e51672a89545726d02c14b69539ac3 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Fri, 25 Nov 2016 14:15:30 +0000 Subject: [PATCH] Eolite 3.35: autodetect apps, show app icons git-svn-id: svn://kolibrios.org@6757 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 4 +++- programs/cmm/eolite/include/icons.h | 10 +++++++++- programs/cmm/eolite/include/progress_dialog.h | 2 +- programs/cmm/eolite/include/properties.h | 16 +++++++++++----- programs/cmm/eolite/include/translations.h | 4 ++-- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 03005d387c..5f97ed9f07 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -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) diff --git a/programs/cmm/eolite/include/icons.h b/programs/cmm/eolite/include/icons.h index 8836760fa2..0714505b3a 100644 --- a/programs/cmm/eolite/include/icons.h +++ b/programs/cmm/eolite/include/icons.h @@ -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); diff --git a/programs/cmm/eolite/include/progress_dialog.h b/programs/cmm/eolite/include/progress_dialog.h index 3c2b7885cb..59a4e77fc1 100644 --- a/programs/cmm/eolite/include/progress_dialog.h +++ b/programs/cmm/eolite/include/progress_dialog.h @@ -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); diff --git a/programs/cmm/eolite/include/properties.h b/programs/cmm/eolite/include/properties.h index 3d47f980e7..8841ba25cd 100644 --- a/programs/cmm/eolite/include/properties.h +++ b/programs/cmm/eolite/include/properties.h @@ -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("", 18, 49, system.color.work); - else - DrawIconByExtension(#file_name2+strrchr(#file_name2,'.'), 18, 49, system.color.work); - + DrawIconByExtension(NULL, "", 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); diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index 7d9f614c59..1b453e04d6 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/translations.h @@ -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 "” ©«"