Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. ;---------------------------------------------------------------------
  2. delete_file:
  3. ;    call progress_bar
  4. ;    jmp  still
  5.     mov  [confirmation_type],delete_type
  6.     call confirmation_action
  7.     cmp  [work_confirmation_yes],1
  8.     jne  red  ;reload_dir
  9.  
  10.     xor  eax,eax
  11.     mov  [files_counter],eax
  12.     mov  [directories_counter],eax
  13.     mov  [files_size.low],eax
  14.     mov  [files_size.high],eax
  15.     call get_files_information
  16.  
  17.     call delete_marked_files
  18.     cmp  [delete_marked_yes],1
  19.     je   .end_1   ;reload_dir_all
  20.  
  21.     xor  eax,eax
  22.     xor  edx,edx
  23.     cmp  [select_panel_counter],0
  24.     jne  .right_1
  25.     mov  ax,[left_start_draw_cursor_line]
  26.     mov  ebx,10
  27.     div  ebx
  28.     mov  ebx,[left_start_draw_line]
  29.     add  ebx,eax
  30.     imul ebx,304
  31.     add  ebx,[left_folder_data]
  32.     call prepare_data_7
  33.     mov   esi,read_folder_name    ;read_folder.name
  34.     jmp  .end
  35. .right_1:
  36.     mov  ax,[right_start_draw_cursor_line]
  37.     mov  ebx,10
  38.     div  ebx
  39.     mov  ebx,[right_start_draw_line]
  40.     add  ebx,eax
  41.     imul ebx,304
  42.     add  ebx,[right_folder_data]
  43.     call prepare_data_7
  44.     mov   esi,read_folder_1_name   ;read_folder_1.name
  45. .end:
  46.     mov   [error_pointer],ebx
  47.     mov   edi,file_name   ;delete_file_data.name
  48.     call  copy_path_1
  49.     test [ebx-40],byte 0x10
  50.     jz   @f
  51.     push eax ebx
  52.     xor  eax,eax
  53.     mov  [current_progress_value],eax
  54. ;    mov  [delete_marked_yes],al
  55.     mov  [draw_all_progressbar],1
  56.     call delete_dir
  57.     pop  ebx eax
  58.     jmp  .end_1
  59. @@:
  60.     call del_file
  61.     test  eax,eax
  62.     jz   .end_1
  63.     call start_error_window_thread
  64.     jmp  reload_dir_all
  65. .end_1:
  66.     cmp  [select_panel_counter],0
  67.     jne  .right
  68.     call proc_read_left_folder
  69.     jmp  red
  70. .right:
  71.     call proc_read_right_folder
  72.     jmp  red
  73. ;---------------------------------------------------------------------
  74. delete_marked_files:
  75.     mov  eax,[directories_counter]
  76.     add  eax,[files_counter]
  77.     mov  [max_progress_value],eax
  78.    
  79.     xor  eax,eax
  80.     mov  [current_progress_value],eax
  81.     mov  [delete_marked_yes],al
  82.     mov  [draw_all_progressbar],1
  83.    
  84.    cmp  [select_panel_counter],al
  85.     jne  .right_1
  86. ;    mov  eax,[left_marked_counter]
  87. ;    mov  [max_progress_value],eax
  88.     mov  ebp,[left_folder_block]
  89. .start:
  90.     mov  ebx,ebp
  91.     dec  ebx
  92.     imul ebx,304
  93.     add  ebx,[left_folder_data]
  94.     add  ebx,32+40
  95.     cmp  [ebx+299-40],byte 0
  96.     je   @f
  97.     cmp  [ebx],word '..'
  98.     jne  .continue
  99.     cmp  [ebx+2],byte 0
  100.     je   .continue_1
  101. .continue:
  102.     mov  esi,read_folder_name   ;read_folder.name
  103.     call prepare_data_6
  104. .continue_1:
  105.     mov  [delete_marked_yes],1
  106. @@:
  107.     dec  ebp
  108.     jnz  .start
  109.     cmp  [delete_marked_yes],0
  110.     je   @f
  111.     mov  [left_start_draw_cursor_line],0
  112. @@:
  113.     ret
  114. .right_1:
  115. ;    mov  eax,[right_marked_counter]
  116. ;    mov  [max_progress_value],eax
  117.     mov  ebp,[right_folder_block]
  118. .start_1:
  119.     mov  ebx,ebp
  120.     dec  ebx
  121.     imul ebx,304
  122.     add  ebx,[right_folder_data]
  123.     add  ebx,32+40
  124.     cmp  [ebx+299-40],byte 0
  125.     je   @f
  126.     cmp  [ebx],word '..'
  127.     jne  .continue_2
  128.     cmp  [ebx+2],byte 0
  129.     je   .continue_3
  130. .continue_2:
  131.     mov   esi,read_folder_1_name   ;read_folder_1.name
  132.     call prepare_data_6
  133. .continue_3:
  134.     mov  [delete_marked_yes],1
  135. @@:
  136.     dec  ebp
  137.     jnz  .start_1
  138.     cmp  [delete_marked_yes],0
  139.     je   @f
  140.     mov  [right_start_draw_cursor_line],0
  141. @@:
  142.     ret
  143. ;---------------------------------------------------------------------
  144. prepare_data_6:
  145.     mov   [error_pointer],ebx
  146.     mov  edi,file_name   ;delete_file_data.name
  147.     call copy_path_1
  148. ;    inc  [current_progress_value]
  149. ;    call progress_bar_delete
  150.     test [ebx-40],byte 0x10
  151.     jz   @f
  152.     call delete_dir
  153.     jmp  .continue
  154. @@:
  155.     inc  [current_progress_value]
  156.     call progress_bar_delete
  157.     call del_file
  158.     test eax,eax
  159.     jz   .continue  ;  .continue_1
  160.     call start_error_window_thread
  161.     add  esp,8
  162. .continue:
  163.     ret
  164. ;---------------------------------------------------------------------
  165. prepare_data_7:
  166.     add  ebx,32+40
  167.     cmp  [ebx],word '..'
  168.     jne  .continue
  169.     cmp  [ebx+2],byte 0
  170.     jne  .continue
  171.     add  esp,4
  172.     jmp  reload_dir
  173. .continue:
  174.     ret
  175. ;---------------------------------------------------------------------
  176. delete_dir:
  177.     pusha
  178.     mov   [recursive_pointer],0
  179.     mov   eax,[appl_memory]
  180.     mov   [appl_memory_old],eax
  181. .1:
  182.     mov  [read_delete_dir_data.size],0
  183.     mov  [read_delete_dir_data.return],delete_dir_data
  184.     call read_delete_dir
  185.     test eax,eax
  186.     jz   @f
  187.     mov   [error_pointer],file_name
  188.     call start_error_window_thread
  189.     popa
  190.     add  esp,8+4
  191.     ret
  192. @@:
  193.     mov  eax,[delete_dir_data+8]
  194.     cmp  eax,2
  195.     ja   @f
  196.     inc  [current_progress_value]
  197.     call progress_bar_delete
  198.     call del_file
  199.     test eax,eax
  200.     jz   .end
  201.     mov   [error_pointer],file_name
  202.     call start_error_window_thread
  203.     popa
  204.     add  esp,8+4
  205.     ret
  206. @@:
  207.     imul  eax,304
  208.     add   eax,32
  209.     mov   ebx,eax
  210.     add   ebx,[appl_memory_old]
  211.     cmp   ebx,[appl_memory]
  212.     jbe   @f
  213.     mov   ecx,[appl_memory]
  214.     mov   ecx,ebx
  215.     mov   [appl_memory],ecx
  216.     mcall 64,1
  217. @@:
  218.     mov  eax,[delete_dir_data+8]
  219.     mov  [read_delete_dir_data.size],eax
  220.     mov   eax,[appl_memory_old]
  221.     mov  [read_delete_dir_data.return],eax
  222.     call read_delete_dir
  223.     test eax,eax
  224.     jz   @f
  225.     mov   [error_pointer],file_name
  226.     call start_error_window_thread
  227.     popa
  228.     add  esp,8+4
  229.     ret
  230. @@:
  231.     call delete_dir_1
  232.     jc  .1
  233. .end:
  234.     call  return_delete_path
  235.     dec   [recursive_pointer]
  236.     cmp   [recursive_pointer],0
  237.     jge   .1
  238. @@:
  239.     mov   ecx,[appl_memory_old]
  240.     cmp   [appl_memory],ecx
  241.     je    @f
  242.     mov   [appl_memory],ecx
  243.     mcall 64,1
  244. @@:
  245.     popa
  246.     ret
  247. ;---------------------------------------------------------------------
  248. delete_dir_1:
  249.     mov  ebp,[appl_memory_old]
  250.     mov  ebp,[ebp+8]
  251. .start:
  252.     mov  ebx,ebp
  253.     dec  ebx
  254.     imul ebx,304
  255.     add  ebx,[appl_memory_old]
  256.     add  ebx,32+40
  257.     cmp  [ebx],byte '.'
  258.     jne  @f
  259.     cmp  [ebx+1],byte 0
  260.     je   .continue_4
  261. @@:
  262.     cmp  [ebx],word '..'
  263.     jne  .continue
  264.     cmp  [ebx+2],byte 0
  265.     je   .continue_4
  266. .continue:
  267.     mov  esi,file_name
  268.     inc  [recursive_pointer]
  269.     call copy_path_2
  270.     test [ebx-40],byte 0x10
  271.     jnz  .continue_3
  272. @@:
  273.     inc  [current_progress_value]
  274.     call progress_bar_delete
  275.     call del_file
  276.     test eax,eax
  277.     jz   .continue_1
  278.     mov   [error_pointer],file_name
  279.     call start_error_window_thread
  280.     add  esp,4
  281.     popa
  282.     add  esp,8+4
  283.     ret
  284. .continue_1:
  285.     dec  [recursive_pointer]
  286.     call return_delete_path
  287.     dec  ebp
  288.     jnz  .start
  289.    
  290. .continue_4:
  291.     inc  [current_progress_value]
  292.     call progress_bar_delete
  293.     call del_file
  294.     test eax,eax
  295.     jz   .continue_2
  296.     call start_error_window_thread
  297.     add  esp,4
  298.     popa
  299.     add  esp,8+4
  300.     ret
  301. .continue_2:        
  302.     clc
  303.     ret
  304. .continue_3:
  305.     stc
  306.     ret
  307. ;---------------------------------------------------------------------
  308. return_delete_path:
  309.     mov  edi,file_name
  310. @@:
  311.     inc  edi
  312.     cmp  [edi],byte 0
  313.     jne  @r
  314.     dec  edi
  315. @@:
  316.     dec  edi
  317.     cmp  [edi],byte '/'
  318.     jne  @r
  319.     cmp  edi,file_name
  320.     jbe  @f
  321.     mov  [edi],byte 0
  322. @@:
  323.     ret
  324. ;---------------------------------------------------------------------
  325. copy_path_2:
  326.     xor   eax,eax
  327. @@:
  328.     cld
  329.     lodsb
  330.     test  al,al
  331.     jnz   @b
  332.     mov   edi,esi
  333.     mov   [edi-1],byte '/'
  334.     mov   esi,ebx
  335. @@:
  336.     cld
  337.     lodsb
  338.     stosb
  339.     test  al,al
  340.     jnz   @b
  341.     ret
  342. ;---------------------------------------------------------------------