Rev 9535 | Rev 9580 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5447 | punk_joker | 1 | |
9535 | leency | 2 | char file_name2[PATHLEN]; |
3 | edit_box file_name_ed = {230,59,32,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(file_name2)-2,#file_name2,NULL, 0b,2,2}; |
||
7506 | leency | 4 | edit_box path_to_file_ed = {160,120,79,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,sizeof(path_to_file)-2,#path_to_file,NULL, 0b,2,2}; |
5 | |||
5447 | punk_joker | 6 | |
5463 | leency | 7 | BDVK file_info_dirsize; |
8 | |||
5447 | punk_joker | 9 | |
7593 | leency | 10 | |
5688 | punk_joker | 11 | |
7878 | leency | 12 | DIR_SIZE dir_size; |
13 | |||
7369 | leency | 14 | |
7244 | leency | 15 | checkbox ch_hidden = { PR_T_HIDDEN, NULL }; |
16 | checkbox ch_system = { PR_T_SYSTEM, NULL }; |
||
17 | |||
18 | |||
19 | { |
||
20 | GetFileInfo(cur_file, bdvk_pointer); |
||
21 | ESI = bdvk_pointer; |
||
22 | ESI.BDVK.readonly = ch_read_only.checked; |
||
23 | ESI.BDVK.hidden = ch_hidden.checked; |
||
24 | ESI.BDVK.system = ch_system.checked; |
||
25 | SetFileInfo(cur_file, bdvk_pointer); |
||
26 | } |
||
27 | |||
28 | |||
5688 | punk_joker | 29 | { |
5554 | punk_joker | 30 | dword dirbuf, fcount, i, filename; |
5688 | punk_joker | 31 | dword cur_file; |
32 | if (dir_exists(way)) |
||
6251 | leency | 33 | { |
5688 | punk_joker | 34 | cur_file = malloc(PATHLEN); |
9535 | leency | 35 | GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); |
5688 | punk_joker | 36 | for (i=0; i |
37 | { |
||
38 | filename = i*304+dirbuf+72; |
||
39 | sprintf(cur_file, "%s/%s", way, filename); |
||
9535 | leency | 40 | if ( ESDWORD[filename-40] & ATR_FOLDER ) |
8944 | leency | 41 | { |
5688 | punk_joker | 42 | SetPropertiesDir(cur_file); |
43 | } |
||
44 | SetPropertiesFile(cur_file, #file_info_dirsize); |
||
7244 | leency | 45 | } |
5688 | punk_joker | 46 | free(cur_file); |
47 | } |
||
48 | } |
||
49 | |||
50 | |||
7593 | leency | 51 | #define SET_PROPERTIES_NO_SUBFOLDER 1 |
52 | #define SET_PROPERTIES_ALL_SUBFOLDER 2 |
||
53 | void SetProperties(int mode) |
||
54 | { |
||
5688 | punk_joker | 55 | char pcur_file[4096]; |
7593 | leency | 56 | dword i; |
7422 | leency | 57 | |
5688 | punk_joker | 58 | |
9535 | leency | 59 | |
7593 | leency | 60 | |
61 | SetPropertiesFile(#file_path, #file_info_general); |
||
62 | } |
||
63 | |||
64 | |||
65 | || (SET_PROPERTIES_NO_SUBFOLDER == mode) |
||
66 | { |
||
5688 | punk_joker | 67 | if (getSelectedCount()) |
8983 | leency | 68 | { |
5688 | punk_joker | 69 | for (i=0; i |
70 | { |
||
71 | if (getElementSelectedFlag(i) == true) |
||
6646 | leency | 72 | { |
5688 | punk_joker | 73 | sprintf(#pcur_file,"%s/%s",path,items.get(i)*304+buf+72); |
8949 | leency | 74 | SetPropertiesFile(#pcur_file, #file_info_general); |
7593 | leency | 75 | if (SET_PROPERTIES_ALL_SUBFOLDER == mode) { |
76 | if (dir_exists(#pcur_file)) SetPropertiesDir(#pcur_file); |
||
77 | } |
||
5688 | punk_joker | 78 | } |
79 | } |
||
80 | } |
||
81 | else |
||
82 | { |
||
83 | SetPropertiesFile(#file_path, #file_info_general); |
||
7244 | leency | 84 | if (SET_PROPERTIES_ALL_SUBFOLDER == mode) SetPropertiesDir(#file_path); |
7593 | leency | 85 | } |
5688 | punk_joker | 86 | } |
87 | |||
7593 | leency | 88 | |
5688 | punk_joker | 89 | OpenDir(ONLY_OPEN); |
8956 | leency | 90 | ExitProcess(); |
5688 | punk_joker | 91 | } |
5554 | punk_joker | 92 | |
5487 | leency | 93 | |
6278 | leency | 94 | { |
5688 | punk_joker | 95 | apply_question_active = true; |
9535 | leency | 96 | DrawPopup(15,80,250,90,1,sc.work, sc.work_graph); |
7806 | leency | 97 | WriteText(35, 102, 0x90, 0x000000, QUEST_1); |
6280 | punk_joker | 98 | WriteText(65, 117, 0x90, 0x000000, QUEST_2); |
99 | DrawStandartCaptButton(62,138,B_SETINGS_APPLY_SUBFOLDER,T_YES); |
||
7593 | leency | 100 | DrawStandartCaptButton(155,138,B_SETINGS_APPLY_NO_SUBFOLDER,T_NO); |
101 | } |
||
5688 | punk_joker | 102 | |
103 | |||
5510 | punk_joker | 104 | { |
105 | char cur_file[4096]; |
||
106 | dword i; |
||
7422 | leency | 107 | |
5957 | punk_joker | 108 | |
5510 | punk_joker | 109 | { |
6646 | leency | 110 | if (getElementSelectedFlag(i) == true) |
111 | { |
||
112 | sprintf(#cur_file,"%s/%s",way,items.get(i)*304+buf+72); |
||
7972 | leency | 113 | if (ESDWORD[items.get(i)*304+buf+32] & ATR_FOLDER ) |
8944 | leency | 114 | { |
5510 | punk_joker | 115 | more_files_count.calculate_loop(#cur_file); |
7369 | leency | 116 | more_files_count.folders++; |
117 | } |
||
5510 | punk_joker | 118 | else |
119 | { |
||
120 | GetFileInfo(#cur_file, #file_info_dirsize); |
||
5957 | punk_joker | 121 | more_files_count.bytes += file_info_dirsize.sizelo; |
7369 | leency | 122 | more_files_count.files++; |
123 | } |
||
5510 | punk_joker | 124 | } |
6646 | leency | 125 | } |
5510 | punk_joker | 126 | } |
127 | |||
128 | |||
5447 | punk_joker | 129 | { |
130 | int id; |
||
7244 | leency | 131 | |
5447 | punk_joker | 132 | |
8983 | leency | 133 | { |
5688 | punk_joker | 134 | more_files_count.get(NULL); |
7369 | leency | 135 | GetSizeMoreFiles(path); |
8949 | leency | 136 | ch_read_only.checked = 0; |
7244 | leency | 137 | ch_hidden.checked = 0; |
138 | ch_system.checked = 0; |
||
139 | } |
||
5688 | punk_joker | 140 | else |
5510 | punk_joker | 141 | { |
142 | GetFileInfo(#file_path, #file_info_general); |
||
143 | edit_box_set_text stdcall (#file_name_ed, #file_name); |
||
8336 | leency | 144 | if(itdir) dir_size.get(#file_path); |
7369 | leency | 145 | ch_read_only.checked = file_info_general.readonly; |
7244 | leency | 146 | ch_hidden.checked = file_info_general.hidden; |
147 | ch_system.checked = file_info_general.system; |
||
148 | } |
||
5510 | punk_joker | 149 | edit_box_set_text stdcall (#path_to_file_ed, path); |
8949 | leency | 150 | |
5447 | punk_joker | 151 | |
7227 | leency | 152 | loop() switch(WaitEvent()) |
5447 | punk_joker | 153 | { |
154 | case evButton: |
||
155 | id=GetButtonID(); |
||
156 | ch_read_only.click(id); |
||
7244 | leency | 157 | ch_hidden.click(id); |
158 | ch_system.click(id); |
||
159 | if (apply_question_active) |
||
7593 | leency | 160 | { |
5688 | punk_joker | 161 | IF (id==B_SETINGS_APPLY_SUBFOLDER) |
7593 | leency | 162 | SetProperties(SET_PROPERTIES_ALL_SUBFOLDER); |
163 | IF (id==B_SETINGS_APPLY_NO_SUBFOLDER) |
||
164 | SetProperties(SET_PROPERTIES_NO_SUBFOLDER); |
||
165 | break; |
||
5688 | punk_joker | 166 | } |
167 | if (id==1) || (id==B_CLOSE) |
||
7593 | leency | 168 | { |
5591 | pavelyakov | 169 | cmd_free=3; |
170 | ExitProcess(); |
||
171 | } |
||
172 | if (id==B_APPLY) EventApplyProperties(); |
||
7593 | leency | 173 | break; |
5447 | punk_joker | 174 | |
175 | |||
176 | edit_box_mouse stdcall (#file_name_ed); |
||
177 | edit_box_mouse stdcall (#path_to_file_ed); |
||
178 | break; |
||
179 | |||
180 | |||
181 | GetKeys(); |
||
5707 | leency | 182 | |
7593 | leency | 183 | |
184 | { |
||
5688 | punk_joker | 185 | IF (key_scancode==SCAN_CODE_ENTER) |
7593 | leency | 186 | SetProperties(SET_PROPERTIES_ALL_SUBFOLDER); |
187 | IF (key_scancode==SCAN_CODE_ESC) |
||
188 | SetProperties(SET_PROPERTIES_NO_SUBFOLDER); |
||
189 | break; |
||
5688 | punk_joker | 190 | } |
191 | |||
7593 | leency | 192 | |
193 | { |
||
5591 | pavelyakov | 194 | case SCAN_CODE_ESC: |
7593 | leency | 195 | cmd_free=3; |
196 | ExitProcess(); |
||
197 | break; |
||
198 | |||
199 | |||
200 | EventApplyProperties(); |
||
201 | break; |
||
202 | |||
203 | |||
7914 | leency | 204 | case SCAN_CODE_KEY_C: |
205 | if (key_modifier & KEY_LCTRL) || (key_modifier & KEY_RCTRL) { |
||
7605 | leency | 206 | EAX = key_editbox; |
207 | edit_box_key stdcall(#file_name_ed); |
||
208 | edit_box_key stdcall(#path_to_file_ed); |
||
209 | } |
||
210 | } |
||
5591 | pavelyakov | 211 | break; |
5447 | punk_joker | 212 | |
213 | |||
214 | DrawPropertiesWindow(); |
||
5688 | punk_joker | 215 | } |
216 | } |
||
217 | |||
5450 | leency | 218 | |
5688 | punk_joker | 219 | { |
220 | proc_info pform; |
||
7593 | leency | 221 | char element_size_label[32]; |
7369 | leency | 222 | char folder_info[200]; |
223 | dword ext1; |
||
6757 | leency | 224 | dword element_size; |
7369 | leency | 225 | incn y; |
7244 | leency | 226 | char temp_path[PATHLEN]; |
9535 | leency | 227 | bool show_date = false; |
228 | |||
229 | |||
230 | if (getSelectedCount()) show_date = false; |
||
231 | |||
232 | |||
233 | GetProcessInfo(#pform, SelfInfo); |
||
7593 | leency | 234 | |
7041 | leency | 235 | |
7593 | leency | 236 | DrawStandartCaptButton(pform.cwidth -208, pform.cheight-34, B_APPLY, T_APPLY); |
237 | |||
5688 | punk_joker | 238 | |
7806 | leency | 239 | edit_box_draw stdcall (#path_to_file_ed); |
7041 | leency | 240 | |
241 | |||
8983 | leency | 242 | { |
6403 | punk_joker | 243 | PropertiesDrawIcon(NULL, " |
7086 | leency | 244 | sprintf(#folder_info,T_FILES_FOLDERS,more_files_count.files,more_files_count.folders); |
9535 | leency | 245 | WriteText(file_name_ed.left+4, 30, 0x90, sc.work_text, #folder_info); |
7806 | leency | 246 | sprintf(#element_size_label,T_PROP_SIZE,ConvertSize64(more_files_count.bytes, NULL),more_files_count.bytes); |
9535 | leency | 247 | WriteText(10, 97, 0x90, sc.work_text, #element_size_label); |
248 | } |
||
7041 | leency | 249 | else |
250 | { |
||
251 | if ( file_info_general.isfolder ) |
||
252 | PropertiesDrawIcon(NULL, " |
||
253 | else { |
||
254 | sprintf(#temp_path,"%s/%s",path,#file_name2); |
||
8949 | leency | 255 | ext1 = strrchr(#file_name2,'.'); |
7041 | leency | 256 | if (ext1) ext1 += #file_name2; |
257 | PropertiesDrawIcon(#temp_path, ext1); |
||
258 | } |
||
259 | WriteText(file_name_ed.left, file_name_ed.top-15, 0x80, sc.work_text, PR_T_NAME); |
||
7806 | leency | 260 | DrawEditBox(#file_name_ed); |
7227 | leency | 261 | |
5688 | punk_joker | 262 | |
9535 | leency | 263 | element_size = file_info_general.sizelo; |
264 | } else { |
||
265 | sprintf(#folder_info,T_FILES_FOLDERS,more_files_count.files,more_files_count.folders); |
||
9576 | leency | 266 | WriteText(10, 117, 0x90, sc.work_text, PR_T_CONTAINS); |
9535 | leency | 267 | WriteText(120, 117, 0x90, sc.work_text, #folder_info); |
268 | element_size = dir_size.bytes; |
||
7369 | leency | 269 | } |
5688 | punk_joker | 270 | sprintf(#element_size_label,T_PROP_SIZE,ConvertSize64(element_size, NULL),element_size); |
9535 | leency | 271 | WriteText(10, 99, 0x90, sc.work_text, #element_size_label); |
272 | } |
||
273 | |||
274 | |||
275 | WriteTextLines(10, 136, 0x90, sc.work_text, CREATED_OPENED_MODIFIED, 20); |
||
7806 | leency | 276 | DrawDate(120, 136, sc.work_text, #file_info_general.datecreate); |
9535 | leency | 277 | DrawDate(120, 156, sc.work_text, #file_info_general.datelastaccess); |
7806 | leency | 278 | DrawDate(120, 176, sc.work_text, #file_info_general.datelastedit); |
9535 | leency | 279 | } |
280 | |||
7041 | leency | 281 | |
9535 | leency | 282 | ch_read_only.draw(24, y.inc(18)); |
7244 | leency | 283 | ch_hidden.draw(24, y.inc(24)); |
284 | ch_system.draw(24, y.inc(24)); |
||
285 | if (apply_question_active) ShowConfirmQuestionPopin(); |
||
7593 | leency | 286 | } |
5463 | leency | 287 | |
288 | |||
7041 | leency | 289 | { |
290 | int icon_n = ini_icons.get(file_path, extension, 32); |
||
9576 | leency | 291 | draw_icon_32(12, 22, sc.work, icon_n); |
292 | } |
||
7041 | leency | 293 | |
7593 | leency | 294 | |
295 | { |
||
296 | if (getSelectedCount()) || (itdir) { |
||
8983 | leency | 297 | ShowConfirmQuestionPopin(); |
7593 | leency | 298 | } else { |
299 | SetProperties(SET_PROPERTIES_SINGLE_FILE); |
||
300 | } |
||
301 | } |
||
302 |