From e1c7133e385785a50b6207b580a53331b813eb77 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 13 May 2018 16:06:20 +0000 Subject: [PATCH] Eolite 3.91: 1. fixed a critical issue in setElementSelectedFlag() function which could cause app crash after paste several elements 2. also deny copying in several cases (empty disk, ".." element) 3. fix regression: icon for a file without extension, not executable git-svn-id: svn://kolibrios.org@7278 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 2 +- programs/cmm/eolite/include/about.h | 2 +- programs/cmm/eolite/include/copy.h | 13 +++++++++++-- programs/cmm/eolite/include/fs.h | 4 +++- programs/cmm/eolite/include/gui.h | 15 ++------------- programs/cmm/eolite/include/icons.h | 2 +- programs/cmm/eolite/include/left_panel.h | 1 - programs/cmm/eolite/include/menu.h | 2 -- programs/cmm/eolite/include/progress_dialog.h | 2 +- programs/cmm/eolite/include/properties.h | 8 ++++---- programs/cmm/eolite/include/settings.h | 10 ++++------ programs/cmm/eolite/include/sorting.h | 1 - programs/cmm/eolite/include/translations.h | 4 ++-- 13 files changed, 30 insertions(+), 36 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index ec8feadc5..60783a4f8 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -550,7 +550,7 @@ void DrawFavButton(int x) void draw_window() { if (show_status_bar.checked) status_bar_h = STATUS_BAR_H; else status_bar_h = 0; - DefineAndDrawWindow(WinX+rand_n,WinY+rand_n,WinW,WinH,0x73,NULL,TITLE,0); + DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,TITLE,0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) return; if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; } diff --git a/programs/cmm/eolite/include/about.h b/programs/cmm/eolite/include/about.h index 5cd4522da..066135906 100644 --- a/programs/cmm/eolite/include/about.h +++ b/programs/cmm/eolite/include/about.h @@ -44,7 +44,7 @@ void about_dialog() DrawRectangle3D(0,154,about_form.cwidth,1,system.color.work_dark,system.color.work_light); WriteTextLines(7,163,0x90,system.color.work_text,"KolibriOS File Manager\nAuthors: Leency, Veliant\nPunk_Joker, Pavelyakov\n(c) 2008 - 2017",20); #ifdef LANG_RUS - DrawFlatButton(60,about_form.cheight-38,11,"ˆáâ®à¨ï ࠧࠡ®âª¨"); + DrawStandartCaptButton(60,about_form.cheight-38,11,"ˆáâ®à¨ï ࠧࠡ®âª¨"); #endif } } diff --git a/programs/cmm/eolite/include/copy.h b/programs/cmm/eolite/include/copy.h index 8b452455b..c72ee4989 100644 --- a/programs/cmm/eolite/include/copy.h +++ b/programs/cmm/eolite/include/copy.h @@ -8,7 +8,10 @@ enum {NOCUT, CUT}; void setElementSelectedFlag(dword n, int state) { dword selected_offset = file_mas[n]*304 + buf+32 + 7; ESBYTE[selected_offset] = state; - if (n==0) && (strncmp(file_mas[n]*304+buf+72,"..",2)==0) ESBYTE[selected_offset] = false; //do not selec ".." directory + if (n==0) && (strncmp(file_mas[n]*304+buf+72,"..",2)==0) { + ESBYTE[selected_offset] = false; //do not selec ".." directory + return; + } if (state==true) selected_count++; if (state==false) selected_count--; } @@ -27,7 +30,13 @@ void Copy(dword pcth, char cut) dword copy_buf_offset = 0; if (files.count<=0) return; //no files - if (selected_count==0) setElementSelectedFlag(files.cur_y, true); //no element selected by "insert", so we copy current element + + //if no element selected by "Insert" key, then we copy current element + if (!selected_count) + setElementSelectedFlag(files.cur_y, true); + + if (!selected_count) return; + size_buf = 4; for (i=0; i was a bug !!! But unfortunately pass away to sacrifice speed. + // In the process of recursive descent, memory must be allocated + // dynamically, because the static variable cause a fault!!! + // But unfortunately pass away to sacrifice speed. GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); filename = dirbuf+72; for (i=0; i200 this is only file actions, not supported by folders #ifdef LANG_RUS char *file_captions[] = { diff --git a/programs/cmm/eolite/include/progress_dialog.h b/programs/cmm/eolite/include/progress_dialog.h index 9305faebf..df81602b1 100644 --- a/programs/cmm/eolite/include/progress_dialog.h +++ b/programs/cmm/eolite/include/progress_dialog.h @@ -38,7 +38,7 @@ void DisplayOperationForm() DefineAndDrawWindow(Form.left+Form.width-200,Form.top+90,WIN_DIALOG_W,skin_height+WIN_DIALOG_H,0x34,system.color.work,title,0); GetProcessInfo(#Dialog_Form, SelfInfo); WriteText(45, 11, 0x90, system.color.work_text, message); - DrawFlatButton(Dialog_Form.cwidth - 105, copy_bar.top-2 , T_CANCEL_PASTE, T_ABORT_WINDOW_BUTTON); + DrawStandartCaptButton(Dialog_Form.cwidth - 105, copy_bar.top-2 , T_CANCEL_PASTE, T_ABORT_WINDOW_BUTTON); } } diff --git a/programs/cmm/eolite/include/properties.h b/programs/cmm/eolite/include/properties.h index ad62a7f36..7f80f22d5 100644 --- a/programs/cmm/eolite/include/properties.h +++ b/programs/cmm/eolite/include/properties.h @@ -143,8 +143,8 @@ void ShowConfirmQuestionPopin() DrawPopup(15,80,250,90,1,system.color.work, system.color.work_graph); WriteText(35, 102, 0x90, 0x000000, QUEST_1); WriteText(65, 117, 0x90, 0x000000, QUEST_2); - DrawFlatButton(62,138,301,T_YES); - DrawFlatButton(155,138,302,T_NO); + DrawStandartCaptButton(62,138,301,T_YES); + DrawStandartCaptButton(155,138,302,T_NO); } void GetSizeDir(dword way) @@ -314,8 +314,8 @@ void DrawPropertiesWindow() DefineAndDrawWindow(Form.left + 150,150,315,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0); GetProcessInfo(#settings_form, SelfInfo); - DrawFlatButton(settings_form.cwidth - 96, settings_form.cheight-34, 10, BTN_CLOSE); - DrawFlatButton(settings_form.cwidth -208, settings_form.cheight-34, 11, BTN_APPLY); + DrawStandartCaptButton(settings_form.cwidth - 96, settings_form.cheight-34, 10, BTN_CLOSE); + DrawStandartCaptButton(settings_form.cwidth -208, settings_form.cheight-34, 11, BTN_APPLY); WriteText(10, 78, 0x90, system.color.work_text, PR_T_DEST); edit_box_draw stdcall (#path_to_file_ed); diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index f0ecd2949..48827a1c1 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -31,8 +31,6 @@ ?define START_PATH " Start path: " #endif -int WinX, WinY, WinW, WinH; - char path_start[4096]; edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098, #path_start,0, 100000000000010b,0,0}; @@ -164,10 +162,10 @@ void LoadIniSettings() two_panels.checked = ini.GetInt("TwoPanels", false); kfont.size.pt = ini.GetInt("FontSize", 13); files.item_h = ini.GetInt("LineHeight", 19); - WinX = ini.GetInt("WinX", 200); - WinY = ini.GetInt("WinY", 50); - WinW = ini.GetInt("WinW", 550); - WinH = ini.GetInt("WinH", 506); + Form.left = ini.GetInt("WinX", 200); + Form.top = ini.GetInt("WinY", 50); + Form.width = ini.GetInt("WinW", 550); + Form.height = ini.GetInt("WinH", 506); ini.GetString("DefaultPath", #path, 4096, "/rd/1"); ini.GetString("DefaultPath", #path_start, 4096, "/rd/1"); path_start_ed.size = path_start_ed.pos = strlen(#path_start); diff --git a/programs/cmm/eolite/include/sorting.h b/programs/cmm/eolite/include/sorting.h index ce6964b2e..abe747df2 100644 --- a/programs/cmm/eolite/include/sorting.h +++ b/programs/cmm/eolite/include/sorting.h @@ -1,4 +1,3 @@ -//Áûñòðàÿ ñîðòèðîâêà. Leency 2008. void Sort_by_Size(int a, b) // äëÿ ïåðâîãî âûçîâà: a = 0, b = <ýëåìåíòîâ â ìàññèâå> - 1 { diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index 5753879e3..d40d28bac 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.9" -#define ABOUT_TITLE "EOLITE 3.9" +#define TITLE "Eolite File Manager v3.91" +#define ABOUT_TITLE "EOLITE 3.91" #ifdef LANG_RUS ?define T_FILE "” ©«"