Subversion Repositories Kolibri OS

Rev

Rev 3445 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3444 leency 1
//Leency 2008-2013
2
 
3
 
4
byte copy_from[4096], cut_active=0;
5
enum {NOCUT, CUT};
6
#define WIN_W 300
7
#define WIN_H 20
8
 
9
 
10
void Copy(dword pcth, char cut)
11
{
12
	strcpy(#copy_from, pcth);
13
	cut_active = cut;
14
}
15
 
16
void copyf_Action(dword filename) {
17
	DefineAndDrawWindow(5000,0,WIN_W,WIN_H-1,0x01,col_work,0);
18
	DrawBar(WIN_W, 0, 1, WIN_H, 0x333333);
19
	DrawBar(0, 0, WIN_W, WIN_H, 0xDDDddd);
20
	WriteText(5,6, 0x80, 0, "Copying file:");
21
	WriteText(90,6, 0x80, 0, filename);
3445 leency 22
	//pause(20);
3444 leency 23
}
24
 
25
 
26
void Paste()
27
{
28
	char copy_to[4096], copy_rezult;
29
 
30
	if (!copy_from) ExitProcess();
31
	strcpy(#copy_to, #path);
32
	strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
33
	if (!strcmp(#copy_from,#copy_to))
34
	{
35
		strcpy(#copy_to, #path);
36
		strcat(#copy_to, "new_");
37
		strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
38
	}
39
	if (strstr(#copy_to, #copy_from))
40
	{
41
		notify("Copy directory into itself is a bad idea...");
42
		ExitProcess();
43
	}
3447 leency 44
	if (copy_rezult = copyf(#copy_from,#copy_to))
3444 leency 45
	{
46
		Write_Error(copy_rezult);
47
	}
3447 leency 48
	else if (cut_active)
3444 leency 49
	{
50
		strcpy(#file_path, #copy_from);
51
		Del_File(true);
52
		copy_from=NULL;
53
		cut_active=false;
54
	}
55
	ActivateWindow(GetProcessSlot(Form.ID));
56
	SendWindowMessage(evKey, 54);
57
	SelectFile(#copy_to+strrchr(#copy_to,'/'));
58
	ExitProcess();
59
}