Rev 7362 | Rev 7422 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7362 | Rev 7369 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | ?define PR_T_SYSTEM "System" |
34 | ?define PR_T_SYSTEM "System" |
35 | ?define PR_T_ONLY_READ "Read-only" |
35 | ?define PR_T_ONLY_READ "Read-only" |
36 | ?define SET_BYTE_LANG "byte" |
36 | ?define SET_BYTE_LANG "byte" |
37 | #endif |
37 | #endif |
Line 38... | Line -... | ||
38 | - | ||
39 | dword mouse_2; |
38 | |
40 | char path_to_file[4096]; |
39 | char path_to_file[4096]; |
41 | char file_name2[4096]; |
40 | char file_name2[4096]; |
42 | edit_box file_name_ed = {230,59,32,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(file_name2),#file_name2,#mouse_2, 1000000000000000b,2,2}; |
41 | edit_box file_name_ed = {230,59,32,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(file_name2),#file_name2,NULL, 1000000000000000b,2,2}; |
Line 43... | Line -... | ||
43 | edit_box path_to_file_ed = {160,120,79,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,sizeof(path_to_file),#path_to_file,#mouse_2, 1000000000000000b,2,2}; |
- | |
44 | - | ||
45 | int file_count, dir_count, size_dir; |
- | |
46 | char folder_info[200]; |
- | |
47 | dword element_size; |
42 | edit_box path_to_file_ed = {160,120,79,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,sizeof(path_to_file),#path_to_file,NULL, 1000000000000000b,2,2}; |
48 | char element_size_label[32]; |
43 | |
Line 49... | Line -... | ||
49 | BDVK file_info_general; |
- | |
50 | BDVK file_info_dirsize; |
44 | BDVK file_info_general; |
Line -... | Line 45... | ||
- | 45 | BDVK file_info_dirsize; |
|
- | 46 | ||
51 | 47 | bool quest_active; |
|
52 | proc_info settings_form; |
48 | |
53 | bool quest_active; |
49 | _dir_size more_files_count; |
Line 54... | Line 50... | ||
54 | 50 | ||
Line 145... | Line 141... | ||
145 | WriteText(65, 117, 0x90, 0x000000, QUEST_2); |
141 | WriteText(65, 117, 0x90, 0x000000, QUEST_2); |
146 | DrawStandartCaptButton(62,138,301,T_YES); |
142 | DrawStandartCaptButton(62,138,301,T_YES); |
147 | DrawStandartCaptButton(155,138,302,T_NO); |
143 | DrawStandartCaptButton(155,138,302,T_NO); |
148 | } |
144 | } |
Line 149... | Line -... | ||
149 | - | ||
150 | void GetSizeDir(dword way) |
- | |
151 | { |
- | |
152 | dword dirbuf, fcount, i, filename; |
- | |
153 | dword cur_file; |
- | |
154 | if (dir_exists(way)) |
- | |
155 | { |
- | |
156 | cur_file = malloc(4096); |
- | |
157 | // In the process of recursive descent, memory must be allocated dynamically, |
- | |
158 | // because the static memory -> was a bug !!! But unfortunately pass away to sacrifice speed. |
- | |
159 | GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); |
- | |
160 | for (i=0; i |
- | |
161 | { |
- | |
162 | filename = i*304+dirbuf+72; |
- | |
163 | sprintf(cur_file,"%s/%s",way,filename); |
- | |
164 | - | ||
165 | if (TestBit(ESDWORD[filename-40], 4) ) |
- | |
166 | { |
- | |
167 | dir_count++; |
- | |
168 | GetSizeDir(cur_file); |
- | |
169 | } |
- | |
170 | else |
- | |
171 | { |
- | |
172 | GetFileInfo(cur_file, #file_info_dirsize); |
- | |
173 | size_dir += file_info_dirsize.sizelo; |
- | |
174 | file_count++; |
- | |
175 | } |
- | |
176 | } |
- | |
177 | free(cur_file); |
- | |
178 | free(dirbuf); |
- | |
179 | } |
- | |
180 | } |
- | |
181 | 145 | ||
182 | void GetSizeMoreFiles(dword way) |
146 | void GetSizeMoreFiles(dword way) |
183 | { |
147 | { |
Line 184... | Line 148... | ||
184 | char cur_file[4096]; |
148 | char cur_file[4096]; |
Line 188... | Line 152... | ||
188 | if (getElementSelectedFlag(i) == true) |
152 | if (getElementSelectedFlag(i) == true) |
189 | { |
153 | { |
190 | sprintf(#cur_file,"%s/%s",way,file_mas[i]*304+buf+72); |
154 | sprintf(#cur_file,"%s/%s",way,file_mas[i]*304+buf+72); |
191 | if (TestBit(ESDWORD[file_mas[i]*304+buf+32], 4) ) |
155 | if (TestBit(ESDWORD[file_mas[i]*304+buf+32], 4) ) |
192 | { |
156 | { |
193 | GetSizeDir(#cur_file); |
157 | more_files_count.calculate_loop(#cur_file); |
194 | dir_count++; |
158 | more_files_count.folders++; |
195 | } |
159 | } |
196 | else |
160 | else |
197 | { |
161 | { |
198 | GetFileInfo(#cur_file, #file_info_dirsize); |
162 | GetFileInfo(#cur_file, #file_info_dirsize); |
199 | size_dir += file_info_dirsize.sizelo; |
163 | more_files_count.bytes += file_info_dirsize.sizelo; |
200 | file_count++; |
164 | more_files_count.files++; |
201 | } |
165 | } |
202 | } |
166 | } |
203 | } |
167 | } |
204 | } |
168 | } |
Line 205... | Line 169... | ||
205 | 169 | ||
206 | void properties_dialog() |
170 | void properties_dialog() |
207 | { |
171 | { |
Line 208... | Line -... | ||
208 | int id; |
- | |
209 | - | ||
210 | DSBYTE[#folder_info]=0; |
- | |
211 | file_count = 0; |
- | |
212 | dir_count = 0; |
- | |
213 | size_dir = 0; |
172 | int id; |
214 | 173 | ||
- | 174 | if (selected_count) |
|
215 | if (selected_count) |
175 | { |
216 | { |
176 | more_files_count.get(NULL); |
217 | GetSizeMoreFiles(#path); |
177 | GetSizeMoreFiles(#path); |
218 | ch_read_only.checked = 0; |
178 | ch_read_only.checked = 0; |
219 | ch_hidden.checked = 0; |
179 | ch_hidden.checked = 0; |
220 | ch_system.checked = 0; |
180 | ch_system.checked = 0; |
221 | } |
181 | } |
222 | else |
182 | else |
223 | { |
183 | { |
224 | GetFileInfo(#file_path, #file_info_general); |
184 | GetFileInfo(#file_path, #file_info_general); |
225 | strcpy(#file_name2, #file_name); |
185 | strcpy(#file_name2, #file_name); |
226 | file_name_ed.size = strlen(#file_name2); |
186 | file_name_ed.size = strlen(#file_name2); |
227 | if(itdir) GetSizeDir(#file_path); |
187 | if(itdir) dir_size.get(#file_path); |
228 | ch_read_only.checked = file_info_general.readonly; |
188 | ch_read_only.checked = file_info_general.readonly; |
229 | ch_hidden.checked = file_info_general.hidden; |
189 | ch_hidden.checked = file_info_general.hidden; |
230 | ch_system.checked = file_info_general.system; |
190 | ch_system.checked = file_info_general.system; |
Line 307... | Line 267... | ||
307 | } |
267 | } |
308 | } |
268 | } |
Line 309... | Line 269... | ||
309 | 269 | ||
310 | void DrawPropertiesWindow() |
270 | void DrawPropertiesWindow() |
- | 271 | { |
|
- | 272 | proc_info settings_form; |
|
- | 273 | char element_size_label[32]; |
|
311 | { |
274 | char folder_info[200]; |
- | 275 | dword ext1; |
|
312 | dword ext1; |
276 | dword element_size; |
313 | incn y; |
277 | incn y; |
314 | char temp_path[sizeof(file_path)]; |
278 | char temp_path[sizeof(file_path)]; |
315 | DefineAndDrawWindow(Form.left + 150,150,315,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0); |
279 | DefineAndDrawWindow(Form.left + 150,150,315,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0); |
Line 324... | Line 288... | ||
324 | WriteText(10, 97, 0x90, system.color.work_text, PR_T_SIZE); |
288 | WriteText(10, 97, 0x90, system.color.work_text, PR_T_SIZE); |
Line 325... | Line 289... | ||
325 | 289 | ||
326 | if (selected_count) |
290 | if (selected_count) |
327 | { |
291 | { |
328 | PropertiesDrawIcon(NULL, " |
292 | PropertiesDrawIcon(NULL, " |
329 | sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); |
293 | sprintf(#folder_info,"%s%d%s%d",SET_6,more_files_count.files,SET_7,more_files_count.folders); |
330 | WriteText(file_name_ed.left+4, 30, 0x90, system.color.work_text, #folder_info); |
294 | WriteText(file_name_ed.left+4, 30, 0x90, system.color.work_text, #folder_info); |
331 | sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(size_dir, NULL),size_dir,SET_BYTE_LANG); |
295 | sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(more_files_count.bytes, NULL),more_files_count.bytes,SET_BYTE_LANG); |
332 | WriteText(120, 97, 0x90, system.color.work_text, #element_size_label); |
296 | WriteText(120, 97, 0x90, system.color.work_text, #element_size_label); |
333 | } |
297 | } |
334 | else |
298 | else |
335 | { |
299 | { |
Line 346... | Line 310... | ||
346 | 310 | ||
347 | if (!itdir) element_size = file_info_general.sizelo; |
311 | if (!itdir) element_size = file_info_general.sizelo; |
348 | else |
312 | else |
349 | { |
313 | { |
350 | WriteText(10,116, 0x90, system.color.work_text, PR_T_CONTAINS); |
314 | WriteText(10,116, 0x90, system.color.work_text, PR_T_CONTAINS); |
351 | sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); |
315 | sprintf(#folder_info,"%s%d%s%d",SET_6,dir_size.files,SET_7,dir_size.folders); |
352 | WriteText(120, 116, 0x90, system.color.work_text, #folder_info); |
316 | WriteText(120, 116, 0x90, system.color.work_text, #folder_info); |
353 | element_size = size_dir; |
317 | element_size = dir_size.bytes; |
354 | } |
318 | } |
355 | WriteTextLines(10, 136, 0x90, system.color.work_text, CREATED_OPENED_MODIFIED, 20); |
319 | WriteTextLines(10, 136, 0x90, system.color.work_text, CREATED_OPENED_MODIFIED, 20); |
356 | DrawDate(120, 136, system.color.work_text, #file_info_general.datecreate); |
320 | DrawDate(120, 136, system.color.work_text, #file_info_general.datecreate); |
357 | DrawDate(120, 156, system.color.work_text, #file_info_general.datelastaccess); |
321 | DrawDate(120, 156, system.color.work_text, #file_info_general.datelastaccess); |