2013-04-04 19:07:38 +02:00
|
|
|
//Leency 2008-2013
|
|
|
|
|
|
|
|
|
|
|
|
byte copy_from[4096], cut_active=0;
|
|
|
|
enum {NOCUT, CUT};
|
|
|
|
#define WIN_W 300
|
2013-09-02 00:45:38 +02:00
|
|
|
#define WIN_H 50
|
2013-04-04 19:07:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
void Copy(dword pcth, char cut)
|
|
|
|
{
|
|
|
|
strcpy(#copy_from, pcth);
|
|
|
|
cut_active = cut;
|
|
|
|
}
|
|
|
|
|
2013-10-14 00:18:41 +02:00
|
|
|
void copyf_Draw_Progress(dword filename) {
|
2013-09-02 00:45:38 +02:00
|
|
|
DefineAndDrawWindow(Form.left+Form.width-200,Form.top+90,WIN_W,GetSkinHeight()+WIN_H-1,0x34,col_work,T_PASTE_WINDOW);
|
|
|
|
WriteText(5,8, 0x80, 0, T_PASTE_WINDOW_TEXT);
|
|
|
|
DrawBar(5, 26, WIN_W-10, 10, col_work);
|
|
|
|
WriteText(5,26, 0x80, 0, filename);
|
2013-10-14 00:18:41 +02:00
|
|
|
if (CheckEvent()==evButton)
|
|
|
|
{
|
|
|
|
notify(T_CANCEL_PASTE);
|
|
|
|
ExitProcess();
|
|
|
|
}
|
2013-04-04 19:07:38 +02: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 02:26:21 +02:00
|
|
|
if (copy_rezult = copyf(#copy_from,#copy_to))
|
2013-04-04 19:07:38 +02:00
|
|
|
{
|
|
|
|
Write_Error(copy_rezult);
|
|
|
|
}
|
2013-04-05 02:26:21 +02:00
|
|
|
else if (cut_active)
|
2013-04-04 19:07:38 +02: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 00:49:43 +02:00
|
|
|
pause(20);
|
2013-04-04 19:07:38 +02:00
|
|
|
ExitProcess();
|
|
|
|
}
|