diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 1953e8930..db7bc7666 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -3,9 +3,9 @@ // 70.5 - get volume info and label -#define ABOUT_TITLE "EOLITE 5 RC5" -#define TITLE_EOLITE "Eolite File Manager 5 RC5" -#define TITLE_KFM "Kolibri File Manager 2 RC5"; +#define ABOUT_TITLE "EOLITE 5 Beta8" +#define TITLE_EOLITE "Eolite File Manager 5 Beta8" +#define TITLE_KFM "Kolibri File Manager 2 Beta8"; #define MEMSIZE 1024 * 250 #include "../lib/clipboard.h" @@ -28,36 +28,7 @@ #include "imgs/images.h" -//Button IDs -enum { - PATH_BTN = 10, - POPUP_BTN1 = 201, - POPUP_BTN2 = 202, - KFM_DEV_DROPDOWN_1 = 205, - KFM_DEV_DROPDOWN_2 = 207, - BREADCRUMB_ID = 300, - - BACK_BTN = 400, - FWRD_BTN, - GOUP_BTN, - COPY_BTN, - CUT_BTN, - PASTE_BTN, - KFM_FUNC_ID = 450 -}; - -//NewElement options -enum { - CREATE_FILE=1, - CREATE_FOLDER, - RENAME_ITEM -}; - -//OpenDir options -enum { - WITH_REDRAW, - ONLY_OPEN -}; +#include "include/const.h" _history history; @@ -84,52 +55,54 @@ bool efm = false; int toolbar_buttons_x[7]={9,46,85,134,167,203}; -bool active_about = false; -bool active_settings = false; -bool _not_draw = false; bool dir_at_fat16 = NULL; -bool disk_popin_active_on_panel=0; - dword about_thread_id; dword settings_window; +bool active_about = false; +bool active_settings = false; byte del_active=0; byte new_element_active=0; llist files, files_active, files_inactive; -byte list_full_redraw; +bool list_full_redraw; -dword buf; -collection_int items=0; -int selected_count; -int count_dir; +//Folder data + dword buf; + collection_int items=0; + int selected_count; + int folder_count; + //dword path; + char path[4096]; -byte path[4096]; -byte file_path[4096]; -byte file_name[256]; -byte new_element_name[256]; -byte temp[4096]; -bool itdir; +//Sselected element data + byte file_path[4096]; + byte file_name[256]; + byte new_element_name[256]; + byte temp[4096]; + bool itdir; + +//Window data + proc_info Form; + int sc_slider_h; + bool scroll_used=false; + char sort_type=2; + bool sort_desc=false; + int status_bar_h; + int icon_size = 18; + + +int active_panel=0; +int disk_popin_active_on_panel=0; +#define PANES_COUNT 2 +unsigned char location[PANES_COUNT]; char active_path[4096], inactive_path[4096]; -dword eolite_ini_path[4096]; -_ini ini; - -char scroll_used=false; - dword about_stak=0,properties_stak=0,settings_stak=0; - -proc_info Form; -int sc_slider_h; -int action_buf; -int rand_n; - -char sort_type=2; -bool sort_desc=false; -int active_panel=0; +byte cmd_free=0; libimg_image icons16_default; libimg_image icons16_selected; @@ -137,15 +110,10 @@ libimg_image icons16_selected; libimg_image icons32_default; libimg_image icons32_selected; -int status_bar_h; - -int icon_size = 18; - edit_box new_file_ed = {200,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0x10000000, 248,#new_element_name,0,ed_focus+ed_always_focus,6,0}; PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; -byte cmd_free=0; -#include "include\translations.h" + #include "include\gui.h" #include "include\settings.h" @@ -159,18 +127,12 @@ byte cmd_free=0; #include "include\properties.h" #include "include\breadcrumbs.h" -void load_libraries() -{ - load_dll(boxlib, #box_lib_init,0); - load_dll(libini, #lib_init,1); - load_dll(libimg, #libimg_init,1); -} - void handle_param() { //-p : just show file/folder properties dialog //-d : delete file/folder //-v : paste files/folder from clipboard + int i; dword p = #param; if (param[0]=='\\') && (param[1]=='E') && (param[2]=='F') && (param[3]=='M') { efm = true; @@ -180,6 +142,12 @@ void handle_param() LoadIniSettings(); + for (i=0; i=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) - && (mouse.y0) && (streq(items.get(0)*304+buf+72,"..")) go_up_folder_exists=1; DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, sc.work); - sprintf(#status_bar_str, T_STATUS_EVEMENTS, count_dir-go_up_folder_exists, files.count-count_dir); + sprintf(#status_bar_str, T_STATUS_EVEMENTS, folder_count-go_up_folder_exists, files.count-folder_count); WriteText(6,Form.cheight - 13,0x80,sc.work_text,#status_bar_str); if (selected_count) { sprintf(#status_bar_str, T_STATUS_SELECTED, selected_count); @@ -772,7 +736,7 @@ void List_ReDraw() if (colored_lines.checked) separator_color = col.list_bg; else separator_color = col.list_vert_line; DrawBar(files.x+files.w-141,all_lines_h + files.y,1,files.h - all_lines_h, separator_color); DrawBar(files.x+files.w-68,all_lines_h + files.y,1,files.h - all_lines_h, separator_color); - Scroll(); + DrawScroll(scroll_used); if (del_active) Del_Form(); if (new_element_active) && (col.selec != 0xCCCccc) NewElement_Form(new_element_active, #new_element_name); @@ -891,24 +855,19 @@ void Open_Dir(dword dir_path, redraw){ } if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0; - if (files.count!=-1) - { - if(!_not_draw) DrawPathBar(); - history.add(#path); - SystemDiscs.Draw(); - files.visible = files.h / files.item_h; - if (files.count < files.visible) files.visible = files.count; - if (!strncmp(dir_path, "/rd/1/",5)) || (!strncmp(dir_path, "/sys/",4)) - dir_at_fat16 = true; else dir_at_fat16 = false; - Sorting(); - list_full_redraw = true; - if (redraw!=ONLY_OPEN)&&(!_not_draw) {DrawStatusBar(); List_ReDraw();} - SetCurDir(dir_path); - } - if (files.count==-1) && (redraw!=ONLY_OPEN) - { - files.KeyHome(); - if(!_not_draw) { list_full_redraw=true; DrawStatusBar(); List_ReDraw(); } + history.add(#path); + SystemDiscs.Draw(); + files.visible = files.h / files.item_h; + if (files.count < files.visible) files.visible = files.count; + if (!strncmp(dir_path, "/rd/1/",5)) || (!strncmp(dir_path, "/sys/",4)) + dir_at_fat16 = true; else dir_at_fat16 = false; + Sorting(); + list_full_redraw = true; + SetCurDir(dir_path); + DrawPathBar(); + if (redraw!=ONLY_OPEN) { + List_ReDraw(); + DrawStatusBar(); } } @@ -923,7 +882,7 @@ inline Sorting() if (!strcmp(#path,"/")) //do not sort root folder { for(d=1;d=0; j--, file_off-=304;) //files | folders @@ -937,7 +896,7 @@ inline Sorting() f++; } } - count_dir = d; + folder_count = d; //sorting: files first, then folders Sort_by_Name(0,d-1); if (sort_type==1) Sort_by_Name(d,files.count-1); @@ -1169,7 +1128,7 @@ void FnProcess(byte N) CopyFilesListToClipboard(COPY); EventPaste(#inactive_path); } else { - EventRefreshDisksAndFolders(); + EventManualFolderRefresh(); } break; case 6: @@ -1202,19 +1161,6 @@ void FnProcess(byte N) } } -void EventRefresh() -{ - if (efm) - { - DrawFilePanels(); - } else { - Tip(56, T_DEVICES, 55, "-"); - Open_Dir(#path,WITH_REDRAW); - pause(10); - DrawDeviceAndActionsLeftPanel(); - } -} - void SetActivePanel(int _active) { if (active_panel != _active) { @@ -1266,15 +1212,26 @@ int GetRealFileCountInFolder(dword folder_path) void EventRefreshDisksAndFolders() { - if(GetRealFileCountInFolder("/")+dir_exists("/kolibrios") != SystemDiscs.dev_num) { - SystemDiscs.Get(); - EventRefresh(); + if(efm) { + if (GetRealFileCountInFolder(#inactive_path) != files_inactive.count) { + DrawFilePanels(); + return; + } } else { - if(GetRealFileCountInFolder(#path) != files.count) EventRefresh(); - else if(efm) && (GetRealFileCountInFolder(#inactive_path) != files_inactive.count) { - EventRefresh(); + if (GetRealFileCountInFolder("/")+dir_exists("/kolibrios") != SystemDiscs.dev_num) { + SystemDiscs.Get(); + DrawDeviceAndActionsLeftPanel(); } } + if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW); +} + +void EventManualFolderRefresh() +{ + Tip(56, T_DEVICES, 55, "-"); + pause(10); + EventRefreshDisksAndFolders(); + DrawDeviceAndActionsLeftPanel(); } void EventSort(dword id) diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/const.h similarity index 84% rename from programs/cmm/eolite/include/translations.h rename to programs/cmm/eolite/include/const.h index bb91ef337..6d81508b7 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/const.h @@ -37,7 +37,7 @@ char *kfm_func = { "Удалить", "Файл", " Настройки" -} +}; #else ?define T_FILE "File" ?define T_TYPE "Type" @@ -78,6 +78,36 @@ char *kfm_func = { "Delete", "File", " Settings" -} +}; #endif +//Button IDs +enum { + PATH_BTN = 10, + POPUP_BTN1 = 201, + POPUP_BTN2 = 202, + KFM_DEV_DROPDOWN_1 = 205, + KFM_DEV_DROPDOWN_2 = 207, + BREADCRUMB_ID = 300, + + BACK_BTN = 400, + FWRD_BTN, + GOUP_BTN, + COPY_BTN, + CUT_BTN, + PASTE_BTN, + KFM_FUNC_ID = 450 +}; + +//NewElement options +enum { + CREATE_FILE=1, + CREATE_FOLDER, + RENAME_ITEM +}; + +//OpenDir options +enum { + WITH_REDRAW, + ONLY_OPEN +}; \ No newline at end of file diff --git a/programs/cmm/eolite/include/gui.h b/programs/cmm/eolite/include/gui.h index 3f8d12796..bf325aa88 100644 --- a/programs/cmm/eolite/include/gui.h +++ b/programs/cmm/eolite/include/gui.h @@ -1,5 +1,5 @@ -void Scroll() { +void DrawScroll(bool _scroll_used) { dword i; dword sc_x = files.x + files.w; @@ -23,8 +23,10 @@ void Scroll() { //slider DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,sc.work_graph); DrawRectangle3D(sc_x+1,sc_slider_y+1,14,sc_slider_h-2, sc.work_light , sc.work_dark); - if (!scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col.work_gradient[13-i]); - if (scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col.work_gradient[i]); + for (i=0; i<13; i++) { + if (!_scroll_used) EDX = col.work_gradient[13-i]; else EDX = col.work_gradient[i]; + DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, EDX); + } sc_center = sc_slider_h / 2 + sc_slider_y; diff --git a/programs/cmm/eolite/include/progress_dialog.h b/programs/cmm/eolite/include/progress_dialog.h index e8ff094c4..e5ed96254 100644 --- a/programs/cmm/eolite/include/progress_dialog.h +++ b/programs/cmm/eolite/include/progress_dialog.h @@ -14,7 +14,6 @@ enum { COPY_FLAG, MOVE_FLAG, DELETE_FLAG, - OPERATION_END }; void DisplayOperationForm(int operation_flag) @@ -57,7 +56,6 @@ void DisplayOperationForm(int operation_flag) } void DialogExit() { - action_buf = OPERATION_END; ActivateWindow(GetProcessSlot(Form.ID)); ExitProcess(); } diff --git a/programs/cmm/eolite/include/properties.h b/programs/cmm/eolite/include/properties.h index d142901b1..ac6b8210b 100644 --- a/programs/cmm/eolite/include/properties.h +++ b/programs/cmm/eolite/include/properties.h @@ -131,10 +131,7 @@ void SetProperties(int mode) } cmd_free=3; - _not_draw = true; - Open_Dir(#path,WITH_REDRAW); - _not_draw = false; - EventRedrawWindow(Form.left,Form.top); + Open_Dir(#path,ONLY_OPEN); ExitProcess(); } diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index 4cc626918..d4b4a1ec1 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -27,6 +27,9 @@ ?define START_PATH " Start path: " #endif +dword eolite_ini_path[4096]; +_ini ini; + char path_start[4096]; edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098, #path_start,0, 100000000000010b,0,0};