Rev 8854 | Rev 8868 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8854 | Rev 8861 | ||
---|---|---|---|
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 -... | 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 Beta2" |
|
Line 6... | Line 7... | ||
6 | #define TITLE "Eolite File Manager 5 Beta" |
7 | #define TITLE_EOLITE "Eolite File Manager 5 Beta2" |
7 | #define ABOUT_TITLE "EOLITE 5 Beta" |
8 | #define TITLE_KFM "Kolibri File Manager 2 Beta2"; |
8 | 9 | ||
Line 123... | Line 124... | ||
123 | dword eolite_ini_path[4096]; |
124 | dword eolite_ini_path[4096]; |
124 | _ini ini; |
125 | _ini ini; |
Line 125... | Line 126... | ||
125 | 126 | ||
Line 126... | Line 127... | ||
126 | char scroll_used=false; |
127 | char scroll_used=false; |
Line 127... | Line 128... | ||
127 | 128 | ||
128 | dword about_stak=0,properties_stak=0,settings_stak=0,delete_stak=0; |
129 | dword about_stak=0,properties_stak=0,settings_stak=0; |
129 | 130 | ||
130 | proc_info Form; |
131 | proc_info Form; |
Line 197... | Line 198... | ||
197 | ESBYTE[strrchr(p, '/')+p-1] = '\0'; |
198 | ESBYTE[strrchr(p, '/')+p-1] = '\0'; |
198 | strcpy(#path, p + 3); |
199 | strcpy(#path, p + 3); |
199 | properties_dialog(); |
200 | properties_dialog(); |
200 | ExitProcess(); |
201 | ExitProcess(); |
201 | case 'd': |
202 | case 'd': |
202 | strcpy(#file_path, p + 3); |
203 | strcpy(#path, p + 3); |
203 | itdir = dir_exists(#file_path); |
- | |
204 | DisplayOperationForm(DELETE_FLAG); |
- | |
205 | DeleteSingleElement(); |
204 | DeleteThread(); |
206 | ExitProcess(); |
205 | ExitProcess(); |
207 | case 'v': |
206 | case 'v': |
208 | cut_active = ESBYTE[p+2] - '0'; |
207 | cut_active = ESBYTE[p+2] - '0'; |
209 | strcpy(#path, p + 4); |
208 | strcpy(#path, p + 4); |
210 | PasteThread(); |
209 | PasteThread(); |
Line 242... | Line 241... | ||
242 | rand_n = random(80); |
241 | rand_n = random(80); |
Line 243... | Line 242... | ||
243 | 242 | ||
Line 244... | Line 243... | ||
244 | ESBYTE[0] = NULL; |
243 | ESBYTE[0] = NULL; |
245 | - | ||
246 | SystemDiscs.Get(); |
244 | |
247 | 245 | SystemDiscs.Get(); |
|
248 | Open_Dir(#path,ONLY_OPEN); |
246 | Open_Dir(#path,ONLY_OPEN); |
249 | strcpy(#inactive_path, #path); |
247 | strcpy(#inactive_path, #path); |
250 | llist_copy(#files_inactive, #files); |
248 | llist_copy(#files_inactive, #files); |
Line 295... | Line 293... | ||
295 | { |
293 | { |
296 | if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw(); |
294 | if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw(); |
297 | if (getElementSelectedFlag(files.cur_y) == false) selected_count = 0; //on redraw selection would be flashed, see [L001] |
295 | if (getElementSelectedFlag(files.cur_y) == false) selected_count = 0; //on redraw selection would be flashed, see [L001] |
298 | EventShowListMenu(); |
296 | EventShowListMenu(); |
299 | } |
297 | } |
300 | //break; |
- | |
301 | } |
298 | } |
Line 302... | Line 299... | ||
302 | 299 | ||
303 | if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y-17) && (mouse.y |
300 | if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y-17) && (mouse.y |
304 | { |
301 | { |
Line 343... | Line 340... | ||
343 | } |
340 | } |
Line 344... | Line 341... | ||
344 | 341 | ||
345 | if (efm) && (mouse.y > files.y) && (mouse.down) { |
342 | if (efm) && (mouse.y > files.y) && (mouse.down) { |
346 | if (mouse.x |
343 | if (mouse.x |
347 | { |
344 | { |
348 | if (active_panel!=1) |
- | |
349 | { |
345 | if (active_panel!=1) { |
350 | active_panel = 1; |
346 | active_panel = 1; |
351 | ChangeActivePanel(); |
347 | ChangeActivePanel(); |
352 | } |
- | |
353 | } |
348 | } |
354 | else |
- | |
355 | { |
349 | } else { |
356 | if (active_panel!=2) |
- | |
357 | { |
350 | if (active_panel!=2) { |
358 | active_panel = 2; |
351 | active_panel = 2; |
359 | ChangeActivePanel(); |
352 | ChangeActivePanel(); |
360 | } |
353 | } |
361 | } |
354 | } |
Line 434... | Line 427... | ||
434 | 427 | ||
Line 435... | Line 428... | ||
435 | if (Form.status_window>2) break; |
428 | if (Form.status_window>2) break; |
436 | 429 | ||
437 | if (new_element_active) || (del_active) || (dev_popin_active_on_panel) |
- | |
438 | { |
430 | if (new_element_active) || (del_active) || (dev_popin_active_on_panel) |
439 | if (dev_popin_active_on_panel) { |
431 | { |
440 | if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm(); |
432 | if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm(); |
441 | } |
433 | |
442 | if (del_active) { |
- | |
443 | if (key_scancode == SCAN_CODE_ENTER) EventDelete(); |
434 | if (del_active) { |
444 | if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm(); |
435 | if (key_scancode == SCAN_CODE_ENTER) EventDelete(); |
445 | } |
436 | } |
446 | if (new_element_active) { |
- | |
447 | if (key_scancode == SCAN_CODE_ENTER) NewElement(); |
437 | if (new_element_active) { |
448 | if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm(); |
438 | if (key_scancode == SCAN_CODE_ENTER) NewElement(); |
449 | EAX = key_editbox; |
439 | EAX = key_editbox; |
450 | edit_box_key stdcall (#new_file_ed); |
440 | edit_box_key stdcall (#new_file_ed); |
451 | } |
441 | } |
Line 479... | Line 469... | ||
479 | EventSort(key_scancode - 58); |
469 | EventSort(key_scancode - 58); |
480 | break; |
470 | break; |
481 | case SCAN_CODE_1...SCAN_CODE_10: |
471 | case SCAN_CODE_1...SCAN_CODE_10: |
482 | key_scancode-=2; |
472 | key_scancode-=2; |
483 | if (key_scancode >= SystemDiscs.list.count) break; |
473 | if (key_scancode >= SystemDiscs.list.count) break; |
484 | if (!efm) |
474 | if (!efm) { |
485 | { |
- | |
486 | DrawRectangle(17,key_scancode*16+74,159,16, 0); //display click |
475 | DrawRectangle(17,key_scancode*16+74,159,16, 0); //display click |
487 | pause(7); |
476 | pause(7); |
488 | } |
477 | } |
489 | SystemDiscs.Click(key_scancode); |
478 | SystemDiscs.Click(key_scancode); |
490 | break; |
479 | break; |
491 | case SCAN_CODE_KEY_X: |
480 | case SCAN_CODE_KEY_X: |
492 | EventCopy(CUT); |
481 | CopyFilesListToClipboard(CUT); |
493 | break; |
482 | break; |
494 | case SCAN_CODE_KEY_C: |
483 | case SCAN_CODE_KEY_C: |
495 | EventCopy(NOCUT); |
484 | CopyFilesListToClipboard(COPY); |
496 | break; |
485 | break; |
497 | case SCAN_CODE_KEY_G: |
486 | case SCAN_CODE_KEY_G: |
498 | EventOpenConsoleHere(); |
487 | EventOpenConsoleHere(); |
499 | break; |
488 | break; |
500 | case SCAN_CODE_KEY_V: |
489 | case SCAN_CODE_KEY_V: |
Line 565... | Line 554... | ||
565 | break; |
554 | break; |
566 | case evIPC: |
555 | case evIPC: |
567 | case evReDraw: |
556 | case evReDraw: |
568 | draw_window(); |
557 | draw_window(); |
569 | if (CheckActiveProcess(Form.ID)) && (GetMenuClick()) break; |
558 | if (CheckActiveProcess(Form.ID)) && (GetMenuClick()) break; |
570 | if (action_buf==OPERATION_END) |
559 | if (action_buf==OPERATION_END) { |
571 | { |
- | |
572 | EventRefresh(); |
560 | EventRefresh(); |
573 | action_buf=0; |
561 | action_buf=0; |
574 | } |
562 | } |
575 | break; |
563 | break; |
576 | default: |
564 | default: |
577 | if (Form.status_window>2) break; |
- | |
578 | EventRefreshDisksAndFolders(); |
565 | if (Form.status_window<=2) EventRefreshDisksAndFolders(); |
579 | } |
566 | } |
Line 580... | Line 567... | ||
580 | 567 | ||
581 | if(cmd_free) |
568 | if(cmd_free) |
582 | { |
569 | { |
583 | if(cmd_free==2) about_stak=free(about_stak); |
570 | if(cmd_free==2) about_stak=free(about_stak); |
584 | else if(cmd_free==3) properties_stak=free(properties_stak); |
571 | else if(cmd_free==3) properties_stak=free(properties_stak); |
585 | else if(cmd_free==4) settings_stak=free(settings_stak); |
- | |
586 | else if(cmd_free==6) delete_stak=free(delete_stak); |
572 | else if(cmd_free==4) settings_stak=free(settings_stak); |
587 | cmd_free = false; |
573 | cmd_free = false; |
588 | } |
574 | } |
Line 589... | Line 575... | ||
589 | } |
575 | } |
590 | 576 | ||
591 | void draw_window() |
577 | void draw_window() |
592 | { |
578 | { |
593 | dword i=0; |
579 | dword i=0; |
594 | incn x; |
580 | incn x; |
595 | dword title; |
581 | dword title; |
596 | if (show_status_bar.checked) status_bar_h = STATUS_BAR_H; else status_bar_h = 0; |
582 | if (show_status_bar.checked) status_bar_h = STATUS_BAR_H; else status_bar_h = 0; |
597 | if (efm) title = "Kolibri File Manager 2 - BETA"; else title = TITLE; |
583 | if (efm) title = TITLE_KFM; else title = TITLE_EOLITE; |
598 | DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,title,0); |
584 | DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,title,0); |
599 | GetProcessInfo(#Form, SelfInfo); |
585 | GetProcessInfo(#Form, SelfInfo); |
600 | if (Form.status_window>2) return; |
586 | if (Form.status_window>2) return; |
Line 622... | Line 608... | ||
622 | } else { |
608 | } else { |
623 | if (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; } |
609 | if (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; } |
624 | ESDWORD[#toolbar_pal] = sc.work; |
610 | ESDWORD[#toolbar_pal] = sc.work; |
625 | ESDWORD[#toolbar_pal+4] = MixColors(0, sc.work, 35); |
611 | ESDWORD[#toolbar_pal+4] = MixColors(0, sc.work, 35); |
626 | PutPaletteImage(#toolbar, 246, 34, 0, 0, 8, #toolbar_pal); |
612 | PutPaletteImage(#toolbar, 246, 34, 0, 0, 8, #toolbar_pal); |
627 | for (i=0; i<3; i++) DefineHiddenButton(toolbar_buttons_x[i]+2,7,31-5,29-5,21+i); |
613 | for (i=0; i<3; i++) DefineHiddenButton(toolbar_buttons_x[i]+2,7,31-5,29-5,BACK_BTN+i); |
628 | for (i=3; i<6; i++) DefineHiddenButton(toolbar_buttons_x[i], 5,31, 29, 21+i); |
614 | for (i=3; i<6; i++) DefineHiddenButton(toolbar_buttons_x[i], 5,31, 29, BACK_BTN+i); |
629 | DrawBar(127, 8, 1, 25, sc.work_graph); |
615 | DrawBar(127, 8, 1, 25, sc.work_graph); |
630 | DrawBar(246,0, Form.cwidth - 246, 34, sc.work); |
616 | DrawBar(246,0, Form.cwidth - 246, 34, sc.work); |
631 | DrawDot(Form.cwidth-17,12); |
617 | DrawDot(Form.cwidth-17,12); |
632 | DrawDot(Form.cwidth-17,12+6); |
618 | DrawDot(Form.cwidth-17,12+6); |
633 | DrawDot(Form.cwidth-17,12+12); |
619 | DrawDot(Form.cwidth-17,12+12); |
Line 1191... | Line 1177... | ||
1191 | case 4: |
1177 | case 4: |
1192 | if (files.count) && (!itdir) RunProgram("/sys/develop/cedit", #file_path); |
1178 | if (files.count) && (!itdir) RunProgram("/sys/develop/cedit", #file_path); |
1193 | break; |
1179 | break; |
1194 | case 5: |
1180 | case 5: |
1195 | if (efm) { |
1181 | if (efm) { |
1196 | EventCopy(false); |
1182 | CopyFilesListToClipboard(COPY); |
1197 | EventPaste(#inactive_path); |
1183 | EventPaste(#inactive_path); |
1198 | } else { |
1184 | } else { |
1199 | EventRefresh(); |
1185 | EventRefresh(); |
1200 | } |
1186 | } |
1201 | break; |
1187 | break; |
1202 | case 6: |
1188 | case 6: |
1203 | if (efm) { |
1189 | if (efm) { |
1204 | EventCopy(true); |
1190 | CopyFilesListToClipboard(CUT); |
1205 | EventPaste(#inactive_path); |
1191 | EventPaste(#inactive_path); |
1206 | } |
1192 | } |
1207 | break; |
1193 | break; |
1208 | case 7: |
1194 | case 7: |
1209 | NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER); |
1195 | NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER); |
Line 1382... | Line 1368... | ||
1382 | RunProgram(#program_path, #paste_line); |
1368 | RunProgram(#program_path, #paste_line); |
1383 | EventClosePopinForm(); |
1369 | EventClosePopinForm(); |
1384 | } |
1370 | } |
Line 1385... | Line 1371... | ||
1385 | 1371 | ||
1386 | void EventDelete() |
- | |
1387 | char line_param[4096+5]; |
1372 | void EventDelete() |
- | 1373 | { |
|
- | 1374 | char line_param[4096+5]; |
|
1388 | { |
1375 | CopyFilesListToClipboard(DELETE); |
1389 | EventClosePopinForm(); |
- | |
1390 | if (!selected_count) { |
1376 | EventClosePopinForm(); |
1391 | sprintf(#line_param, "-d %s", #file_path); |
1377 | sprintf(#line_param, "-d %s", #file_path); |
1392 | RunProgram(#program_path, #line_param); |
- | |
1393 | } else { |
- | |
1394 | delete_stak = malloc(40000); |
- | |
1395 | CreateThread(#DeleteSelectedElements,delete_stak+40000-4); |
- | |
1396 | } |
1378 | RunProgram(#program_path, #line_param); |
Line 1397... | Line 1379... | ||
1397 | } |
1379 | } |
1398 | 1380 | ||
1399 | void EventClosePopinForm() |
1381 | void EventClosePopinForm() |
1400 | { |
1382 | { |
1401 | del_active = 0; |
1383 | del_active = 0; |
1402 | new_element_active = 0; |
1384 | new_element_active = 0; |
1403 | dev_popin_active_on_panel = 0; |
- | |
1404 | draw_window(); |
- | |
1405 | //DeleteButton(POPUP_BTN1); |
1385 | dev_popin_active_on_panel = 0; |
Line 1406... | Line 1386... | ||
1406 | //DeleteButton(POPUP_BTN2); |
1386 | draw_window(); |
1407 | } |
1387 | } |
1408 | 1388 | ||
Line 1451... | Line 1431... | ||
1451 | { |
1431 | { |
1452 | switch(_btid) { |
1432 | switch(_btid) { |
1453 | case BACK_BTN: EventHistoryGoBack(); break; |
1433 | case BACK_BTN: EventHistoryGoBack(); break; |
1454 | case FWRD_BTN: EventHistoryGoForward(); break; |
1434 | case FWRD_BTN: EventHistoryGoForward(); break; |
1455 | case GOUP_BTN: Dir_Up(); break; |
1435 | case GOUP_BTN: Dir_Up(); break; |
1456 | case COPY_BTN: EventCopy(CUT); break; |
1436 | case COPY_BTN: CopyFilesListToClipboard(CUT); break; |
1457 | case CUT_BTN: EventCopy(NOCUT); break; |
1437 | case CUT_BTN: CopyFilesListToClipboard(COPY); break; |
1458 | case PASTE_BTN:EventPaste(#path); break; |
1438 | case PASTE_BTN:EventPaste(#path); break; |
1459 | } |
1439 | } |
1460 | } |
1440 | } |
Line 1461... | Line 1441... | ||
1461 | 1441 |