Subversion Repositories Kolibri OS

Rev

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

Rev 5803 Rev 5804
Line 11... Line 11...
11
#include "..\lib\strings.h"
11
#include "..\lib\strings.h"
12
#include "..\lib\mem.h"
12
#include "..\lib\mem.h"
13
#include "..\lib\file_system.h"
13
#include "..\lib\file_system.h"
14
#include "..\lib\gui.h"
14
#include "..\lib\gui.h"
15
#include "..\lib\list_box.h"
15
#include "..\lib\list_box.h"
16
#include "..\lib\copyf.h"
-
 
17
#include "..\lib\random.h"
16
#include "..\lib\random.h"
18
#include "..\lib\font.h"
17
#include "..\lib\font.h"
19
//obj
18
//obj
20
#include "..\lib\obj\libini.h"
19
#include "..\lib\obj\libini.h"
21
#include "..\lib\obj\box_lib.h"
20
#include "..\lib\obj\box_lib.h"
Line 63... Line 62...
63
 
62
 
Line 64... Line 63...
64
dword eolite_ini_path;
63
dword eolite_ini_path;
Line 65... Line 64...
65
 
64
 
Line 66... Line 65...
66
char scroll_used=false;
65
char scroll_used=false;
67
 
66
 
68
dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak;
67
dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak,delete_stak;
69
 
68
 
Line 86... Line 85...
86
edit_box new_file_ed = {171,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0};
85
edit_box new_file_ed = {171,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0};
87
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
86
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
88
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
87
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
89
byte cmd_free=0;
88
byte cmd_free=0;
90
#include "include\translations.h"
89
#include "include\translations.h"
-
 
90
#include "include\fs.h"
91
#include "include\settings.h"
91
#include "include\settings.h"
-
 
92
#include "include\progress_dialog.h"
-
 
93
#include "..\lib\copyf.h"
92
#include "include\copy.h"
94
#include "include\copy.h"
93
#include "include\gui.h"
95
#include "include\gui.h"
94
#include "include\sorting.h"
96
#include "include\sorting.h"
95
#include "include\icons.h"
97
#include "include\icons.h"
96
#include "include\left_panel.h"
98
#include "include\left_panel.h"
Line 490... Line 492...
490
			case evIPC:
492
			case evIPC:
491
			case evReDraw:
493
			case evReDraw:
492
				draw_window();
494
				draw_window();
493
				if (action_buf) 
495
				if (action_buf) 
494
				{
496
				{
495
					if (action_buf==COPY_PASTE_END)
497
					if (action_buf==OPERATION_END)
496
					{
498
					{
497
						FnProcess(5);
499
						FnProcess(5);
498
						SelectFileByName(#copy_to+strrchr(#copy_to,'/'));
500
						SelectFileByName(#copy_to+strrchr(#copy_to,'/'));
499
					}
501
					}
500
					if (action_buf==100) Open(0);
502
					if (action_buf==100) Open(0);
Line 798... Line 800...
798
	dword selected_offset2;
800
	dword selected_offset2;
799
	int cont = 0;
801
	int cont = 0;
800
	byte f_count[128];
802
	byte f_count[128];
801
	int dform_x = files.w - 220 / 2 + files.x;
803
	int dform_x = files.w - 220 / 2 + files.x;
802
	if (!strncmp(#file_name,".",2)) || (!strncmp(#file_name,"..",2)) return;
804
	if (!strncmp(#file_name,".",2)) || (!strncmp(#file_name,"..",2)) return;
803
	if (del_active==2)
-
 
804
	{
-
 
805
		if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
-
 
806
	}
-
 
807
	else
805
	else
808
	{
806
	{
809
		if (!files.count) return;
807
		if (!files.count) return;
810
		DrawPopup(dform_x,160,220,85,1,system.color.work,system.color.work_graph);
808
		DrawPopup(dform_x,160,220,85,1,system.color.work,system.color.work_graph);
811
		WriteText(-strlen(T_DELETE_FILE)*3+110+dform_x,175,0x80,system.color.work_text,T_DELETE_FILE);
809
		WriteText(-strlen(T_DELETE_FILE)*3+110+dform_x,175,0x80,system.color.work_text,T_DELETE_FILE);
Line 838... Line 836...
838
		del_active=1;
836
		del_active=1;
839
	}
837
	}
840
}
838
}
Line 841... Line 839...
841
 
839
 
842
int del_error;
840
int del_error;
843
int Del_File2(dword way)
841
int Del_File2(dword way, sh_progr)
844
{    
842
{    
845
	dword dirbuf, fcount, i, filename;
843
	dword dirbuf, fcount, i, filename;
846
	int error;
844
	int error;
847
	char del_from[4096];
845
	char del_from[4096];
Line 853... Line 851...
853
			if (CheckEvent()==evReDraw) draw_window();
851
			if (CheckEvent()==evReDraw) draw_window();
854
			filename = i*304+dirbuf+72;
852
			filename = i*304+dirbuf+72;
855
			sprintf(#del_from,"%s/%s",way,filename);
853
			sprintf(#del_from,"%s/%s",way,filename);
856
			if ( TestBit(ESDWORD[filename-40], 4) )
854
			if ( TestBit(ESDWORD[filename-40], 4) )
857
			{
855
			{
858
				Del_File2(#del_from);
856
				Del_File2(#del_from, 1);
859
			}
857
			}
860
			else
858
			else
861
			{
859
			{
-
 
860
				if (sh_progr) Operation_Draw_Progress(#del_from);
862
				if (error = DeleteFile(#del_from)) del_error = error;
861
				if (error = DeleteFile(#del_from)) del_error = error;
863
			}
862
			}
864
		}
863
		}
865
	}
864
	}
866
	if (error = DeleteFile(way)) del_error = error;
865
	if (error = DeleteFile(way)) del_error = error;
867
}
866
}
Line 868... Line -...
868
 
-
 
869
 
867
 
870
void Del_File(byte dodel)
868
void Del_File_Thread()
871
{   
869
{   
872
	byte del_from[4096];
870
	byte del_from[4096];
873
	dword selected_offset2;
871
	dword selected_offset2;
Line -... Line 872...
-
 
872
	int tst, count, i;
-
 
873
	
-
 
874
	file_count_copy = 0;
-
 
875
	copy_bar.value = 0; 
874
	int tst, count, i;
876
	operation_flag = DELETE_FLAG;
875
	
877
	
-
 
878
	if (selected_count)
-
 
879
	{
-
 
880
   	   for (i=0; i
-
 
881
          {
-
 
882
               selected_offset2 = file_mas[i]*304 + buf+32 + 7;
-
 
883
			    if (ESBYTE[selected_offset2]) {
-
 
884
					sprintf(#del_from,"%s%s",#path,file_mas[i]*304+buf+72);
876
	if (dodel==true)
885
					GetFileInfo(#del_from, #file_info_count);
-
 
886
					if ( file_info_count.isfolder ) DirFileCount(#del_from);
-
 
887
					else file_count_copy++;
-
 
888
				}
-
 
889
           }
-
 
890
	}
877
	{
891
	else
878
		del_active=2;
892
	{
-
 
893
		if (itdir) DirFileCount(#file_path);
-
 
894
		else file_count_copy++;
-
 
895
	}
Line -... Line 896...
-
 
896
	
-
 
897
	copy_bar.max = file_count_copy;
-
 
898
	
-
 
899
	//if (dodel==true)
-
 
900
	//{
-
 
901
		//del_active=2;
879
		if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
902
		//if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
880
		del_error = 0;
903
		del_error = 0;
881
		
904
		DisplayOperationForm();
882
		if (selected_count)
905
		if (selected_count)
883
		{
906
		{
884
   		   for (i=0; i
907
   		   for (i=0; i
885
           {
908
           {
886
                selected_offset2 = file_mas[i]*304 + buf+32 + 7;
909
                selected_offset2 = file_mas[i]*304 + buf+32 + 7;
887
                if (ESBYTE[selected_offset2]) {
910
                if (ESBYTE[selected_offset2]) {
888
					sprintf(#del_from,"%s%s",#path,file_mas[i]*304+buf+72);
911
					sprintf(#del_from,"%s%s",#path,file_mas[i]*304+buf+72);
889
                    Del_File2(#del_from);
912
                    Del_File2(#del_from, 1);
890
                }
913
                }
891
            }
914
            }
892
		}
915
		}
893
		else
916
		else
894
		{
917
		{
-
 
918
		   Del_File2(#file_path, 1);			
-
 
919
		}
-
 
920
		if (del_error) Write_Error(del_error);
-
 
921
 	DialogExit();
-
 
922
	//}
-
 
923
	//del_active=0;
895
		   Del_File2(#file_path);			
924
	//DeleteButton(301);
-
 
925
	//DeleteButton(302);
-
 
926
	//Open_Dir(#path,WITH_REDRAW);
896
		}
927
}
897
		if (del_error) Write_Error(del_error);
928
 
-
 
929
void Del_File(byte dodel) {
898
 	}
930
	del_active=0;
-
 
931
	if (dodel)
-
 
932
	{
899
	del_active=0;
933
		delete_stak = malloc(20000);
900
	DeleteButton(301);
934
		CreateThread(#Del_File_Thread,delete_stak+20000-4);
901
	DeleteButton(302);
-
 
Line 902... Line 935...
902
	Open_Dir(#path,WITH_REDRAW);
935
	}
903
}
936
	else draw_window();
904
 
937
}
905
 
938