Subversion Repositories Kolibri OS

Rev

Rev 3695 | 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
3883 leency 7
#define WIN_H 50
3444 leency 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) {
3883 leency 17
	DefineAndDrawWindow(Form.left+Form.width-200,Form.top+90,WIN_W,GetSkinHeight()+WIN_H-1,0x34,col_work,T_PASTE_WINDOW);
18
	WriteText(5,8, 0x80, 0, T_PASTE_WINDOW_TEXT);
19
	DrawBar(5, 26, WIN_W-10, 10, col_work);
20
	WriteText(5,26, 0x80, 0, filename);
3445 leency 21
	//pause(20);
3444 leency 22
}
23
 
24
 
25
void Paste()
26
{
27
	char copy_to[4096], copy_rezult;
28
 
29
	if (!copy_from) ExitProcess();
30
	strcpy(#copy_to, #path);
31
	strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
32
	if (!strcmp(#copy_from,#copy_to))
33
	{
34
		strcpy(#copy_to, #path);
35
		strcat(#copy_to, "new_");
36
		strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
37
	}
38
	if (strstr(#copy_to, #copy_from))
39
	{
40
		notify("Copy directory into itself is a bad idea...");
41
		ExitProcess();
42
	}
3447 leency 43
	if (copy_rezult = copyf(#copy_from,#copy_to))
3444 leency 44
	{
45
		Write_Error(copy_rezult);
46
	}
3447 leency 47
	else if (cut_active)
3444 leency 48
	{
49
		strcpy(#file_path, #copy_from);
50
		Del_File(true);
51
		copy_from=NULL;
52
		cut_active=false;
53
	}
54
	ActivateWindow(GetProcessSlot(Form.ID));
55
	SendWindowMessage(evKey, 54);
56
	SelectFile(#copy_to+strrchr(#copy_to,'/'));
3695 leency 57
	pause(20);
3444 leency 58
	ExitProcess();
59
}