Subversion Repositories Kolibri OS

Rev

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

Rev 3399 Rev 3404
Line 23... Line 23...
23
#define ONLY_SHOW	0
23
#define ONLY_SHOW	0
24
#define WITH_REDRAW	1
24
#define WITH_REDRAW	1
25
#define ONLY_OPEN	2
25
#define ONLY_OPEN	2
Line 26... Line 26...
26
 
26
 
27
//ïåðåìåííûå
27
//ïåðåìåííûå
28
#define title "Eolite File Manager v1.63"
28
#define title "Eolite File Manager v1.64"
29
dword col_work    = 0xE4DFE1;
29
dword col_work    = 0xE4DFE1;
30
dword col_border  = 0x819FC5;
30
dword col_border  = 0x819FC5;
31
dword col_padding = 0xC8C9C9;
31
dword col_padding = 0xC8C9C9;
32
dword col_selec   = 0x94AECE;
32
dword col_selec   = 0x94AECE;
Line 48... Line 48...
48
     isdir;
48
     isdir;
49
unsigned char
49
unsigned char
50
	path[4096],
50
	path[4096],
51
	edit_path[4096],
51
	edit_path[4096],
52
	file_path[4096],
52
	file_path[4096],
53
	file_name[4096],
53
	file_name[256],
54
	copy_file[4096],
54
	copy_file[4096],
55
	temp[4096];
55
	temp[4096];
56
int scroll_size;
56
int scroll_size;
Line 57... Line 57...
57
 
57
 
Line 693... Line 693...
693
}
693
}
Line 694... Line 694...
694
 
694
 
695
	
695
	
696
void Del_File(byte dodel)
696
void Del_File(byte dodel)
697
{    
697
{    
698
	int del_file_rez;
698
	int del_rezult;
699
	IF (dodel==true)
699
	IF (dodel==true)
700
	{
700
	{
701
		del_file_rez = DeleteFile(#file_path);
701
		del_rezult = DeleteFile(#file_path);
702
		IF (del_file_rez<>0)
702
		IF (del_rezult<>0)
703
		{
703
		{
704
			Write_Error(del_file_rez);
704
			Write_Error(del_rezult);
705
			IF ( isdir) ShowMessage("Error. Folder isn't empty.");
705
			IF ( isdir) ShowMessage("Error. Folder isn't empty.");
706
			IF (!isdir) ShowMessage("Error. Filesystem read-only.");
706
			IF (!isdir) ShowMessage("Error. Filesystem read-only.");
707
		}
707
		}
Line 724... Line 724...
724
		strcpy(#new_copy_path, #path);
724
		strcpy(#new_copy_path, #path);
725
		strcat(#new_copy_path, "new_");
725
		strcat(#new_copy_path, "new_");
726
		strcat(#new_copy_path, #copy_file+strrchr(#copy_file,'/'));
726
		strcat(#new_copy_path, #copy_file+strrchr(#copy_file,'/'));
727
	}
727
	}
728
	copy_rezult=CopyFile(#copy_file,#new_copy_path);
728
	copy_rezult = CopyFile(#copy_file,#new_copy_path);
729
	IF (copy_rezult<>0) //îøèáêà
729
	IF (copy_rezult!=0) //îøèáêà
730
	{
730
	{
731
		Write_Error(copy_rezult);
731
		Write_Error(copy_rezult);
732
		DrawFlatButton(Form.width/2-13,160,200,80,0,0xFFB6B5, "Error. You can't paste here.");
-
 
733
		pause(150);
732
		return;
734
	}
733
	}
735
	IF (cut_active) //åñëè ìû âûáðàëè âûðåçàòü
734
	IF (cut_active) //åñëè ìû âûáðàëè âûðåçàòü
736
		{
735
	{
737
			strcpy(#file_path, #copy_file);
736
		strcpy(#file_path, #copy_file);
738
			Del_File(true);
737
		Del_File(true);
Line 743... Line 742...
743
}
742
}
Line 744... Line 743...
744
 
743
 
745
 
744
 
746
void ReName(byte rename)
745
void ReName(byte rename)
747
{
746
{
748
	int del_file_rez;
747
	int del_rezult, copy_rezult;
749
	char edit_name[256];
748
	char edit_name[256];
750
	rename_active=0;
749
	rename_active=0;
751
	edit2.flags=64;
750
	edit2.flags=64;
Line 756... Line 755...
756
		strcpy(#edit_name, #file_name); //ñîõðàíÿåì íîâîå èìÿ ôàéëà, äëÿ òîãî, ÷òîáû åãî ïîòîì âûäåëèòü
755
		strcpy(#edit_name, #file_name); //ñîõðàíÿåì íîâîå èìÿ ôàéëà, äëÿ òîãî, ÷òîáû åãî ïîòîì âûäåëèòü
757
		strcat(#temp, #file_name);
756
		strcat(#temp, #file_name);
758
		if (strcmp(#file_path,#temp)<>0) && (file_name)
757
		if (strcmp(#file_path,#temp)<>0) && (file_name)
759
		IF (isdir)
758
		IF (isdir)
760
		{
759
		{
761
			del_file_rez = DeleteFile(#file_path);
760
			del_rezult = DeleteFile(#file_path);
762
			IF (del_file_rez<>0)
761
			IF (del_rezult!=0)
763
			{
762
			{
764
				Write_Error(del_file_rez);
763
				Write_Error(del_rezult);
765
				ShowMessage("Error. Folder isn't empty.");
764
				ShowMessage("Error. Folder isn't empty.");
766
				return;
765
				return;
767
			}
766
			}
768
			ELSE CreateDir(#temp);
767
			ELSE CreateDir(#temp);
769
			Open_Dir(#path,1);
768
			Open_Dir(#path,1);
770
		}
769
		}
771
		ELSE
770
		ELSE
772
		{
771
		{
773
			CopyFile(#file_path,#temp);
772
			copy_rezult = CopyFile(#file_path,#temp);
774
			Del_File(true);
773
			if (copy_rezult!=0) Write_Error(copy_rezult); else Del_File(true);
775
		}
774
		}
776
		SelectFile(#edit_name);
775
		SelectFile(#edit_name);
777
	}
776
	}
778
	Line_ReDraw(col_selec,curbtn);
777
	Line_ReDraw(col_selec,curbtn);
779
}
778
}