diff --git a/data/Tupfile.lua b/data/Tupfile.lua index fb1f624476..b5e89da670 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -28,6 +28,7 @@ img_files = { {"UNIMG", PROGS .. "/fs/unimg/unimg"}, {"3D/HOUSE.3DS", "common/3d/house.3ds"}, {"File Managers/ICONS.INI", "common/File Managers/icons.ini"}, + {"File Managers/EFM", "common/File Managers/efm"}, {"File Managers/KFM.INI", "common/File Managers/kfm.ini"}, {"File Managers/FNAV/ABOUT.TXT", "common/File Managers/fNav/About.txt"}, {"File Managers/FNAV/FNAV", "common/File Managers/fNav/fNav.kex"}, diff --git a/data/common/File Managers/efm b/data/common/File Managers/efm new file mode 100644 index 0000000000..6e4e82b52e Binary files /dev/null and b/data/common/File Managers/efm differ diff --git a/data/common/icons16.png b/data/common/icons16.png index df2044fc6d..601fa85b49 100644 Binary files a/data/common/icons16.png and b/data/common/icons16.png differ diff --git a/data/common/settings/app.ini b/data/common/settings/app.ini index b0cd9ac0be..81a728bf47 100644 --- a/data/common/settings/app.ini +++ b/data/common/settings/app.ini @@ -4,8 +4,11 @@ last_folder= [Eolite] ShowDeviceName=1 -RealFileNamesCase=1 -InfoAfterCopy=0 +ShowStatusBar=1 +LineHeight=20 + +[EFM] +ShowDeviceName=1 ShowStatusBar=1 LineHeight=20 diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index afb596370a..9427a3dba3 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -3,8 +3,8 @@ // 70.5 - get volume info and label -#define TITLE "Eolite File Manager 4.51" -#define ABOUT_TITLE "EOLITE 4.51" +#define TITLE "Eolite File Manager 4.6" +#define ABOUT_TITLE "EOLITE 4.6" #ifndef AUTOBUILD #include "lang.h--" @@ -28,6 +28,7 @@ #include "../lib/obj/libimg.h" #include "../lib/patterns/history.h" +#include "../lib/patterns/toolbar_button.h" #include "imgs/images.h" @@ -74,6 +75,8 @@ struct Eolite_colors } col; dword waves_pal[256]; +bool efm = false; + int toolbar_buttons_x[7]={9,46,85,134,167,203}; bool active_about = false; @@ -163,31 +166,51 @@ void handle_param() //-p : just show file/folder properties dialog //-d : delete file/folder //-v : paste files/folder from clipboard - if (param) && (param[0]=='-') switch (param[1]) + dword p = #param; + if (param[0]=='/') && (param[1]=='E') && (param[2]=='F') && (param[3]=='M') { + efm = true; + p += 4; + if (param[4]==' ') p++; + } + + if (ESBYTE[p]=='\0') return; + + if (ESBYTE[p]=='-') switch (ESBYTE[p+1]) { case 'p': - strcpy(#file_path, #param + 3); + strcpy(#file_path, p + 3); itdir = dir_exists(#file_path); - strcpy(#file_name, #param + strrchr(#param, '/')); - param[strrchr(#param, '/')-1] = '\0'; - strcpy(#path, #param + 3); + strcpy(#file_name, p + strrchr(p, '/')); + ESBYTE[strrchr(p, '/')+p-1] = '\0'; + strcpy(#path, p + 3); properties_dialog(); ExitProcess(); - return; case 'd': - strcpy(#file_path, #param + 3); + strcpy(#file_path, p + 3); itdir = dir_exists(#file_path); DisplayOperationForm(DELETE_FLAG); DeleteSingleElement(); ExitProcess(); - return; case 'v': - cut_active = param[2] - '0'; - strcpy(#path, #param + 4); + cut_active = ESBYTE[p+2] - '0'; + strcpy(#path, p + 4); PasteThread(); ExitProcess(); - return; } + + if (ESBYTE[strlen(p)+p-1]=='/') ESBYTE[strlen(p)+p-1]=NULL; //no "/" at the end + + if (dir_exists(p)) { + strcpy(#path, p); + } else { + if (file_exists(p)) { + ESBYTE[strrchr(p, '/')+p-1] = '\0'; + strcpy(#path, p); + SelectFileByName(p+strlen(p)+1); + } else { + notify(T_NOTIFY_APP_PARAM_WRONG); + } + } } void main() @@ -195,35 +218,17 @@ void main() dword id; int old_cur_y; + handle_param(); + ESBYTE[0] = NULL; + rand_n = random(80); - load_libraries(); - + load_libraries(); + SetAppColors(); LoadIniSettings(); SystemDiscs.Get(); - handle_param(); - - ESBYTE[0] = NULL; - - if (param) - { - if (strlen(#param)>1) && (param[strlen(#param)-1]=='/') param[strlen(#param)-1]=NULL; //no "/" at the end - - if (dir_exists(#param)) { - strcpy(#path, #param); - } else { - if (file_exists(#param)) { - param[strrchr(#param, '/')-1] = '\0'; - strcpy(#path, #param); - SelectFileByName(#param+strlen(#param)+1); - } else { - notify(T_NOTIFY_APP_PARAM_WRONG); - } - } - } - Open_Dir(#path,ONLY_OPEN); strcpy(#inactive_path, #path); llist_copy(#files_inactive, #files); @@ -307,7 +312,7 @@ void main() //Scrooll if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) && (mouse.y2) return; if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; } - if (!two_panels.checked) && (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; } - if ( two_panels.checked) && (Form.width < 573) { MoveSize(OLD,OLD,573,OLD); return; } GetProcessInfo(#Form, SelfInfo); SetAppColors(); - ESDWORD[#toolbar_pal] = sc.work; - ESDWORD[#toolbar_pal+4] = MixColors(0, sc.work, 35); - PutPaletteImage(#toolbar, 246, 34, 0, 0, 8, #toolbar_pal); - DrawBar(127, 8, 1, 25, sc.work_graph); - for (i=0; i<3; i++) DefineHiddenButton(toolbar_buttons_x[i]+2,7,31-5,29-5,21+i); - for (i=3; i<6; i++) DefineHiddenButton(toolbar_buttons_x[i], 5,31, 29, 21+i); - DrawBar(246,0, Form.cwidth - 246, 34, sc.work); - DrawDot(Form.cwidth-17,12); - DrawDot(Form.cwidth-17,12+6); - DrawDot(Form.cwidth-17,12+12); - DefineHiddenButton(Form.cwidth-24,7,20,25,51+BT_NOFRAME); //dots + if (two_panels.checked) { + if (Form.width < 573) { MoveSize(OLD,OLD,573,OLD); return; } + DrawBar(0, 0, Form.cwidth, 34, sc.work); + #define PAD 7 + #define GAP_S 26+5 + #define GAP_B 26+14 + x.set(-GAP_S+8); + DrawTopPanelButton(21, x.inc(GAP_S), PAD, 30, false); + DrawTopPanelButton(22, x.inc(GAP_S), PAD, 31, false); + DrawTopPanelButton(23, x.inc(GAP_B), PAD, 01, false); + DrawTopPanelButton(24, x.inc(GAP_B), PAD, 55, false); + DrawTopPanelButton(25, x.inc(GAP_S), PAD, 20, false); + DrawTopPanelButton(26, x.inc(GAP_S), PAD, 56, false); + DrawTopPanelButton(51, Form.cwidth-GAP_S-PAD, PAD, -1, false); //burger menu + } else { + if (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; } + ESDWORD[#toolbar_pal] = sc.work; + ESDWORD[#toolbar_pal+4] = MixColors(0, sc.work, 35); + PutPaletteImage(#toolbar, 246, 34, 0, 0, 8, #toolbar_pal); + for (i=0; i<3; i++) DefineHiddenButton(toolbar_buttons_x[i]+2,7,31-5,29-5,21+i); + for (i=3; i<6; i++) DefineHiddenButton(toolbar_buttons_x[i], 5,31, 29, 21+i); + DrawBar(127, 8, 1, 25, sc.work_graph); + DrawBar(246,0, Form.cwidth - 246, 34, sc.work); + DrawDot(Form.cwidth-17,12); + DrawDot(Form.cwidth-17,12+6); + DrawDot(Form.cwidth-17,12+12); + DefineHiddenButton(Form.cwidth-24,7,20,25,51+BT_NOFRAME); //dots + } //main rectangles DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42-status_bar_h,sc.work_graph); DrawRectangle(0,39,Form.cwidth-1,-show_status_bar.checked*status_bar_h + Form.cheight - 40,col.work_gradient[4]); //bg @@ -597,7 +618,7 @@ void DrawList() word sorting_arrow_x; dword sorting_arrow_t = "\x19"; if (sort_desc) sorting_arrow_t = "\x18"; - DrawFlatButtonSmall(files.x, files.y-17, files.w - 141,16,31,T_FILE); + DrawFlatButtonSmall(files.x - efm, files.y-17,files.w-141+efm,16,31,T_FILE); DrawFlatButtonSmall(files.x + files.w - 141, files.y-17,73,16,32,T_TYPE); DrawFlatButtonSmall(files.x + files.w - 68, files.y-17,68,16,33,T_SIZE); DrawFlatButtonSmall(files.x + files.w, files.y-17,16,16, 0,"\x18"); diff --git a/programs/cmm/eolite/include/breadcrumbs.h b/programs/cmm/eolite/include/breadcrumbs.h index d66b269762..1eead2c8c3 100644 --- a/programs/cmm/eolite/include/breadcrumbs.h +++ b/programs/cmm/eolite/include/breadcrumbs.h @@ -2,6 +2,8 @@ PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0}; void DrawPathBar() { + PathShow.start_x = -efm*20 + 250; + PathShow.area_size_x = Form.cwidth-300; DrawBar(PathShow.start_x-3, PathShow.start_y-6, PathShow.area_size_x+3, 19, col.odd_line); DrawRectangle(PathShow.start_x-4,PathShow.start_y-7,PathShow.area_size_x+4,20,sc.work_graph); diff --git a/programs/cmm/eolite/include/copy_and_delete.h b/programs/cmm/eolite/include/copy_and_delete.h index 223e09d814..f02cd80efe 100644 --- a/programs/cmm/eolite/include/copy_and_delete.h +++ b/programs/cmm/eolite/include/copy_and_delete.h @@ -160,7 +160,6 @@ void PasteThread() path_offset += strlen(path_offset) + 1; } cut_active=false; - if (info_after_copy.checked) notify(INFO_AFTER_COPY); DialogExit(); } diff --git a/programs/cmm/eolite/include/gui.h b/programs/cmm/eolite/include/gui.h index 61fda060ad..8acc4e2578 100644 --- a/programs/cmm/eolite/include/gui.h +++ b/programs/cmm/eolite/include/gui.h @@ -10,15 +10,15 @@ void Scroll() { if (files.count<=0) { - sc_slider_y = sc_y; - sc_slider_h = sc_h - 1; + sc_slider_y = sc_y - 1; + sc_slider_h = sc_h + 1; } else { - sc_slider_y = files.first * sc_h / files.count + sc_y; - sc_slider_h = sc_h * files.visible - files.visible / files.count; - if (sc_slider_h < 20) sc_slider_h = 20; //minimal scroll width - if (sc_slider_h > sc_h-sc_slider_y+56) || (files.first+files.visible>=files.count) sc_slider_y= sc_y + sc_h - sc_slider_h - 1; //фы  сюы№°юую ёяшёър + sc_slider_y = files.first * sc_h / files.count + sc_y - 1; + sc_slider_h = sc_h * files.visible - files.visible / files.count + 2; + if (sc_slider_h < 20) sc_slider_h = 20; //minimal scroll height + if (sc_slider_h > sc_h-sc_slider_y+56) || (files.first+files.visible>=files.count) sc_slider_y= sc_y + sc_h - sc_slider_h; //фы  сюы№°юую ёяшёър } //slider DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,sc.work_graph); @@ -72,8 +72,8 @@ void DrawEolitePopup(dword b1_text, b2_text) int but_x; int popin_x = files.w - popin_w / 2 + files.x ; DrawPopup(popin_x, 160, popin_w, 95, 1, sc.work, sc.work_graph); - but_x = DrawStandartCaptButton(popin_x+23, 215, POPUP_BTN1, b1_text); - DrawStandartCaptButton(popin_x+23 + but_x, 215, POPUP_BTN2, b2_text); + DrawCaptButton(popin_x+23+000, 215, 100, 26, POPUP_BTN1, sc.button, sc.button_text, b1_text); + DrawCaptButton(popin_x+23+114, 215, 100, 26, POPUP_BTN2, sc.button, sc.button_text, b2_text); } void DrawDot(dword x,y) { diff --git a/programs/cmm/eolite/include/left_panel.h b/programs/cmm/eolite/include/left_panel.h index 00540ce96a..787f5604ec 100644 --- a/programs/cmm/eolite/include/left_panel.h +++ b/programs/cmm/eolite/include/left_panel.h @@ -174,8 +174,6 @@ void _SystemDiscs::Draw() if (two_panels.checked) { DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, DEV_H_HOR, 0xFFFFFF); - DefineButton(Form.cwidth - 23, draw_y+2, 17,16, 60+BT_HIDE, 0xCCCccc); - _PutImage(Form.cwidth - 21, draw_y+4, 14,13, 2*14*13*3+#factions); files.y = draw_y + DEV_H_HOR + 17; } else { DrawBar(draw_x+6, draw_y, 18, 1, 0xFFFfff); diff --git a/programs/cmm/eolite/include/menu.h b/programs/cmm/eolite/include/menu.h index ecc78ceaf5..e82770f4bf 100644 --- a/programs/cmm/eolite/include/menu.h +++ b/programs/cmm/eolite/include/menu.h @@ -26,7 +26,8 @@ char burger_menu_items[] = "Новое окно|Ctrl+N Открыть консоль|Ctrl+G Обновить папку|F5 -О программе|F1"; +Настройки|F10 +О программе"; #elif LANG_EST char file_actions[]= @@ -55,7 +56,8 @@ char burger_menu_items[] = "New window|Ctrl+N Open console here|Ctrl+G Vфrskenda|F5 -About|F1"; +Settings|F10 +About"; #else char file_actions[]= @@ -84,7 +86,8 @@ char burger_menu_items[] = "New window|Ctrl+N Open console here|Ctrl+G Refresh folder|F5 -About|F1"; +Settings|F10 +About"; #endif @@ -119,7 +122,8 @@ void EventMenuClick(dword _id) case 1: EventOpenNewEolite(); break; case 2: EventOpenConsoleHere(); break; case 3: EventRefreshDisksAndFolders(); break; - case 4: FnProcess(1); break; + case 4: FnProcess(10); break; + case 5: FnProcess(1); break; } active_menu = NULL; } diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index e4faef5406..090e158907 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -3,7 +3,6 @@ ?define TITLE_SETT "Настройки" ?define SHOW_DEVICE_CLASS "Выводить названия класса устройств" ?define SHOW_STATUS_BAR "Показывать статус бар" - ?define NOTIFY_COPY_END "Уведомлять о завершении копирования" ?define SHOW_BREADCRUMBS "Использовать 'хлебные крошки'" ?define BIG_ICONS "Использовать большие иконки" ?define USE_TWO_PANELS "Две панели" @@ -18,7 +17,6 @@ ?define TITLE_SETT "Settings" ?define SHOW_DEVICE_CLASS "Show device class name" ?define SHOW_STATUS_BAR "Show status bar" - ?define NOTIFY_COPY_END "Notify when copying finished" ?define SHOW_BREADCRUMBS "Show breadcrumbs" ?define BIG_ICONS "Big icons in list" ?define USE_TWO_PANELS "Two panels" @@ -39,7 +37,6 @@ more_less_box font_size = { NULL, 9, 22, FONT_SIZE_LABEL }; more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT }; checkbox show_dev_name = { SHOW_DEVICE_CLASS }; checkbox show_status_bar = { SHOW_STATUS_BAR }; -checkbox info_after_copy = { NOTIFY_COPY_END }; checkbox show_breadcrumb = { SHOW_BREADCRUMBS }; checkbox big_icons = { BIG_ICONS }; checkbox two_panels = { USE_TWO_PANELS }; @@ -50,7 +47,7 @@ void settings_dialog() { proc_info Settings; int id; - active_settings=1; + active_settings = true; font_size.value = kfont.size.pt; line_height.value = files.item_h; SetEventMask(0x27); @@ -66,7 +63,7 @@ void settings_dialog() if (1==id) { ExitSettings(); break; } else if (id==5) { - RunProgram("/sys/tinypad", "/sys/settings/assoc.ini"); + RunProgram("/sys/@open", "/sys/settings/assoc.ini"); break; } else if (id==6) @@ -83,7 +80,6 @@ void settings_dialog() break; } show_dev_name.click(id); - info_after_copy.click(id); two_panels.click(id); show_breadcrumb.click(id); show_status_bar.click(id); @@ -108,7 +104,7 @@ void settings_dialog() case evReDraw: DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 400, - 435+skin_height,0x34,sc.work,TITLE_SETT,0); + 365+skin_height,0x34,sc.work,TITLE_SETT,0); GetProcessInfo(#Settings, SelfInfo); DrawSettingsCheckBoxes(); } @@ -117,7 +113,7 @@ void settings_dialog() void ExitSettings() { - active_settings = 0; + active_settings = false; settings_window = 0; cmd_free = 4; ExitProcess(); @@ -130,10 +126,9 @@ void DrawSettingsCheckBoxes() y.n = 0; show_dev_name.draw(x, y.inc(14)); show_status_bar.draw(x, y.inc(25)); - info_after_copy.draw(x, y.inc(25)); show_breadcrumb.draw(x, y.inc(25)); big_icons.draw(x, y.inc(25)); - two_panels.draw(x, y.inc(25)); + //two_panels.draw(x, y.inc(25)); colored_lines.draw(x, y.inc(25)); font_size.draw(x, y.inc(31)); line_height.draw(x, y.inc(31)); @@ -152,21 +147,21 @@ void DrawSettingsCheckBoxes() void LoadIniSettings() { ini.path = GetIni(#eolite_ini_path, "app.ini"); - ini.section = "Eolite"; + if (efm) ini.section = "EFM"; else ini.section = "Eolite"; + two_panels.checked = efm; files.SetFont(6, 9, 10000000b); show_dev_name.checked = ini.GetInt("ShowDeviceName", true); show_status_bar.checked = ini.GetInt("ShowStatusBar", true); - info_after_copy.checked = ini.GetInt("InfoAfterCopy", false); big_icons.checked = ini.GetInt("BigIcons", false); BigIconsSwitch(); - two_panels.checked = ini.GetInt("TwoPanels", false); + //two_panels.checked = ini.GetInt("TwoPanels", false); colored_lines.checked = ini.GetInt("ColoredLines", false); kfont.size.pt = ini.GetInt("FontSize", 13); files.item_h = ini.GetInt("LineHeight", 19); - Form.left = ini.GetInt("WinX", 200); - Form.top = ini.GetInt("WinY", 50); - Form.width = ini.GetInt("WinW", 550); - Form.height = ini.GetInt("WinH", 503); + Form.left = ini.GetInt("WinX", 100); + Form.top = ini.GetInt("WinY", 30); + Form.width = ini.GetInt("WinW", efm*170+550); + Form.height = ini.GetInt("WinH", efm*116+503); 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); @@ -182,16 +177,17 @@ void SaveIniSettings() { ini.SetInt("ShowDeviceName", show_dev_name.checked); ini.SetInt("ShowStatusBar", show_status_bar.checked); - ini.SetInt("InfoAfterCopy", info_after_copy.checked); ini.SetInt("BigIcons", big_icons.checked); - ini.SetInt("TwoPanels", two_panels.checked); + //ini.SetInt("TwoPanels", two_panels.checked); ini.SetInt("ColoredLines", colored_lines.checked); ini.SetInt("FontSize", kfont.size.pt); ini.SetInt("LineHeight", files.item_h); - ini.SetInt("WinX", Form.left); - ini.SetInt("WinY", Form.top); - ini.SetInt("WinW", Form.width); - ini.SetInt("WinH", Form.height); + if (Form.status_window<=2) { + ini.SetInt("WinX", Form.left); + ini.SetInt("WinY", Form.top); + ini.SetInt("WinW", Form.width); + ini.SetInt("WinH", Form.height); + } } diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index 0ed7bc5416..86a56d2b24 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/translations.h @@ -9,7 +9,7 @@ ?define T_NO "Нет" ?define T_CANCEL "Отмена" ?define T_CREATE "Создать" -?define T_RENAME "Переименовать" +?define T_RENAME "Переназвать" ?define FS_ITEM_ALREADY_EXISTS "'Элемент с таким именем уже существует' -E" ?define NOT_CREATE_FOLDER "'Не удалось создать папку.' -E" ?define NOT_CREATE_FILE "'Не удалось создать файл.' -E" @@ -18,7 +18,6 @@ ?define T_MOVE_WINDOW_TITLE "Перемещаю..." ?define T_DELETE_WINDOW_TITLE "Удаляю..." ?define T_ABORT_WINDOW_BUTTON "Прервать" -?define INFO_AFTER_COPY "Копирование завершено" ?define T_CANCEL_PASTE "Копирование прекращено. Папка скопирована не полностью." ?define T_SELECT_APP_TO_OPEN_WITH "Выберите программу для открытия файла" ?define DEL_MORE_FILES_1 "выбранные элементы (" @@ -49,7 +48,6 @@ ?define T_MOVE_WINDOW_TITLE "Moving..." ?define T_DELETE_WINDOW_TITLE "Deleting..." ?define T_ABORT_WINDOW_BUTTON "Abort" -?define INFO_AFTER_COPY "Copy finished" ?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely." ?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file" ?define DEL_MORE_FILES_1 "selected items("