Subversion Repositories Kolibri OS

Rev

Rev 9693 | 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.line);
9602 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.sizelo += file_info_dirsize.sizelo;
9693 leency 122
				more_files_count.sizehi += file_info_dirsize.sizehi;
123
				more_files_count.files++;
7369 leency 124
			}
5510 punk_joker 125
		}
6646 leency 126
	}
5510 punk_joker 127
}
128
129
 
5447 punk_joker 130
{
131
	int id;
7244 leency 132
5447 punk_joker 133
 
8983 leency 134
	{
5688 punk_joker 135
		more_files_count.get(NULL);
7369 leency 136
		GetSizeMoreFiles(path);
8949 leency 137
		ch_read_only.checked = 0;
7244 leency 138
		ch_hidden.checked = 0;
139
		ch_system.checked = 0;
140
	}
5688 punk_joker 141
	else
5510 punk_joker 142
	{
143
		GetFileInfo(#file_path, #file_info_general);
144
		edit_box_set_text stdcall (#file_name_ed, #file_name);
8336 leency 145
		if(itdir) dir_size.get(#file_path);
7369 leency 146
		ch_read_only.checked = file_info_general.readonly;
7244 leency 147
		ch_hidden.checked = file_info_general.hidden;
148
		ch_system.checked = file_info_general.system;
149
	}
5510 punk_joker 150
	edit_box_set_text stdcall (#path_to_file_ed, path);
8949 leency 151
5447 punk_joker 152
 
7227 leency 153
	loop() switch(WaitEvent())
5447 punk_joker 154
	{
155
		case evButton:
156
				id=GetButtonID();
157
				ch_read_only.click(id);
7244 leency 158
				ch_hidden.click(id);
159
				ch_system.click(id);
160
				if (apply_question_active)
7593 leency 161
				{
5688 punk_joker 162
					IF (id==B_SETINGS_APPLY_SUBFOLDER)
7593 leency 163
						SetProperties(SET_PROPERTIES_ALL_SUBFOLDER);
164
					IF (id==B_SETINGS_APPLY_NO_SUBFOLDER)
165
						SetProperties(SET_PROPERTIES_NO_SUBFOLDER);
166
					break;
5688 punk_joker 167
				}
168
				if (id==1) || (id==B_CLOSE)
7593 leency 169
				{
5591 pavelyakov 170
					cmd_free=3;
171
					ExitProcess();
172
				}
173
				if (id==B_APPLY) goto _APPLY_PROPERTIES;
9693 leency 174
				break;
5447 punk_joker 175
176
 
177
				edit_box_mouse stdcall (#file_name_ed);
178
				edit_box_mouse stdcall (#path_to_file_ed);
179
				break;
180
181
 
182
				GetKeys();
5707 leency 183
7593 leency 184
 
185
				{
5688 punk_joker 186
					IF (key_scancode==SCAN_CODE_ENTER)
7593 leency 187
						SetProperties(SET_PROPERTIES_ALL_SUBFOLDER);
188
					IF (key_scancode==SCAN_CODE_ESC)
189
						SetProperties(SET_PROPERTIES_NO_SUBFOLDER);
190
					break;
5688 punk_joker 191
				}
192
7593 leency 193
 
194
				{
5591 pavelyakov 195
					case SCAN_CODE_ESC:
7593 leency 196
						cmd_free=3;
197
						ExitProcess();
198
						break;
199
200
 
201
						_APPLY_PROPERTIES:
9693 leency 202
						if (getSelectedCount()) || (itdir) {
203
							ShowConfirmQuestionPopin();
204
						} else {
205
							SetProperties(SET_PROPERTIES_SINGLE_FILE);
206
						}
207
						break;
7593 leency 208
209
 
7914 leency 210
					case SCAN_CODE_KEY_C:
211
						if (key_modifier & KEY_LCTRL) || (key_modifier & KEY_RCTRL) {
9727 Coldy 212
							edit_box_key_c stdcall(#file_name_ed,key_editbox);
213
							edit_box_key_c stdcall(#path_to_file_ed,key_editbox);
214
						}
7605 leency 215
				}
5591 pavelyakov 216
				break;
5447 punk_joker 217
218
 
219
				DrawPropertiesWindow();
5688 punk_joker 220
	}
221
}
222
5450 leency 223
 
5688 punk_joker 224
{
225
	proc_info pform;
7593 leency 226
	dword ext1;
6757 leency 227
	incn y;
7244 leency 228
	char temp_path[PATHLEN];
9535 leency 229
	bool show_date = false;
230
231
 
9693 leency 232
	dword p_q_size_bytes;
233
	dword t_contains_files_and_folders[200];
234
235
 
9535 leency 236
	if (getSelectedCount()) show_date = false;
237
238
 
9693 leency 239
	GetProcessInfo(#pform, SelfInfo);
7593 leency 240
7041 leency 241
 
7593 leency 242
	DrawStandartCaptButton(pform.cwidth -208, pform.cheight-34, B_APPLY, T_APPLY);
243
5688 punk_joker 244
 
8983 leency 245
	{
6403 punk_joker 246
		PropertiesDrawIcon(NULL, "");
7086 leency 247
		WriteText(file_name_ed.left+4, 30, 0x90, sc.work_text, T_BULK_SELECTION);
9693 leency 248
		p_t_formated_size = ConvertSize64(more_files_count.sizelo, more_files_count.sizehi);
249
		p_q_size_bytes = #more_files_count.sizelo;
250
		sprintf(#t_contains_files_and_folders,T_FILES_FOLDERS,more_files_count.files,more_files_count.folders);
251
	} else {
252
		WriteText(file_name_ed.left, file_name_ed.top-15, 0x80, sc.work_text, T_NAME);
253
		DrawEditBox(#file_name_ed);
254
		if (itdir) {
255
			PropertiesDrawIcon(NULL, "");
256
			p_t_formated_size = ConvertSize64(dir_size.sizelo, dir_size.sizehi);
257
			p_q_size_bytes = #dir_size.sizelo;
258
			sprintf(#t_contains_files_and_folders,T_FILES_FOLDERS,dir_size.files,dir_size.folders);
259
		} else {
260
			sprintf(#temp_path,"%s/%s",path,#file_name2);
8949 leency 261
			if (ext1 = strrchr(#file_name2,'.')) ext1 += #file_name2;
9693 leency 262
			PropertiesDrawIcon(#temp_path, ext1);
7041 leency 263
			p_t_formated_size = ConvertSize64(file_info_general.sizelo, file_info_general.sizehi);
9693 leency 264
			p_q_size_bytes = #file_info_general.sizelo;
265
			sprintf(#t_contains_files_and_folders,T_DATA);
266
		}
267
	}
9535 leency 268
	WriteTextLines(10, y.set(78), 0x90, sc.work_text, T_PATH_SIZE, 20);
9693 leency 269
	edit_box_draw stdcall (#path_to_file_ed);
270
9535 leency 271
 
9693 leency 272
	WriteNumber(120, y.inc(20), 0x90, sc.work_text, 0xc0140001, p_q_size_bytes);
273
	WriteText(120, y.inc(20), 0x90, sc.work_text, #t_contains_files_and_folders);
274
275
 
9535 leency 276
		WriteTextLines(10, y.inc(32), 0x90, sc.work_text, CREATED_OPENED_MODIFIED, 20);
9693 leency 277
		DrawDateTime(120, y.n, sc.work_text, #file_info_general.datecreate, #file_info_general.timecreate);
278
		DrawDateTime(120, y.inc(20), sc.work_text, #file_info_general.datelastaccess, #file_info_general.timelastaccess);
279
		DrawDateTime(120, y.inc(20), sc.work_text, #file_info_general.datelastedit, #file_info_general.timelastedit);
280
	}
9535 leency 281
7041 leency 282
 
9535 leency 283
	ch_read_only.draw(24, y.inc(18));
7244 leency 284
	ch_hidden.draw(24, y.inc(24));
285
	ch_system.draw(24, y.inc(24));
286
	if (apply_question_active) ShowConfirmQuestionPopin();
7593 leency 287
}
5463 leency 288
289
 
7041 leency 290
{
291
	int icon_n = ini_icons.get(file_path, extension, 32);
9576 leency 292
	draw_icon_32(12, 22, sc.work, icon_n);
293
}
7041 leency 294