2013-04-04 21:07:38 +04:00
|
|
|
//Leency 2008-2013
|
|
|
|
|
|
|
|
|
|
|
|
byte copy_from[4096], cut_active=0;
|
|
|
|
enum {NOCUT, CUT};
|
|
|
|
#define WIN_W 300
|
|
|
|
#define WIN_H 20
|
|
|
|
|
|
|
|
|
|
|
|
void Copy(dword pcth, char cut)
|
|
|
|
{
|
|
|
|
strcpy(#copy_from, pcth);
|
|
|
|
cut_active = cut;
|
|
|
|
}
|
|
|
|
|
|
|
|
void copyf_Action(dword filename) {
|
|
|
|
DefineAndDrawWindow(5000,0,WIN_W,WIN_H-1,0x01,col_work,0);
|
|
|
|
DrawBar(WIN_W, 0, 1, WIN_H, 0x333333);
|
|
|
|
DrawBar(0, 0, WIN_W, WIN_H, 0xDDDddd);
|
|
|
|
WriteText(5,6, 0x80, 0, "Copying file:");
|
|
|
|
WriteText(90,6, 0x80, 0, filename);
|
2013-04-04 21:15:08 +04:00
|
|
|
//pause(20);
|
2013-04-04 21:07:38 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Paste()
|
|
|
|
{
|
|
|
|
char copy_to[4096], copy_rezult;
|
|
|
|
|
|
|
|
if (!copy_from) ExitProcess();
|
|
|
|
strcpy(#copy_to, #path);
|
|
|
|
strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
|
|
|
|
if (!strcmp(#copy_from,#copy_to))
|
|
|
|
{
|
|
|
|
strcpy(#copy_to, #path);
|
|
|
|
strcat(#copy_to, "new_");
|
|
|
|
strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
|
|
|
|
}
|
|
|
|
if (strstr(#copy_to, #copy_from))
|
|
|
|
{
|
|
|
|
notify("Copy directory into itself is a bad idea...");
|
|
|
|
ExitProcess();
|
|
|
|
}
|
2013-04-05 04:26:21 +04:00
|
|
|
if (copy_rezult = copyf(#copy_from,#copy_to))
|
2013-04-04 21:07:38 +04:00
|
|
|
{
|
|
|
|
Write_Error(copy_rezult);
|
|
|
|
}
|
2013-04-05 04:26:21 +04:00
|
|
|
else if (cut_active)
|
2013-04-04 21:07:38 +04:00
|
|
|
{
|
|
|
|
strcpy(#file_path, #copy_from);
|
|
|
|
Del_File(true);
|
|
|
|
copy_from=NULL;
|
|
|
|
cut_active=false;
|
|
|
|
}
|
|
|
|
ActivateWindow(GetProcessSlot(Form.ID));
|
|
|
|
SendWindowMessage(evKey, 54);
|
|
|
|
SelectFile(#copy_to+strrchr(#copy_to,'/'));
|
2013-06-22 02:49:43 +04:00
|
|
|
pause(20);
|
2013-04-04 21:07:38 +04:00
|
|
|
ExitProcess();
|
|
|
|
}
|