Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  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);
  22.         pause(20);
  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.         }
  44.         copy_rezult = copyf(#copy_from,#copy_to);
  45.         if (copy_rezult)
  46.         {
  47.                 Write_Error(copy_rezult);
  48.                 ExitProcess();
  49.         }
  50.         if (cut_active)
  51.         {
  52.                 strcpy(#file_path, #copy_from);
  53.                 Del_File(true);
  54.                 copy_from=NULL;
  55.                 cut_active=false;
  56.         }
  57.         ActivateWindow(GetProcessSlot(Form.ID));
  58.         SendWindowMessage(evKey, 54);
  59.         SelectFile(#copy_to+strrchr(#copy_to,'/'));
  60.         ExitProcess();
  61. }
  62.