Subversion Repositories Kolibri OS

Rev

Rev 8826 | Rev 8861 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8826 Rev 8854
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
 
Line 6... Line 6...
6
#define TITLE "Eolite File Manager 4.80"
6
#define TITLE "Eolite File Manager 5 Beta"
7
#define ABOUT_TITLE "EOLITE 4.80"
7
#define ABOUT_TITLE "EOLITE 5 Beta"
8
 
8
 
Line 35... Line 35...
35
//Button IDs
35
//Button IDs
36
enum {
36
enum {
37
	PATH_BTN = 10,
37
	PATH_BTN = 10,
38
	POPUP_BTN1 = 201,
38
	POPUP_BTN1 = 201,
39
	POPUP_BTN2 = 202,
39
	POPUP_BTN2 = 202,
-
 
40
	KFM_DEV_DROPDOWN_1 = 205,
-
 
41
	KFM_DEV_DROPDOWN_2 = 207,
40
	BREADCRUMB_ID = 300
42
	BREADCRUMB_ID = 300,
-
 
43
 
-
 
44
	BACK_BTN = 400,
-
 
45
	FWRD_BTN,
-
 
46
	GOUP_BTN,
-
 
47
	COPY_BTN,
-
 
48
	CUT_BTN,
-
 
49
	PASTE_BTN
41
};
50
};
Line 42... Line 51...
42
 
51
 
43
//NewElement options
52
//NewElement options
44
enum {
53
enum {
Line 83... Line 92...
83
bool active_settings = false;
92
bool active_settings = false;
84
bool _not_draw = false;
93
bool _not_draw = false;
85
bool exif_load = false;
94
bool exif_load = false;
86
bool dir_at_fat16 = NULL;
95
bool dir_at_fat16 = NULL;
Line -... Line 96...
-
 
96
 
-
 
97
bool dev_popin_active_on_panel=0;
87
 
98
 
88
word about_thread_id;
99
dword about_thread_id;
Line 89... Line 100...
89
word settings_window;
100
dword settings_window;
90
 
101
 
Line 91... Line 102...
91
byte del_active=0;
102
byte del_active=0;
Line 239... Line 250...
239
	llist_copy(#files_inactive, #files);
250
	llist_copy(#files_inactive, #files);
240
	SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
251
	SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
241
	loop() switch(@WaitEventTimeout(80))
252
	loop() switch(@WaitEventTimeout(80))
242
	{
253
	{
243
		case evMouse:
254
		case evMouse:
244
			if (del_active) || (Form.status_window>2) break;
255
			if (del_active) || (dev_popin_active_on_panel) || (Form.status_window>2) break;
245
			if (new_element_active) 
256
			if (new_element_active) 
246
			{
257
			{
247
				edit_box_mouse stdcall(#new_file_ed);
258
				edit_box_mouse stdcall(#new_file_ed);
248
				break;
259
				break;
249
			}				
260
			}				
Line 329... Line 340...
329
				if (files.first<0) files.first=0;
340
				if (files.first<0) files.first=0;
330
				if (id!=files.first) List_ReDraw();
341
				if (id!=files.first) List_ReDraw();
331
				break;
342
				break;
332
			}
343
			}
Line 333... Line 344...
333
 
344
 
334
			if (two_panels.checked) && (mouse.y > files.y) && (mouse.down) {
345
			if (efm) && (mouse.y > files.y) && (mouse.down) {
335
				if (mouse.x
346
				if (mouse.x
336
				{
347
				{
337
					if (active_panel!=1)
348
					if (active_panel!=1)
338
					{
349
					{
Line 352... Line 363...
352
			break;  
363
			break;  
353
//Button pressed-----------------------------------------------------------------------------
364
//Button pressed-----------------------------------------------------------------------------
354
		case evButton:
365
		case evButton:
355
			id = GetButtonID();
366
			id = GetButtonID();
Line 356... Line 367...
356
 
367
 
357
			if (new_element_active) || (del_active) {
368
			if (new_element_active) || (del_active) || (dev_popin_active_on_panel) {
358
				if (POPUP_BTN1==id) && (del_active) EventDelete();
369
				if (POPUP_BTN1==id) && (del_active) EventDelete();
359
				if (POPUP_BTN1==id) && (new_element_active) NewElement();
370
				if (POPUP_BTN1==id) && (new_element_active) NewElement();
-
 
371
				if (POPUP_BTN2==id) EventClosePopinForm();
360
				if (POPUP_BTN2==id) EventClosePopinForm();
372
				if (dev_popin_active_on_panel) EventDriveClick(id);
361
				break;					
373
				break;					
Line 362... Line 374...
362
			}
374
			}
363
 
375
 
Line 369... Line 381...
369
						ExitProcess();
381
						ExitProcess();
370
				case PATH_BTN:
382
				case PATH_BTN:
371
						notify(COPY_PATH_STR);
383
						notify(COPY_PATH_STR);
372
						Clipboard__CopyText(#path);
384
						Clipboard__CopyText(#path);
373
						break;
385
						break;
374
				case 21: //Back
386
				case KFM_DEV_DROPDOWN_1:
375
						EventHistoryGoBack();
387
				case KFM_DEV_DROPDOWN_1+1:
376
						break;
-
 
377
				case 22: //Forward
388
						dev_popin_active_on_panel = 1;
378
						EventHistoryGoForward();
389
						SystemDiscs.DrawOptions(Form.cwidth/2-DDW, 8+DEV_H_HOR+3);
379
						break;
390
						break;
380
				case 23:
391
				case KFM_DEV_DROPDOWN_2:
381
						Dir_Up();
392
				case KFM_DEV_DROPDOWN_2+1:
382
						break;
393
						dev_popin_active_on_panel = 2;
383
				case 24:
-
 
384
						EventCopy(CUT);
394
						SystemDiscs.DrawOptions(Form.cwidth-DDW-2, 8+DEV_H_HOR+3);
385
						break;
395
						break;
-
 
396
				case BACK_BTN...PASTE_BTN:
-
 
397
						if (active_panel==2) {
-
 
398
							active_panel = 1;
-
 
399
							ChangeActivePanel();
386
				case 25:
400
						}
387
						EventCopy(NOCUT);
401
						EventToolbarButtonClick(id);
388
						break;
402
						break;
-
 
403
				case BACK_BTN+100...PASTE_BTN+100:
-
 
404
						if (active_panel==1) {
389
				case 26:
405
							active_panel = 2;
390
						EventPaste();
406
							ChangeActivePanel();
-
 
407
						}
-
 
408
						EventToolbarButtonClick(id-100);
391
						break;
409
						break;
392
				case 31...33:
410
				case 31...33:
393
						EventSort(id-30);
411
						EventSort(id-30);
394
						break;
412
						break;
395
				case 51:
413
				case 51:
Line 400... Line 418...
400
						break;
418
						break;
401
				case 61: // Set path as default
419
				case 61: // Set path as default
402
						SetDefaultPath(#path);
420
						SetDefaultPath(#path);
403
						break;
421
						break;
404
				case 100...120:
422
				case 100...120:
405
					SystemDiscs.Click(id-100);
423
					EventDriveClick(id);
406
					break;
424
					break;
407
				case BREADCRUMB_ID...360:
425
				case BREADCRUMB_ID...360:
408
					ClickOnBreadCrumb(id-BREADCRUMB_ID);
426
					ClickOnBreadCrumb(id-BREADCRUMB_ID);
409
					break;
427
					break;
410
			}
428
			}
Line 414... Line 432...
414
		case evKey:
432
		case evKey:
415
			GetKeys();
433
			GetKeys();
Line 416... Line 434...
416
 
434
 
Line 417... Line 435...
417
			if (Form.status_window>2) break;
435
			if (Form.status_window>2) break;
418
 
-
 
419
			if (new_element_active) || (del_active)
-
 
420
			{
436
 
-
 
437
			if (new_element_active) || (del_active) || (dev_popin_active_on_panel)
-
 
438
			{
-
 
439
				if (dev_popin_active_on_panel) {
-
 
440
					if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm();
421
				if (del_active)
441
				}
422
				{
442
				if (del_active) {
423
					if (key_scancode == SCAN_CODE_ENTER) EventDelete();
443
					if (key_scancode == SCAN_CODE_ENTER) EventDelete();
424
					if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm();
444
					if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm();
425
				}
-
 
426
				if (new_element_active)
445
				}
427
				{
446
				if (new_element_active) {
428
					if (key_scancode == SCAN_CODE_ENTER) NewElement();
447
					if (key_scancode == SCAN_CODE_ENTER) NewElement();
429
					if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm();
448
					if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm();
430
					EAX = key_editbox;
449
					EAX = key_editbox;
Line 460... Line 479...
460
							EventSort(key_scancode - 58);
479
							EventSort(key_scancode - 58);
461
							break;
480
							break;
462
					case SCAN_CODE_1...SCAN_CODE_10:
481
					case SCAN_CODE_1...SCAN_CODE_10:
463
							key_scancode-=2;
482
							key_scancode-=2;
464
							if (key_scancode >= SystemDiscs.list.count) break;
483
							if (key_scancode >= SystemDiscs.list.count) break;
465
							if (!two_panels.checked)
484
							if (!efm)
466
							{
485
							{
467
								DrawRectangle(17,key_scancode*16+74,159,16, 0); //display click
486
								DrawRectangle(17,key_scancode*16+74,159,16, 0); //display click
468
								pause(7);										
487
								pause(7);										
469
							}
488
							}
470
							SystemDiscs.Click(key_scancode);
489
							SystemDiscs.Click(key_scancode);
Line 477... Line 496...
477
							break;
496
							break;
478
					case SCAN_CODE_KEY_G:
497
					case SCAN_CODE_KEY_G:
479
							EventOpenConsoleHere();
498
							EventOpenConsoleHere();
480
							break;
499
							break;
481
					case SCAN_CODE_KEY_V:
500
					case SCAN_CODE_KEY_V:
482
							EventPaste();
501
							EventPaste(#path);
483
							break;
502
							break;
484
					case SCAN_CODE_KEY_D: //set image as bg
503
					case SCAN_CODE_KEY_D: //set image as bg
485
							strlcpy(#temp, "\\S__",4);
504
							strlcpy(#temp, "\\S__",4);
486
							strcat(#temp, #file_path);
505
							strcat(#temp, #file_path);
487
							RunProgram("/sys/media/kiv", #temp);
506
							RunProgram("/sys/media/kiv", #temp);
Line 490... Line 509...
490
							EventOpenNewEolite();
509
							EventOpenNewEolite();
491
							break; 
510
							break; 
492
					case SCAN_CODE_KEY_M:
511
					case SCAN_CODE_KEY_M:
493
							Open_Dir(#inactive_path,WITH_REDRAW);
512
							Open_Dir(#inactive_path,WITH_REDRAW);
494
							break; 
513
							break; 
-
 
514
					case SCAN_CODE_KEY_R:
-
 
515
							EventRefresh();
-
 
516
							break;
495
					case SCAN_CODE_ENTER:
517
					case SCAN_CODE_ENTER:
496
							if (!itdir) ShowOpenWithDialog();
518
							if (!itdir) ShowOpenWithDialog();
497
							else EventOpen(1);
519
							else EventOpen(1);
498
							break;
520
							break;
499
					case SCAN_CODE_KEY_A:
521
					case SCAN_CODE_KEY_A:
Line 507... Line 529...
507
			}
529
			}
Line 508... Line 530...
508
 
530
 
509
			switch (key_scancode)
531
			switch (key_scancode)
510
			{
532
			{
511
					case SCAN_CODE_BS:
-
 
512
							//EventHistoryGoBack();
533
					case SCAN_CODE_BS:
513
							Dir_Up();
534
							Dir_Up();
514
							break; 
535
							break; 
515
					case SCAN_CODE_ENTER:
536
					case SCAN_CODE_ENTER:
516
							EventOpen(0);
537
							EventOpen(0);
517
							break; 
538
							break; 
518
					case SCAN_CODE_TAB:
539
					case SCAN_CODE_TAB:
519
							if (!two_panels.checked) break;
540
							if (!efm) break;
520
							if (active_panel==1) active_panel=2; else active_panel=1;
541
							if (active_panel==1) active_panel=2; else active_panel=1;
521
							ChangeActivePanel();
542
							ChangeActivePanel();
522
							DrawFilePanels();
543
							DrawFilePanels();
523
							break;
544
							break;
Line 546... Line 567...
546
		case evReDraw:
567
		case evReDraw:
547
			draw_window();
568
			draw_window();
548
			if (CheckActiveProcess(Form.ID)) && (GetMenuClick()) break;
569
			if (CheckActiveProcess(Form.ID)) && (GetMenuClick()) break;
549
			if (action_buf==OPERATION_END)
570
			if (action_buf==OPERATION_END)
550
			{
571
			{
551
				FnProcess(5);
572
				EventRefresh();
552
				action_buf=0;
573
				action_buf=0;
553
			}
574
			}
554
		break;
575
		break;
555
		default:
576
		default:
556
			if (Form.status_window>2) break;
577
			if (Form.status_window>2) break;
Line 567... Line 588...
567
	}
588
	}
568
}
589
}
Line 569... Line 590...
569
 
590
 
570
void draw_window()
591
void draw_window()
571
{
592
{
572
	dword i;
593
	dword i=0;
-
 
594
	incn x;
573
	incn x;
595
	dword title;
-
 
596
	if (show_status_bar.checked) status_bar_h = STATUS_BAR_H; else status_bar_h = 0;
574
	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;
575
	DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,TITLE,0);
598
	DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,title,0);
576
	GetProcessInfo(#Form, SelfInfo);
599
	GetProcessInfo(#Form, SelfInfo);
577
	if (Form.status_window>2) return;
600
	if (Form.status_window>2) return;
578
	if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; }
601
	if (Form.height < 356) { MoveSize(OLD,OLD,OLD,356); return; }
579
	GetProcessInfo(#Form, SelfInfo);
602
	GetProcessInfo(#Form, SelfInfo);
580
	SetAppColors();
603
	SetAppColors();
581
	if (two_panels.checked) {
604
	if (efm) {
582
		if (Form.width < 573) { MoveSize(OLD,OLD,573,OLD); return; }
605
		if (screen.width > 693) && (Form.width < 693) { MoveSize(OLD,OLD,693,OLD); return; }
583
		DrawBar(0, 0, Form.cwidth, 34, sc.work);
606
		DrawBar(0, 0, Form.cwidth, 34, sc.work);
584
		#define PAD 7
607
		#define PAD 7
585
		#define GAP_S 26+5
608
		#define GAP_S 26+5
-
 
609
		#define GAP_B 26+14
586
		#define GAP_B 26+14
610
		x.set(Form.cwidth/2-DDW-203/2-GAP_S);
587
		x.set(-GAP_S+8);
611
		while (i<200) {
588
		DrawTopPanelButton(21, x.inc(GAP_S), PAD, 30, false);
612
			DrawTopPanelButton(i+BACK_BTN, x.inc(GAP_S), PAD, 30, false);
589
		DrawTopPanelButton(22, x.inc(GAP_S), PAD, 31, false);
613
			DrawTopPanelButton(i+FWRD_BTN, x.inc(GAP_S), PAD, 31, false);
590
		DrawTopPanelButton(23, x.inc(GAP_B), PAD, 01, false);
614
			DrawTopPanelButton(i+GOUP_BTN, x.inc(GAP_B), PAD, 01, false);
591
		DrawTopPanelButton(24, x.inc(GAP_B), PAD, 55, false);
615
			DrawTopPanelButton(i+COPY_BTN, x.inc(GAP_B), PAD, 55, false);
592
		DrawTopPanelButton(25, x.inc(GAP_S), PAD, 20, false);
616
			DrawTopPanelButton(i+CUT_BTN,  x.inc(GAP_S), PAD, 20, false);
-
 
617
			DrawTopPanelButton(i+PASTE_BTN,x.inc(GAP_S), PAD, 56, false);
-
 
618
			x.set(Form.cwidth/2-DDW-203/2-GAP_S+calc(Form.cwidth/2));
-
 
619
			i+=100;
593
		DrawTopPanelButton(26, x.inc(GAP_S), PAD, 56, false);
620
		}
594
		DrawTopPanelButton(51, Form.cwidth-GAP_S-PAD, PAD, -1, false); //burger menu
621
		//DrawTopPanelButton(51, Form.cwidth-GAP_S-PAD, PAD, -1, false); //burger menu
595
	} else {
622
	} else {
596
		if (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; }
623
		if (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; }
597
		ESDWORD[#toolbar_pal] = sc.work;
624
		ESDWORD[#toolbar_pal] = sc.work;
598
		ESDWORD[#toolbar_pal+4] = MixColors(0, sc.work, 35);
625
		ESDWORD[#toolbar_pal+4] = MixColors(0, sc.work, 35);
Line 614... Line 641...
614
	llist_copy(#files_active, #files);
641
	llist_copy(#files_active, #files);
615
	strcpy(#active_path, #path);
642
	strcpy(#active_path, #path);
616
	DrawStatusBar();
643
	DrawStatusBar();
617
	if (!selected_count) Open_Dir(#path,ONLY_OPEN); //if there are no selected files -> refresh folder [L001] 
644
	if (!selected_count) Open_Dir(#path,ONLY_OPEN); //if there are no selected files -> refresh folder [L001] 
618
	DrawFilePanels();
645
	DrawFilePanels();
-
 
646
	dev_popin_active_on_panel = 0;
619
}
647
}
Line 620... Line 648...
620
 
648
 
621
void DrawList() 
649
void DrawList() 
622
{
650
{
Line 631... Line 659...
631
	if (sort_type==1) sorting_arrow_x = files.w - 141 / 2 + files.x + 18;
659
	if (sort_type==1) sorting_arrow_x = files.w - 141 / 2 + files.x + 18;
632
	if (sort_type==2) sorting_arrow_x = files.x + files.w - 90;
660
	if (sort_type==2) sorting_arrow_x = files.x + files.w - 90;
633
	if (sort_type==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
661
	if (sort_type==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
634
	WriteText(sorting_arrow_x,files.y-12,0x80, sc.work_text, sorting_arrow_t);
662
	WriteText(sorting_arrow_x,files.y-12,0x80, sc.work_text, sorting_arrow_t);
635
	DrawBar(files.x+files.w,files.y,1,files.h,sc.work_graph);
663
	DrawBar(files.x+files.w,files.y,1,files.h,sc.work_graph);
636
	if (two_panels.checked) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,sc.work_graph);	
664
	if (efm) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,sc.work_graph);	
637
}
665
}
Line 638... Line 666...
638
 
666
 
639
void DrawStatusBar()
667
void DrawStatusBar()
640
{
668
{
641
	char status_bar_str[80];
669
	char status_bar_str[80];
-
 
670
	int go_up_folder_exists=0;
-
 
671
 
-
 
672
	if (efm) { 
-
 
673
		DrawBar(0, Form.cheight - status_bar_h, Form.cwidth,  status_bar_h, sc.work);
-
 
674
		WriteTextCenter(0,Form.cheight - 12, Form.cwidth,sc.work_text,T_KFM_FUNC);
-
 
675
		return;
-
 
676
	}
642
	int go_up_folder_exists=0;
677
 
643
	if (!show_status_bar.checked) return;
678
	if (!show_status_bar.checked) return;
644
	if (files.count>0) && (streq(items.get(0)*304+buf+72,"..")) go_up_folder_exists=1;
679
	if (files.count>0) && (streq(items.get(0)*304+buf+72,"..")) go_up_folder_exists=1;
645
	DrawBar(0, Form.cheight - status_bar_h, Form.cwidth,  status_bar_h, sc.work);
680
	DrawBar(0, Form.cheight - status_bar_h, Form.cwidth,  status_bar_h, sc.work);
646
	sprintf(#status_bar_str, T_STATUS_EVEMENTS, count_dir-go_up_folder_exists, files.count-count_dir);
681
	sprintf(#status_bar_str, T_STATUS_EVEMENTS, count_dir-go_up_folder_exists, files.count-count_dir);
Line 655... Line 690...
655
void DrawFilePanels()
690
void DrawFilePanels()
656
{
691
{
657
	int files_y;
692
	int files_y;
658
	int w2 = -Form.cwidth-1/2+Form.cwidth;
693
	int w2 = -Form.cwidth-1/2+Form.cwidth;
659
	int h2;
694
	int h2;
660
	if (!two_panels.checked)
695
	if (!efm)
661
	{
696
	{
662
		DrawDeviceAndActionsLeftPanel();
697
		DrawDeviceAndActionsLeftPanel();
663
		files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59 - status_bar_h, files.item_h);
698
		files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59 - status_bar_h, files.item_h);
664
		DrawList();
699
		DrawList();
665
		Open_Dir(#path,ONLY_SHOW);
700
		Open_Dir(#path,ONLY_SHOW);
Line 853... Line 888...
853
			strcpy(#label_file_name+strlen(#label_file_name)-2, "...");			
888
			strcpy(#label_file_name+strlen(#label_file_name)-2, "...");			
854
		}
889
		}
855
		kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y, 
890
		kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y, 
856
			bgcol, text_col, kfont.size.pt, #label_file_name);
891
			bgcol, text_col, kfont.size.pt, #label_file_name);
857
	}
892
	}
858
	if (bgcol == col.selec_inactive) DrawWideRectangle(files.x+2, y, files.w-4, files.item_h, 2, 0x92B1D9);
893
	if (bgcol == col.selec_inactive) DrawWideRectangle(files.x+2, y, files.w-4, files.item_h, 2, col.selec_active);
Line 859... Line 894...
859
 
894
 
860
	sprintf(#full_path,"%s/%s",#path,file_name_off);
895
	sprintf(#full_path,"%s/%s",#path,file_name_off);
861
	DrawIconByExtension(#full_path, ext1, files.x+4, icon_y, bgcol);
896
	DrawIconByExtension(#full_path, ext1, files.x+4, icon_y, bgcol);
Line 878... Line 913...
878
		}
913
		}
879
		if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
914
		if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
880
	}
915
	}
881
	if (files.count!=-1)
916
	if (files.count!=-1)
882
	{
917
	{
883
		if(!_not_draw) if (show_breadcrumb.checked) DrawBreadCrumbs(); else DrawPathBar();
918
		if(!_not_draw) DrawPathBar();
884
		history.add(#path);
919
		history.add(#path);
885
		SystemDiscs.Draw();
920
		SystemDiscs.Draw();
886
		files.visible = files.h / files.item_h;
921
		files.visible = files.h / files.item_h;
887
		if (files.count < files.visible) files.visible = files.count;
922
		if (files.count < files.visible) files.visible = files.count;
888
		if (!strncmp(dir_path, "/rd/1/",5)) 
923
		if (!strncmp(dir_path, "/rd/1/",5)) 
Line 1154... Line 1189...
1154
			if (files.count) && (!itdir) RunProgram("/sys/quark", #file_path);
1189
			if (files.count) && (!itdir) RunProgram("/sys/quark", #file_path);
1155
			break;
1190
			break;
1156
		case 4:
1191
		case 4:
1157
			if (files.count) && (!itdir) RunProgram("/sys/develop/cedit", #file_path);
1192
			if (files.count) && (!itdir) RunProgram("/sys/develop/cedit", #file_path);
1158
			break;
1193
			break;
1159
		case 5: //refresh cur dir & devs
1194
		case 5:
1160
			if (two_panels.checked)
1195
			if (efm) {
1161
			{
1196
				EventCopy(false);
1162
				DrawFilePanels();
1197
				EventPaste(#inactive_path);
1163
			} else {
1198
			} else {
1164
				Tip(56, T_DEVICES, 55, "-");
-
 
1165
				Open_Dir(#path,WITH_REDRAW);
-
 
1166
				pause(10);
-
 
1167
				SystemDiscs.Get();
1199
				EventRefresh();
1168
				Open_Dir(#path,WITH_REDRAW);
-
 
1169
				DrawDeviceAndActionsLeftPanel();				
-
 
1170
			}
1200
			}
1171
			break;
1201
			break;
1172
		case 6:
1202
		case 6:
-
 
1203
			if (efm) {
-
 
1204
				EventCopy(true);
-
 
1205
				EventPaste(#inactive_path);
1173
			//Move
1206
			}
1174
			break;
1207
			break;
1175
		case 7:
1208
		case 7:
1176
			NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER);
1209
			NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER);
1177
			break;
1210
			break;
1178
		case 8:
1211
		case 8:
Line 1194... Line 1227...
1194
			}
1227
			}
1195
			break;
1228
			break;
1196
	}
1229
	}
1197
}
1230
}
Line -... Line 1231...
-
 
1231
 
-
 
1232
void EventRefresh()
-
 
1233
{
-
 
1234
	if (efm)
-
 
1235
	{
-
 
1236
		DrawFilePanels();
-
 
1237
	} else {
-
 
1238
		Tip(56, T_DEVICES, 55, "-");
-
 
1239
		Open_Dir(#path,WITH_REDRAW);
-
 
1240
		pause(10);
-
 
1241
		SystemDiscs.Get();
-
 
1242
		Open_Dir(#path,WITH_REDRAW);
-
 
1243
		DrawDeviceAndActionsLeftPanel();				
-
 
1244
	}
-
 
1245
}
1198
 
1246
 
1199
void ChangeActivePanel()
1247
void ChangeActivePanel()
1200
{
1248
{
1201
	llist_copy(#files_active, #files_inactive);
1249
	llist_copy(#files_active, #files_inactive);
1202
	llist_copy(#files_inactive, #files);
1250
	llist_copy(#files_inactive, #files);
Line 1244... Line 1292...
1244
}
1292
}
Line 1245... Line 1293...
1245
 
1293
 
1246
void EventRefreshDisksAndFolders()
1294
void EventRefreshDisksAndFolders()
1247
{
1295
{
1248
	if(GetRealFileCountInFolder("/")+dir_exists("/kolibrios") != SystemDiscs.dev_num) {
1296
	if(GetRealFileCountInFolder("/")+dir_exists("/kolibrios") != SystemDiscs.dev_num) {
1249
		FnProcess(5);
1297
		EventRefresh();
1250
	}
1298
	}
1251
	if(two_panels.checked)
1299
	if(efm)
1252
	{
1300
	{
1253
		if(GetRealFileCountInFolder(#inactive_path) != files_inactive.count) {
1301
		if(GetRealFileCountInFolder(#inactive_path) != files_inactive.count) {
1254
			ChangeActivePanel();
1302
			ChangeActivePanel();
1255
			Open_Dir(#path,WITH_REDRAW);
1303
			Open_Dir(#path,WITH_REDRAW);
1256
			ChangeActivePanel();
1304
			ChangeActivePanel();
1257
		}
1305
		}
1258
		if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW);
-
 
1259
	}
1306
		if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW);
1260
	else
-
 
1261
	{
1307
	} else {
1262
		if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW);
1308
		if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW);
1263
	}
1309
	}
Line 1264... Line 1310...
1264
}
1310
}
Line 1328... Line 1374...
1328
			}
1374
			}
1329
		}
1375
		}
1330
	}
1376
	}
1331
}
1377
}
Line 1332... Line 1378...
1332
 
1378
 
1333
void EventPaste() {
1379
void EventPaste(dword _into_path) {
1334
	char paste_line[4096+6];
1380
	char paste_line[4096+6];
1335
	sprintf(#paste_line, "-v%i %s", cut_active, #path);
1381
	sprintf(#paste_line, "-v%i %s", cut_active, _into_path);
1336
	RunProgram(#program_path, #paste_line);
1382
	RunProgram(#program_path, #paste_line);
1337
	EventClosePopinForm();
1383
	EventClosePopinForm();
Line 1338... Line 1384...
1338
}
1384
}
Line 1352... Line 1398...
1352
 
1398
 
1353
void EventClosePopinForm()
1399
void EventClosePopinForm()
1354
{
1400
{
1355
	del_active=0;
1401
	del_active = 0;
-
 
1402
	new_element_active = 0;
1356
	new_element_active = 0;
1403
	dev_popin_active_on_panel = 0;
1357
	draw_window();
1404
	draw_window();
1358
	DeleteButton(POPUP_BTN1);
1405
	//DeleteButton(POPUP_BTN1);
1359
	DeleteButton(POPUP_BTN2);
1406
	//DeleteButton(POPUP_BTN2);
Line 1360... Line 1407...
1360
}
1407
}
1361
 
1408
 
1362
void EventShowProperties()
1409
void EventShowProperties()
Line 1398... Line 1445...
1398
	for (i=0; i
1445
	for (i=0; i
1399
	List_ReDraw();
1446
	List_ReDraw();
1400
	DrawStatusBar();
1447
	DrawStatusBar();
1401
}
1448
}
Line -... Line 1449...
-
 
1449
 
-
 
1450
void EventToolbarButtonClick(int _btid)
-
 
1451
{
-
 
1452
	switch(_btid) {
-
 
1453
		case BACK_BTN: EventHistoryGoBack(); break;
-
 
1454
		case FWRD_BTN: EventHistoryGoForward(); break;
-
 
1455
		case GOUP_BTN: Dir_Up(); break;
-
 
1456
		case COPY_BTN: EventCopy(CUT); break;
-
 
1457
		case CUT_BTN:  EventCopy(NOCUT); break;
-
 
1458
		case PASTE_BTN:EventPaste(#path); break;		
-
 
1459
	}
-
 
1460
}
-
 
1461
 
-
 
1462
void EventDriveClick(int __id)
-
 
1463
{
-
 
1464
	if (dev_popin_active_on_panel != active_panel) {
-
 
1465
		if (active_panel == 1) active_panel=2; else active_panel=1;
-
 
1466
		ChangeActivePanel();
Line -... Line 1467...
-
 
1467
	}
-
 
1468
 
-
 
1469
	SystemDiscs.Click(__id-100);
-
 
1470
	if (efm) {
-
 
1471
		draw_window();
Line 1402... Line 1472...
1402
 
1472
	}