diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 3646d22787..a3c8bce9fe 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -8,9 +8,9 @@ TODO: - 70.5 - get volume info and label */ -#define ABOUT_TITLE "EOLITE 5.04 Gold" -#define TITLE_EOLITE "Eolite File Manager 5.04 Gold" -#define TITLE_KFM "Kolibri File Manager 2.04 Gold"; +#define ABOUT_TITLE "EOLITE 5.05 Gold" +#define TITLE_EOLITE "Eolite File Manager 5.05 Gold" +#define TITLE_KFM "Kolibri File Manager 2.05 Gold"; #define MEMSIZE 1024 * 250 #include "../lib/clipboard.h" @@ -142,7 +142,7 @@ void handle_param() if (ESBYTE[p]=='\0') return; - if (ESBYTE[p]=='-') switch (ESBYTE[p+1]) + if (ESBYTE[p]=='-') switch (ESBYTE[p+1]) { case 'p': strcpy(#file_path, p + 3); @@ -175,10 +175,10 @@ void handle_param() } else { notify(T_NOTIFY_APP_PARAM_WRONG); } - } + } } -void main() +void main() { dword id; int old_cur_y; @@ -203,7 +203,7 @@ void main() if (popin_string[0]!=-1) edit_box_mouse stdcall(#popin_text); break; } - + mouse.get(); ProceedMouseGestures(); @@ -239,7 +239,7 @@ void main() if (mouse.key&MOUSE_RIGHT) && (mouse.up) { if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw(); - if (getElementSelectedFlag(files.cur_y) == false) unselectAll(); //on redraw selection would be flashed, see [L001] + if (getElementSelectedFlag(files.cur_y) == false) unselectAll(); //on redraw selection would be flashed, see [L001] EventShowListMenu(); } } @@ -271,10 +271,10 @@ void main() } //Scrooll - if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) + if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) && (mouse.ymouse.y) || (mouse.y<0) || (mouse.y>4000) mouse.y=sc_slider_h/2+files.y; //anee eo?ni? iaa ieiii @@ -294,7 +294,7 @@ void main() SetActivePanel(1); } } - break; + break; //Button pressed----------------------------------------------------------------------------- case evButton: id = GetButtonID(); @@ -319,10 +319,10 @@ void main() ClickOnBreadCrumb(id-BREADCRUMB_ID); } - break; + break; } - switch(id) + switch(id) { case KFM_DEV_DROPDOWN_1: case KFM_DEV_DROPDOWN_2: @@ -356,7 +356,7 @@ void main() break; } break; - + //Key pressed----------------------------------------------------------------------------- case evKey: GetKeys(); @@ -368,7 +368,7 @@ void main() if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm(); if (POPIN_DISK == active_popin) { - if (key_scancode >= SCAN_CODE_1) + if (key_scancode >= SCAN_CODE_1) && (key_scancode <= SCAN_CODE_10) { EventDriveClick(key_scancode-2); } @@ -377,7 +377,7 @@ void main() if (popin_string[0] != -1) { EAX = key_editbox; edit_box_key stdcall (#popin_text); - } + } } break; } @@ -385,7 +385,7 @@ void main() if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) { if (key_scancode == SCAN_CODE_ENTER) { - EventOpenSelected(); + EventOpenSelected(); break; } @@ -419,13 +419,13 @@ void main() if (key_scancode >= SystemDiscs.list.count) break; if (!efm) { DrawRectangle(17,key_scancode*17+74,159,17, 0); //display click - pause(7); + pause(7); } EventDriveClick(key_scancode); break; case SCAN_CODE_KEY_X: CopyFilesListToClipboard(CUT); - break; + break; case SCAN_CODE_KEY_C: CopyFilesListToClipboard(COPY); break; @@ -442,7 +442,7 @@ void main() break; case SCAN_CODE_KEY_N: EventOpenNewEolite(); - break; + break; case SCAN_CODE_KEY_R: EventManualFolderRefresh(); break; @@ -464,10 +464,10 @@ void main() { case SCAN_CODE_BS: Dir_Up(); - break; + break; case SCAN_CODE_ENTER: EventOpen(0); - break; + break; case SCAN_CODE_TAB: if (!efm) break; SetActivePanel(active_panel^1); @@ -493,10 +493,10 @@ void main() break; case SCAN_CODE_F1...SCAN_CODE_F10: FnProcess(key_scancode-58); - break; + break; default: EventSelectFileByKeyPress(); - } + } break; case evIPC: case evReDraw: @@ -506,7 +506,7 @@ void main() default: if (!Form.status_window&ROLLED_UP) EventRefreshDisksAndFolders(); } - + if(cmd_free) { if(cmd_free==2) about_stak=free(about_stak); @@ -522,7 +522,7 @@ void draw_window() incn x; dword title; static int rand_n; - if (rand_n) rand_n = random(80); + if (!rand_n) rand_n = random(80); if (show_status_bar.checked) { #define STBAR_EOLITE_H 16 @@ -567,7 +567,7 @@ void draw_window() 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); + 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,BACK_BTN+i); for (i=3; i<6; i++) DefineHiddenButton(toolbar_buttons_x[i], 5,31, 29, BACK_BTN+i); DrawBar(127, 8, 1, 25, sc.work_graph); @@ -585,7 +585,7 @@ void draw_window() llist_copy(#files_active, #files); DrawStatusBar(); if (!getSelectedCount()) { - OpenDir(ONLY_OPEN); //if there are no selected files -> refresh folder [L001] + OpenDir(ONLY_OPEN); //if there are no selected files -> refresh folder [L001] } DrawFilePanels(); @@ -594,7 +594,7 @@ void draw_window() } } -void DrawButtonsAroundList() +void DrawButtonsAroundList() { word sorting_arrow_x; dword sorting_arrow_t = "\x19"; @@ -633,7 +633,7 @@ void DrawStatusBar() char status_bar_str[80]; int go_up_folder_exists=0; - if (efm) { + if (efm) { DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, 2, sc.work); DrawBar(0, Form.cheight - 2, Form.cwidth, 2, sc.work); DrawBar(Form.cwidth-1, Form.cheight - 19, 1, 17, sc.work); @@ -708,8 +708,8 @@ void OpenDir2(char redraw){ SetCurDir(path); if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0; files.visible = math.min(files.h / files.item_h, files.count); - if (!strncmp(path, "/rd/1",5)) || (!strncmp(path, "/sys/",4)) - dir_at_fat16 = true; else dir_at_fat16 = false; + if (!strncmp(path, "/rd/1",5)) || (!strncmp(path, "/sys/",4)) + dir_at_fat16 = true; else dir_at_fat16 = false; Sorting(); SystemDiscs.Draw(); list_full_redraw = true; @@ -724,7 +724,8 @@ void OpenDir(char redraw){ if (buf) free(buf); if (errornum = GetDir(#buf, #files.count, path, DIRS_NOROOT)) { history.add(path); - EventHistoryGoBack(); + //EventHistoryGoBack(); + Dir_Up(); Write_Error(errornum); return; } @@ -732,8 +733,8 @@ void OpenDir(char redraw){ history.add(path); SystemDiscs.Draw(); files.visible = math.min(files.h / files.item_h, files.count); - if (!strncmp(path, "/rd/1",5)) || (!strncmp(path, "/sys/",4)) - dir_at_fat16 = true; else dir_at_fat16 = false; + if (!strncmp(path, "/rd/1",5)) || (!strncmp(path, "/sys/",4)) + dir_at_fat16 = true; else dir_at_fat16 = false; Sorting(); list_full_redraw = true; SetCurDir(path); @@ -773,8 +774,8 @@ void List_ReDraw() _ALL_LIST_REDRAW: for (j=0; j files.w) { ESBYTE[#label_file_name+strlen(#label_file_name)-1] = NULL; } - strcpy(#label_file_name+strlen(#label_file_name)-2, "..."); + strcpy(#label_file_name+strlen(#label_file_name)-2, "..."); } - kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y, + kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y, bgcol, text_col, kfont.size.pt, #label_file_name); } DrawIconByExtension(#full_path, ext1, files.x+4, icon_y, bgcol); @@ -961,7 +962,7 @@ void Dir_Up() void EventOpenSelected() { int i; - for (i=0; iadif_y) { if (dif_x > 150) { EventHistoryGoForward(); @@ -1365,7 +1366,7 @@ void EventChooseFilesRange(int _start, _end) if (_start > _end) _start >< _end; if (_end - _start > 1) list_full_redraw = true; while (_start < _end) { - EventChooseFile(_start); + EventChooseFile(_start); _start++; } DrawStatusBar(); @@ -1388,7 +1389,7 @@ void EventToolbarButtonClick(int _btid) case GOUP_BTN: Dir_Up(); break; case COPY_BTN: CopyFilesListToClipboard(CUT); break; case CUT_BTN: CopyFilesListToClipboard(COPY); break; - case PASTE_BTN:EventPaste(path); break; + case PASTE_BTN:EventPaste(path); break; } } @@ -1401,7 +1402,7 @@ void EventDriveClick(int __id) } strcpy(path, SystemDiscs.list.get(__id)); files.KeyHome(); - OpenDir(WITH_REDRAW); + OpenDir(WITH_REDRAW); } stop: