Rev 8944 | Rev 8947 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8944 | Rev 8946 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | //Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2021 |
1 | //Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2021 |
2 | //GNU GPL license. |
2 | //GNU GPL license. |
Line 3... | Line 3... | ||
3 | 3 | ||
Line 4... | Line 4... | ||
4 | // 70.5 - get volume info and label |
4 | // 70.5 - get volume info and label |
5 | 5 | ||
6 | #define ABOUT_TITLE "EOLITE 5 RC4" |
6 | #define ABOUT_TITLE "EOLITE 5 RC5" |
Line 7... | Line 7... | ||
7 | #define TITLE_EOLITE "Eolite File Manager 5 RC4" |
7 | #define TITLE_EOLITE "Eolite File Manager 5 RC5" |
8 | #define TITLE_KFM "Kolibri File Manager 2 RC4"; |
8 | #define TITLE_KFM "Kolibri File Manager 2 RC5"; |
9 | 9 | ||
10 | #define MEMSIZE 1024 * 250 |
10 | #define MEMSIZE 1024 * 250 |
Line 127... | Line 127... | ||
127 | int action_buf; |
127 | int action_buf; |
128 | int rand_n; |
128 | int rand_n; |
Line 129... | Line 129... | ||
129 | 129 | ||
130 | char sort_type=2; |
130 | char sort_type=2; |
131 | bool sort_desc=false; |
131 | bool sort_desc=false; |
Line 132... | Line 132... | ||
132 | int active_panel=1; |
132 | int active_panel=0; |
133 | 133 | ||
Line 134... | Line 134... | ||
134 | libimg_image icons16_default; |
134 | libimg_image icons16_default; |
Line 241... | Line 241... | ||
241 | llist_copy(#files_inactive, #files); |
241 | llist_copy(#files_inactive, #files); |
242 | SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); |
242 | SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); |
243 | loop() switch(@WaitEventTimeout(80)) |
243 | loop() switch(@WaitEventTimeout(80)) |
244 | { |
244 | { |
245 | case evMouse: |
245 | case evMouse: |
246 | if (del_active) || (disk_popin_active_on_panel) || (Form.status_window>2) break; |
246 | if (del_active) || (disk_popin_active_on_panel) || (Form.status_window&ROLLED_UP) break; |
247 | if (new_element_active) |
247 | if (new_element_active) |
248 | { |
248 | { |
249 | edit_box_mouse stdcall(#new_file_ed); |
249 | edit_box_mouse stdcall(#new_file_ed); |
250 | break; |
250 | break; |
251 | } |
251 | } |
Line 333... | Line 333... | ||
333 | break; |
333 | break; |
334 | } |
334 | } |
Line 335... | Line 335... | ||
335 | 335 | ||
336 | if (efm) && (mouse.y < files.y + files.h) && (mouse.down) { |
336 | if (efm) && (mouse.y < files.y + files.h) && (mouse.down) { |
337 | if (mouse.x |
337 | if (mouse.x |
338 | if (active_panel!=1) ChangeActivePanel(); |
338 | SetActivePanel(0); |
339 | } else { |
339 | } else { |
340 | if (active_panel!=2) ChangeActivePanel(); |
340 | SetActivePanel(1); |
341 | } |
341 | } |
342 | } |
342 | } |
343 | break; |
343 | break; |
344 | //Button pressed----------------------------------------------------------------------------- |
344 | //Button pressed----------------------------------------------------------------------------- |
Line 368... | Line 368... | ||
368 | notify(COPY_PATH_STR); |
368 | notify(COPY_PATH_STR); |
369 | Clipboard__CopyText(#path); |
369 | Clipboard__CopyText(#path); |
370 | break; |
370 | break; |
371 | case KFM_DEV_DROPDOWN_1: |
371 | case KFM_DEV_DROPDOWN_1: |
372 | case KFM_DEV_DROPDOWN_1+1: |
372 | case KFM_DEV_DROPDOWN_1+1: |
373 | EventOpenDiskPopin(1); |
- | |
374 | break; |
- | |
375 | case KFM_DEV_DROPDOWN_2: |
373 | case KFM_DEV_DROPDOWN_2: |
376 | case KFM_DEV_DROPDOWN_2+1: |
374 | case KFM_DEV_DROPDOWN_2+1: |
377 | EventOpenDiskPopin(2); |
375 | EventOpenDiskPopin(active_panel); |
378 | break; |
376 | break; |
379 | case BACK_BTN...PASTE_BTN: |
377 | case BACK_BTN...PASTE_BTN: |
380 | if (active_panel==2) ChangeActivePanel(); |
378 | SetActivePanel(0); |
381 | EventToolbarButtonClick(id); |
379 | EventToolbarButtonClick(id); |
382 | break; |
380 | break; |
383 | case BACK_BTN+100...PASTE_BTN+100: |
381 | case BACK_BTN+100...PASTE_BTN+100: |
384 | if (active_panel==1) ChangeActivePanel(); |
382 | SetActivePanel(1); |
385 | EventToolbarButtonClick(id-100); |
383 | EventToolbarButtonClick(id-100); |
386 | break; |
384 | break; |
387 | case 31...33: |
385 | case 31...33: |
388 | EventSort(id-30); |
386 | EventSort(id-30); |
389 | break; |
387 | break; |
Line 410... | Line 408... | ||
410 | 408 | ||
411 | //Key pressed----------------------------------------------------------------------------- |
409 | //Key pressed----------------------------------------------------------------------------- |
412 | case evKey: |
410 | case evKey: |
Line 413... | Line 411... | ||
413 | GetKeys(); |
411 | GetKeys(); |
Line 414... | Line 412... | ||
414 | 412 | ||
415 | if (Form.status_window>2) break; |
413 | if (Form.status_window&ROLLED_UP) break; |
416 | 414 | ||
Line 514... | Line 512... | ||
514 | case SCAN_CODE_ENTER: |
512 | case SCAN_CODE_ENTER: |
515 | EventOpen(0); |
513 | EventOpen(0); |
516 | break; |
514 | break; |
517 | case SCAN_CODE_TAB: |
515 | case SCAN_CODE_TAB: |
518 | if (!efm) break; |
516 | if (!efm) break; |
519 | ChangeActivePanel(); |
517 | SetActivePanel(active_panel^1); |
520 | break; |
518 | break; |
521 | case SCAN_CODE_MENU: |
519 | case SCAN_CODE_MENU: |
522 | mouse.x = files.x+15; |
520 | mouse.x = files.x+15; |
523 | mouse.y = files.cur_y - files.first * files.item_h + files.y + 5; |
521 | mouse.y = files.cur_y - files.first * files.item_h + files.y + 5; |
524 | EventShowListMenu(); |
522 | EventShowListMenu(); |
Line 582... | Line 580... | ||
582 | status_bar_h = 0; |
580 | status_bar_h = 0; |
583 | } |
581 | } |
584 | if (efm) title = TITLE_KFM; else title = TITLE_EOLITE; |
582 | if (efm) title = TITLE_KFM; else title = TITLE_EOLITE; |
585 | DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,title,0); |
583 | DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,title,0); |
586 | GetProcessInfo(#Form, SelfInfo); |
584 | GetProcessInfo(#Form, SelfInfo); |
587 | if (Form.status_window>2) return; |
585 | if (Form.status_window&ROLLED_UP) return; |
588 | if (Form.height < 356) { MoveSize(OLD,OLD,OLD,356); return; } |
586 | if (Form.height < 356) { MoveSize(OLD,OLD,OLD,356); return; } |
589 | GetProcessInfo(#Form, SelfInfo); |
587 | GetProcessInfo(#Form, SelfInfo); |
590 | SetAppColors(); |
588 | SetAppColors(); |
591 | if (efm) { |
589 | if (efm) { |
592 | if (screen.width > 693) && (Form.width < 693) { MoveSize(OLD,OLD,693,OLD); return; } |
590 | if (screen.width > 693) && (Form.width < 693) { MoveSize(OLD,OLD,693,OLD); return; } |
Line 706... | Line 704... | ||
706 | strcpy(#path, #inactive_path); |
704 | strcpy(#path, #inactive_path); |
707 | files_y = files.y; |
705 | files_y = files.y; |
708 | h2 = Form.cheight-files_y-2 - status_bar_h; |
706 | h2 = Form.cheight-files_y-2 - status_bar_h; |
709 | col.selec = col.selec_inactive; //this is a bad code: need to use some var to set inactive panel for DrawButtonsAroundList(); |
707 | col.selec = col.selec_inactive; //this is a bad code: need to use some var to set inactive panel for DrawButtonsAroundList(); |
Line 710... | Line 708... | ||
710 | 708 | ||
711 | if (active_panel==1) |
709 | if (active_panel==0) |
712 | { |
710 | { |
713 | files.SetSizes(Form.cwidth/2, files_y, w2-17, h2, files.item_h); |
711 | files.SetSizes(Form.cwidth/2, files_y, w2-17, h2, files.item_h); |
714 | DrawButtonsAroundList(); |
712 | DrawButtonsAroundList(); |
715 | Open_Dir(#path,WITH_REDRAW); |
713 | Open_Dir(#path,WITH_REDRAW); |
Line 719... | Line 717... | ||
719 | col.selec = col.selec_active; |
717 | col.selec = col.selec_active; |
720 | files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h); |
718 | files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h); |
721 | DrawButtonsAroundList(); |
719 | DrawButtonsAroundList(); |
722 | Open_Dir(#path,WITH_REDRAW); |
720 | Open_Dir(#path,WITH_REDRAW); |
723 | } |
721 | } |
724 | if (active_panel==2) |
722 | if (active_panel==1) |
725 | { |
723 | { |
726 | files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h); |
724 | files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h); |
727 | DrawButtonsAroundList(); |
725 | DrawButtonsAroundList(); |
728 | Open_Dir(#path,WITH_REDRAW); |
726 | Open_Dir(#path,WITH_REDRAW); |
729 | files_inactive.count = files.count; |
727 | files_inactive.count = files.count; |
Line 778... | Line 776... | ||
778 | 776 | ||
779 | if (del_active) Del_Form(); |
777 | if (del_active) Del_Form(); |
780 | if (new_element_active) && (col.selec != 0xCCCccc) NewElement_Form(new_element_active, #new_element_name); |
778 | if (new_element_active) && (col.selec != 0xCCCccc) NewElement_Form(new_element_active, #new_element_name); |
Line 781... | Line -... | ||
781 | } |
- | |
782 | - | ||
783 | bool file_name_is_8_3(dword name) |
- | |
784 | { |
- | |
785 | int name_len = strlen(name); |
- | |
786 | int dot_pos = strrchr(name, '.'); |
- | |
787 | if (name_len<=12) |
- | |
788 | { |
- | |
789 | if (dot_pos) { |
- | |
790 | if (name_len - dot_pos > 3) return false; |
- | |
791 | } |
- | |
792 | else { |
- | |
793 | if (name_len>8) return false; |
- | |
794 | } |
- | |
795 | return true; |
- | |
796 | } |
- | |
797 | return false; |
- | |
798 | } |
779 | } |
799 | 780 | ||
800 | void Line_ReDraw(dword bgcol, filenum){ |
781 | void Line_ReDraw(dword bgcol, filenum){ |
801 | dword text_col=col.list_gb_text, |
782 | dword text_col=col.list_gb_text, |
802 | ext1, attr, |
783 | ext1, attr, |
Line 1232... | Line 1213... | ||
1232 | pause(10); |
1213 | pause(10); |
1233 | DrawDeviceAndActionsLeftPanel(); |
1214 | DrawDeviceAndActionsLeftPanel(); |
1234 | } |
1215 | } |
1235 | } |
1216 | } |
Line 1236... | Line 1217... | ||
1236 | 1217 | ||
1237 | void ChangeActivePanel() |
1218 | void SetActivePanel(int _active) |
1238 | { |
1219 | { |
- | 1220 | if (active_panel != _active) { |
|
1239 | if (active_panel==1) active_panel=2; else active_panel=1; |
1221 | active_panel = _active; |
1240 | llist_copy(#files_active, #files_inactive); |
1222 | llist_copy(#files_active, #files_inactive); |
1241 | llist_copy(#files_inactive, #files); |
1223 | llist_copy(#files_inactive, #files); |
1242 | strcpy(#active_path, #inactive_path); |
1224 | strcpy(#active_path, #inactive_path); |
1243 | strcpy(#inactive_path, #path); |
1225 | strcpy(#inactive_path, #path); |
1244 | DrawFilePanels(); |
1226 | DrawFilePanels(); |
- | 1227 | } |
|
Line 1245... | Line 1228... | ||
1245 | } |
1228 | } |
1246 | 1229 | ||
1247 | void EventSelectFileByKeyPress() |
1230 | void EventSelectFileByKeyPress() |
1248 | { |
1231 | { |
Line 1438... | Line 1421... | ||
1438 | } |
1421 | } |
1439 | } |
1422 | } |
Line 1440... | Line 1423... | ||
1440 | 1423 | ||
1441 | void EventDriveClick(int __id) |
1424 | void EventDriveClick(int __id) |
1442 | { |
- | |
1443 | if (disk_popin_active_on_panel != active_panel) { |
- | |
1444 | ChangeActivePanel(); |
- | |
1445 | } |
- | |
1446 | 1425 | { |
|
1447 | SystemDiscs.Click(__id-100); |
1426 | SystemDiscs.Click(__id-100); |
1448 | if (efm) { |
1427 | if (efm) { |
1449 | draw_window(); |
1428 | draw_window(); |
1450 | } |
1429 | } |
Line 1451... | Line 1430... | ||
1451 | } |
1430 | } |
1452 | 1431 | ||
1453 | void EventOpenDiskPopin(int panel_n) |
1432 | void EventOpenDiskPopin(int panel_n) |
1454 | { |
1433 | { |
1455 | DefineHiddenButton(0,0,5000,3000,9999+BT_NOFRAME); |
1434 | DefineHiddenButton(0,0,5000,3000,9999+BT_NOFRAME); |
1456 | disk_popin_active_on_panel = panel_n; |
1435 | if (panel_n==0) { |
1457 | if (disk_popin_active_on_panel==1) { |
1436 | disk_popin_active_on_panel = 1; |
- | 1437 | SystemDiscs.DrawOptions(Form.cwidth/2-DDW, 8+DEV_H_HOR+3); |
|
1458 | SystemDiscs.DrawOptions(Form.cwidth/2-DDW, 8+DEV_H_HOR+3); |
1438 | } else { |
1459 | } else { |
1439 | disk_popin_active_on_panel = 2; |
1460 | SystemDiscs.DrawOptions(Form.cwidth-DDW-2, 8+DEV_H_HOR+3); |
1440 | SystemDiscs.DrawOptions(Form.cwidth-DDW-2, 8+DEV_H_HOR+3); |
Line 1461... | Line 1441... | ||
1461 | } |
1441 | } |