Rev 1792 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1792 | yogev_ezra | 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 |
||
9754 | sober_dev | 191 | jmp still |
1792 | yogev_ezra | 192 | @@: |
193 | mov eax,[delete_dir_data+8] |
||
9754 | sober_dev | 194 | test eax,eax |
195 | jnz @f |
||
1792 | yogev_ezra | 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 |
||
9754 | sober_dev | 205 | jmp still |
1792 | yogev_ezra | 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 |
||
9754 | sober_dev | 229 | jmp still |
1792 | yogev_ezra | 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: |
||
9754 | sober_dev | 252 | test ebp,ebp |
253 | jz .continue_4 |
||
1792 | yogev_ezra | 254 | mov ebx,ebp |
255 | dec ebx |
||
256 | imul ebx,304 |
||
257 | add ebx,[appl_memory_old] |
||
258 | add ebx,32+40 |
||
259 | cmp [ebx],byte '.' |
||
260 | jne @f |
||
261 | cmp [ebx+1],byte 0 |
||
262 | je .continue_4 |
||
263 | @@: |
||
264 | cmp [ebx],word '..' |
||
265 | jne .continue |
||
266 | cmp [ebx+2],byte 0 |
||
267 | je .continue_4 |
||
268 | .continue: |
||
269 | mov esi,file_name |
||
270 | inc [recursive_pointer] |
||
271 | call copy_path_2 |
||
272 | test [ebx-40],byte 0x10 |
||
273 | jnz .continue_3 |
||
274 | @@: |
||
275 | inc [current_progress_value] |
||
276 | call progress_bar_delete |
||
277 | call del_file |
||
278 | test eax,eax |
||
279 | jz .continue_1 |
||
280 | mov [error_pointer],file_name |
||
281 | call start_error_window_thread |
||
282 | add esp,4 |
||
283 | popa |
||
284 | add esp,8+4 |
||
285 | ret |
||
286 | .continue_1: |
||
287 | dec [recursive_pointer] |
||
288 | call return_delete_path |
||
289 | dec ebp |
||
290 | jnz .start |
||
291 | |||
292 | .continue_4: |
||
293 | inc [current_progress_value] |
||
294 | call progress_bar_delete |
||
295 | call del_file |
||
296 | test eax,eax |
||
297 | jz .continue_2 |
||
298 | call start_error_window_thread |
||
299 | add esp,4 |
||
300 | popa |
||
301 | add esp,8+4 |
||
302 | ret |
||
9754 | sober_dev | 303 | .continue_2: |
1792 | yogev_ezra | 304 | clc |
305 | ret |
||
306 | .continue_3: |
||
307 | stc |
||
308 | ret |
||
309 | ;--------------------------------------------------------------------- |
||
310 | return_delete_path: |
||
311 | mov edi,file_name |
||
312 | @@: |
||
313 | inc edi |
||
314 | cmp [edi],byte 0 |
||
315 | jne @r |
||
316 | dec edi |
||
317 | @@: |
||
318 | dec edi |
||
319 | cmp [edi],byte '/' |
||
320 | jne @r |
||
321 | cmp edi,file_name |
||
322 | jbe @f |
||
323 | mov [edi],byte 0 |
||
324 | @@: |
||
325 | ret |
||
326 | ;--------------------------------------------------------------------- |
||
327 | copy_path_2: |
||
328 | xor eax,eax |
||
329 | @@: |
||
330 | cld |
||
331 | lodsb |
||
332 | test al,al |
||
333 | jnz @b |
||
334 | mov edi,esi |
||
335 | mov [edi-1],byte '/' |
||
336 | mov esi,ebx |
||
337 | @@: |
||
338 | cld |
||
339 | lodsb |
||
340 | stosb |
||
341 | test al,al |
||
342 | jnz @b |
||
343 | ret |
||
344 | ;--------------------------------------------------------------------- |