Subversion Repositories Kolibri OS

Rev

Rev 3840 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;---------------------------------------------------------------------
  2. move_file_f6:
  3.     mov  [move_file_flag],1
  4. copy_file_f5:
  5.     call clear_file_buffer
  6.     xor  edx,edx
  7.     xor  eax,eax
  8. ;    mov  byte [copy_many_files],al
  9.     mov  [current_progress_value],eax
  10.     mov  [current_progress_value_1],eax
  11.     cmp  [select_panel_counter],al
  12.     jne  .right_1
  13.     cmp  [left_marked_counter],eax
  14.     jne  .confirmation_action
  15.     mov  ax,[left_start_draw_cursor_line]
  16.     mov  ebx,10
  17.     div  ebx
  18.     mov  ebx,[left_start_draw_line]
  19.     add  ebx,eax
  20.     imul ebx,304
  21.     add  ebx,[left_folder_data]
  22.     call prepare_data_7
  23.     call .copy_name
  24.     jmp  editbox_copy_name
  25. .right_1:
  26.     cmp  [right_marked_counter],eax
  27.     jne  .confirmation_action
  28.     mov  ax,[right_start_draw_cursor_line]
  29.     mov  ebx,10
  30.     div  ebx
  31.     mov  ebx,[right_start_draw_line]
  32.     add  ebx,eax
  33.     imul ebx,304
  34.     add  ebx,[right_folder_data]
  35.     call prepare_data_7
  36.     call .copy_name
  37.     jmp  editbox_copy_name
  38.    
  39. .confirmation_action:
  40.     cmp  [move_file_flag],0
  41.     je   .copy
  42.     mov  [confirmation_type],move_type
  43.     jmp  @f
  44. .copy:
  45.     mov  [confirmation_type],copy_type
  46. @@:
  47.     call confirmation_action
  48.     cmp  [work_confirmation_yes],1
  49.     je   copy_marked_files
  50.     mov  [move_file_flag],0
  51.     jmp  red
  52.  
  53. .copy_name:
  54.     mov  esi,ebx
  55.     mov  edi,create_dir_name
  56. @@:
  57.     cld
  58.     lodsb
  59.     stosb
  60.     test al,al
  61.     jne  @r
  62.     sub  edi,create_dir_name
  63.     mov  eax,edi
  64.     dec  eax
  65.     mov edi, edit1
  66.     mov ed_size, eax
  67.     mov ed_pos, eax
  68. default_box
  69.     cmp  [select_panel_counter],0
  70.     jne  .right_2
  71.     mov esi,read_folder_name
  72.     jmp  @f
  73. .right_2:
  74.     mov esi,read_folder_1_name
  75. @@:
  76.     mov  edi,file_name
  77.     call copy_path_1
  78.     ret
  79. ;-------------------------------------------------------------
  80. editbox_copy_name:
  81.     mcall 66, 1, 0
  82.     jmp  .red
  83. .red_1:
  84.     call  draw_window
  85. .red:
  86.     call  draw_editbox_copy_name
  87. .still:
  88.     mcall 10
  89.     cmp  eax,1
  90.     je   .red_1
  91.     cmp  eax,2
  92.     je   .key_copy
  93.     cmp  eax,3
  94.     je   .button_copy
  95.         mouse_edit_box copy_editboxes
  96.         jmp .still
  97. ;-------------------------------------------------------------
  98. .button_copy:
  99.     mov eax,17
  100.         mcall
  101.     test ah,ah
  102.     jz  .still
  103.     cmp  ah,160
  104.     je  .exit_with_copy
  105.     cmp  ah,161
  106.     je  .exit_without_copy
  107.     cmp   ah,1
  108.     jne   .still
  109.     mcall -1
  110. .exit_with_copy:
  111.     mov  [max_progress_value],1
  112.     mov  [draw_all_progressbar],1
  113.     call  copy_file_1
  114.     cmp   [move_file_flag],0
  115.     je    @f
  116.     call  del_file
  117.     test  eax,eax
  118.     jz    @f
  119.     call  start_error_window_thread
  120. @@:
  121.     call proc_read_left_folder
  122.     call proc_read_right_folder
  123. .exit_without_copy:
  124.     mcall 66, 1, 1
  125.     mov  [move_file_flag],0
  126.     jmp  red
  127. ;-------------------------------------------------------------
  128. .key_copy:
  129.     mov eax,2
  130.         mcall
  131.     cmp ah,13
  132.     je  .exit_with_copy
  133.     cmp ah,27
  134.     je  .exit_without_copy
  135.     key_edit_box copy_editboxes
  136.     jmp .still
  137. ;-------------------------------------------------------------
  138. draw_editbox_copy_name:
  139.     mov  ecx,[window_high]
  140.     mov  ebx,[window_width]
  141.     shr  ecx,1
  142.     shr  ebx,1
  143.     sub  ecx,30
  144.     sub  ebx,87
  145.     shl  ecx,16
  146.     shl  ebx,16
  147.     mov   cx,60
  148.     mov   bx,174
  149.     mcall 13, , ,0x6060ff ;0xff
  150.     pusha
  151.     shr ebx,16
  152.     add  ebx,10
  153.     shr ecx,16
  154.     add ecx,17
  155.     mov eax,copy_editboxes
  156.     mov dword [eax+4],ebx
  157.     mov dword [eax+8],ecx
  158.         draw_edit_box copy_editboxes
  159.         popa
  160.         pusha
  161.         add   ebx,70 shl 16
  162.         add   ecx,37 shl 16
  163.     mov   cx,15
  164.     mov   bx,40
  165.     mov   esi,0xffffff
  166.     mov   edx,0x40000000+160
  167.     mov   eax,8
  168.         mcall
  169.     add   ebx,50 shl 16
  170.     inc   edx
  171.         mcall
  172.     popa
  173.  
  174.     push  ebx ecx
  175.     add   ebx,70 shl 16
  176.     add   ecx,37 shl 16
  177.     mov   bx,40
  178.     mov   cx,15
  179.     mov   edx,0
  180.     push  ebx ecx
  181.     sub   ecx,1 shl 16
  182.     sub   ebx,1 shl 16
  183.     mov   bx,42
  184.     mov   cx,17
  185.         mcall
  186.     add   ebx,50 shl 16
  187.         mcall
  188.     pop   ecx ebx
  189.     mov   edx,0xff7700
  190.         mcall
  191.     mov   edx,0xaa00
  192.     add   ebx,50 shl 16
  193.         mcall
  194.     pop   ecx ebx
  195.  
  196.     shr   ecx,16
  197.     mov   bx,cx
  198.     add   ebx,60 shl 16+1
  199.     cmp   [move_file_flag],0
  200.     je    .copy
  201.     mov   edx,move_type_1
  202.     jmp   @f
  203. .copy:
  204.     mov   edx,copy_type_1
  205. @@:
  206.     mcall 4, ,0x90ffffff
  207.     add   ebx,18 shl 16+36
  208.     mov   edx,type_yes
  209.         mcall
  210.     add   ebx,56 shl 16
  211.     mov   edx,type_no
  212.         mcall
  213.         ret
  214. ;-------------------------------------------------------------
  215. copy_file_1:
  216.     mov  ebx,create_dir_name
  217. .1:
  218.     mov   [error_pointer],ebx
  219.     cmp  [select_panel_counter],0
  220.     je  .right_2
  221.     mov esi,read_folder_name
  222.     jmp  @f
  223. .right_2:
  224.     mov esi,read_folder_1_name
  225. @@:
  226.     mov  edi,start_parameter
  227.     call copy_path_1
  228.     call get_file_size
  229.     test  eax,eax
  230.     jnz   .error
  231.     mov   [read_file.Offset],eax
  232.     mov   [add_save_file.Offset],eax
  233.     mov   eax,[appl_memory]
  234.     mov   [read_file.return],eax
  235.     mov   [save_file.pointer],eax
  236.     mov   [add_save_file.pointer],eax
  237.     mcall 18,16
  238.     mov   ebx,[file_features_temp_area+32]
  239.     shr   ebx,10
  240.     shr   eax,2
  241.     cmp   ebx,eax
  242.     jb   .copy_for_one
  243.     shl   eax,10
  244.     mov   ecx,eax
  245.     mov   [read_file.size],eax
  246.     mov   [save_file.size],eax
  247.     mov   [add_save_file.size],eax
  248.  
  249.     cmp  [copy_many_files], byte 1
  250.     je  .continue_5
  251.     pusha
  252.     mov  eax,[file_features_temp_area+32]
  253.     mov  ebx,[save_file.size]
  254.     xor  edx,edx
  255.     mov  [current_progress_value],edx
  256.     mov  [current_progress_value_1],edx
  257.     div  ebx
  258.     test edx,edx
  259.     jz   @f
  260.     inc  eax
  261. @@:
  262.     mov  [max_progress_value],eax
  263.     popa
  264. .continue_5:
  265.     call  progress_bar_copy    ;_1
  266.     call  add_application_memory.1
  267.     cmp   [copy_many_files],byte 0
  268.     jne   @f
  269.     inc  [current_progress_value]
  270.     call  progress_bar_copy   ;_1
  271. @@:
  272.     call  load_file
  273.     test  eax,eax
  274.     jnz   .error
  275.     cmp   [copy_many_files],byte 0
  276.     jne   @f
  277.     inc  [current_progress_value_1]
  278.     call  progress_bar_copy   ;_1
  279. @@:
  280.     call  write_file
  281.     test  eax,eax
  282.     jnz   .error
  283. .continue:
  284.     mov   eax,[file_features_temp_area+32]
  285.     mov   ebx,[save_file.size]
  286.     sub   eax,ebx
  287.     cmp   eax,ebx
  288.     jbe   .end_copy_write
  289.     mov   [file_features_temp_area+32],eax
  290.     add   [add_save_file.Offset],ebx
  291.     add   [read_file.Offset],ebx
  292.     cmp   [copy_many_files],byte 0
  293.     jne   @f
  294.     inc  [current_progress_value]
  295.     call  progress_bar_copy   ;_1
  296. @@:
  297.     call  load_file
  298.     test  eax,eax
  299.     jnz   .error_1
  300.     cmp   [copy_many_files],byte 0
  301.     jne   @f
  302.     inc  [current_progress_value_1]
  303.     call  progress_bar_copy   ;_1
  304. @@:
  305.     call  add_write_file
  306.     test  eax,eax
  307.     jnz   .error_1
  308.     jmp   .continue
  309.  
  310. .end_copy_write:
  311.     mov   [add_save_file.size],eax
  312.     add   [add_save_file.Offset],ebx
  313.     mov   [read_file.size],eax
  314.     add   [read_file.Offset],ebx
  315.     inc  [current_progress_value]
  316.     call  progress_bar_copy
  317.     call  load_file
  318.     test  eax,eax
  319.     jnz   .error_1
  320.     inc  [current_progress_value_1]
  321.     call  progress_bar_copy
  322.     call  add_write_file
  323.     test  eax,eax
  324.     jnz   .error_1
  325.     mov   ecx,[appl_memory]
  326.     sub   ecx,[save_file.size]
  327.     call  sub_application_memory.1
  328. .exit:
  329.     ret
  330.  
  331.  
  332. .copy_for_one:
  333.     call  add_application_memory
  334.     mov   eax,[file_features_temp_area+32]
  335.     mov   [read_file.size],eax
  336.     inc  [current_progress_value]
  337.     call  progress_bar_copy
  338.     call  load_file
  339.     test  eax,eax
  340.     jnz   .error
  341.     mov   [save_file.size],ebx
  342.     inc  [current_progress_value_1]
  343.     call  progress_bar_copy
  344.     call  write_file
  345.     test  eax,eax
  346.     jnz   .error
  347.     call  sub_application_memory
  348.     ret
  349.  
  350. .error:
  351.     call start_error_window_thread
  352.     call  sub_application_memory
  353.     add  esp,4
  354.     mov  [move_file_flag],0
  355.     jmp  editbox_copy_name.exit_without_copy
  356.  
  357. .error_1:
  358.     call start_error_window_thread
  359.     mov   ecx,[appl_memory]
  360.     sub   ecx,[save_file.size]
  361.     call  sub_application_memory.1
  362.     add  esp,4
  363.     mov  [move_file_flag],0
  364.     jmp  editbox_copy_name.exit_without_copy
  365. ;-------------------------------------------------------------
  366. copy_marked_files:
  367.     mov  [copy_many_files],byte 1
  368.     mov  [draw_all_progressbar],1
  369.     xor  eax,eax
  370.     mov  [current_progress_value],eax
  371.     mov  [current_progress_value_1],eax
  372.     cmp  [select_panel_counter],al
  373.     jne  .right_1
  374.     mov  eax,[left_marked_counter]
  375.     mov  [max_progress_value],eax
  376.     mov  ebp,[left_folder_block]
  377. .start:
  378.     mov  ebx,ebp
  379.     dec  ebx
  380.     imul ebx,304
  381.     add  ebx,[left_folder_data]
  382.     add  ebx,32+40
  383.     test [ebx-40],byte 0x10
  384.     jnz  @f
  385.     cmp  [ebx+299-40],byte 0
  386.     je   @f
  387.     cmp  [ebx],word '..'
  388.     jne  .continue
  389.     cmp  [ebx+2],byte 0
  390.     je   .continue_1
  391. .continue:
  392.     push  ebx
  393.     mov   esi,read_folder_name
  394.     mov   edi,file_name
  395.     call  copy_path_1
  396.     pop   ebx
  397.     call  copy_file_1.1
  398.     cmp   [move_file_flag],0
  399.     je    .continue_1
  400.     call  del_file
  401.     test  eax,eax
  402.     jz    .continue_1
  403.     mov  [move_file_flag],0
  404.     call  start_error_window_thread
  405.     jmp   reload_dir_all
  406. .continue_1:
  407. @@:
  408.     dec  ebp
  409.     jnz  .start
  410.     cmp  [move_file_flag],0
  411.     je   reload_dir_all
  412.     mov  [left_start_draw_cursor_line],0
  413.     mov  [move_file_flag],0
  414.     mov  [copy_many_files],byte 0
  415.     jmp  reload_dir_all
  416.  
  417. .right_1:
  418.     mov  eax,[right_marked_counter]
  419.     mov  [max_progress_value],eax
  420.     mov  ebp,[right_folder_block]
  421. .start_1:
  422.     mov  ebx,ebp
  423.     dec  ebx
  424.     imul ebx,304
  425.     add  ebx,[right_folder_data]
  426.     add  ebx,32+40
  427.     test [ebx-40],byte 0x10
  428.     jnz  @f
  429.     cmp  [ebx+299-40],byte 0
  430.     je   @f
  431.     cmp  [ebx],word '..'
  432.     jne  .continue_2
  433.     cmp  [ebx+2],byte 0
  434.     je   .continue_3
  435. .continue_2:
  436.     push  ebx
  437.     mov   esi,read_folder_1_name
  438.     mov   edi,file_name
  439.     call  copy_path_1
  440.     pop   ebx
  441.     call copy_file_1.1
  442.     cmp   [move_file_flag],0
  443.     je    .continue_3
  444.     call  del_file
  445.     test  eax,eax
  446.     jz    .continue_3
  447.     mov  [move_file_flag],0
  448.     call  start_error_window_thread
  449.     jmp   reload_dir_all
  450. .continue_3:
  451. @@:
  452.     dec  ebp
  453.     jnz  .start_1
  454.     cmp  [move_file_flag],0
  455.     je   reload_dir_all
  456.     mov  [right_start_draw_cursor_line],0
  457.     mov  [move_file_flag],0
  458.     mov  [copy_many_files],byte 0
  459.     jmp  reload_dir_all
  460. ;---------------------------------------------------------------------