Subversion Repositories Kolibri OS

Rev

Rev 7422 | Rev 7506 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5447 punk_joker 1
#ifdef LANG_RUS
5451 leency 2
	?define WINDOW_TITLE_PROPERTIES "Свойства"
5447 punk_joker 3
	?define BTN_CLOSE "Закрыть"
5688 punk_joker 4
	?define BTN_APPLY "Применить"
5
	?define QUEST_1 "Применить ко всем вложенным"
6278 leency 6
	?define QUEST_2 "файлам и папкам?"
5457 leency 7
	?define PR_T_NAME "Имя:"
8
	?define PR_T_DEST "Расположение:"
9
	?define PR_T_SIZE "Размер:"
5962 leency 10
	?define CREATED_OPENED_MODIFIED "Создан:\nОткрыт:\nИзменен:"
5447 punk_joker 11
	?define SET_6 "Файлов: "
12
	?define SET_7 " Папок: "
5457 leency 13
	?define PR_T_CONTAINS "Содержит: "
5450 leency 14
	?define FLAGS " Аттрибуты "
5457 leency 15
	?define PR_T_HIDDEN "Скрытый"
16
	?define PR_T_SYSTEM "Системный"
17
	?define PR_T_ONLY_READ "Только чтение"
5591 pavelyakov 18
	?define SET_BYTE_LANG "байт"
5833 pavelyakov 19
#else // Apply to all subfolders
6281 punk_joker 20
	?define WINDOW_TITLE_PROPERTIES "Properties"
5450 leency 21
	?define BTN_CLOSE "Close"
5688 punk_joker 22
	?define BTN_APPLY "Apply"
5833 pavelyakov 23
	?define QUEST_1 "Apply to all subfolders"
6278 leency 24
	?define QUEST_2 "files and Folders?"
5457 leency 25
	?define PR_T_NAME "Name:"
26
	?define PR_T_DEST "Destination:"
27
	?define PR_T_SIZE "Size:"
5962 leency 28
	?define CREATED_OPENED_MODIFIED "Created:\nOpened:\nModified:"
5450 leency 29
	?define SET_6 "Files: "
30
	?define SET_7 " Folders: "
5457 leency 31
	?define PR_T_CONTAINS "Contains: "
5450 leency 32
	?define FLAGS " Attributes "
5457 leency 33
	?define PR_T_HIDDEN "Hidden"
34
	?define PR_T_SYSTEM "System"
35
	?define PR_T_ONLY_READ "Read-only"
5591 pavelyakov 36
	?define SET_BYTE_LANG "byte"
5447 punk_joker 37
#endif
38
 
7041 leency 39
char path_to_file[4096];
40
char file_name2[4096];
7369 leency 41
edit_box file_name_ed = {230,59,32,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(file_name2),#file_name2,NULL, 1000000000000000b,2,2};
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};
5447 punk_joker 43
 
5463 leency 44
BDVK file_info_general;
45
BDVK file_info_dirsize;
5447 punk_joker 46
 
7244 leency 47
bool quest_active;
5688 punk_joker 48
 
7369 leency 49
_dir_size more_files_count;
50
 
7244 leency 51
checkbox ch_read_only = { PR_T_ONLY_READ, NULL };
52
checkbox ch_hidden = { PR_T_HIDDEN, NULL };
53
checkbox ch_system = { PR_T_SYSTEM, NULL };
54
 
55
void SetPropertiesFile(dword cur_file, bdvk_pointer)
56
{
57
	GetFileInfo(cur_file, bdvk_pointer);
58
	ESI = bdvk_pointer;
59
	ESI.BDVK.readonly = ch_read_only.checked;
60
	ESI.BDVK.hidden = ch_hidden.checked;
61
	ESI.BDVK.system = ch_system.checked;
62
	SetFileInfo(cur_file, bdvk_pointer);
63
}
64
 
5688 punk_joker 65
void SetPropertiesDir(dword way)
5554 punk_joker 66
{
5688 punk_joker 67
	dword dirbuf, fcount, i, filename;
68
	dword cur_file;
6251 leency 69
	if (dir_exists(way))
5688 punk_joker 70
	{
71
		cur_file = malloc(4096);
72
		GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL);
73
		for (i=0; i
74
		{
75
			filename = i*304+dirbuf+72;
76
			strcpy(cur_file, way);
77
			chrcat(cur_file, '/');
78
			strcat(cur_file, filename);
79
			if ( TestBit(ESDWORD[filename-40], 4) )
80
			{
81
				SetPropertiesDir(cur_file);
82
			}
7244 leency 83
			SetPropertiesFile(cur_file, #file_info_dirsize);
5688 punk_joker 84
		}
85
		free(cur_file);
86
	}
87
}
88
 
89
void SetProperties(byte prop)
90
{
91
	dword cur_file;
7422 leency 92
	dword i;
5688 punk_joker 93
 
94
	if (prop==1) || (prop==2)
95
	{
96
		if (selected_count)
97
		{
98
			cur_file = malloc(4096);
99
			for (i=0; i
100
			{
6646 leency 101
				if (getElementSelectedFlag(i) == true)
5688 punk_joker 102
				{
103
					strcpy(cur_file, #path);
104
					strcat(cur_file, file_mas[i]*304+buf+72);
7244 leency 105
					SetPropertiesDir(cur_file);
5688 punk_joker 106
					if (prop==2)
107
					{
6251 leency 108
						if (dir_exists(cur_file))
5688 punk_joker 109
						{
110
							SetPropertiesDir(cur_file);
111
						}
112
					}
113
				}
114
			}
115
			free(cur_file);
116
		}
117
		else
118
		{
7244 leency 119
			SetPropertiesFile(#file_path, #file_info_general);
5688 punk_joker 120
			if (prop==2) SetPropertiesDir(#file_path);
121
		}
122
		quest_active = 0;
123
		DrawPropertiesWindow();
124
	}
5554 punk_joker 125
	else
126
	{
7244 leency 127
		SetPropertiesFile(#file_path, #file_info_general);
5554 punk_joker 128
	}
5688 punk_joker 129
	cmd_free=3;
130
	_not_draw = true;
6646 leency 131
	Open_Dir(#path,WITH_REDRAW);
132
	_not_draw = false;
133
	EventRedrawWindow(Form.left,Form.top);
5688 punk_joker 134
	ExitProcess();
5554 punk_joker 135
}
5487 leency 136
 
6278 leency 137
void ShowConfirmQuestionPopin()
5688 punk_joker 138
{
6278 leency 139
	quest_active = 1;
6280 punk_joker 140
	DrawPopup(15,80,250,90,1,system.color.work, system.color.work_graph);
141
	WriteText(35, 102, 0x90, 0x000000, QUEST_1);
142
	WriteText(65, 117, 0x90, 0x000000, QUEST_2);
7278 leency 143
	DrawStandartCaptButton(62,138,301,T_YES);
144
	DrawStandartCaptButton(155,138,302,T_NO);
5688 punk_joker 145
}
146
 
5510 punk_joker 147
void GetSizeMoreFiles(dword way)
148
{
149
	char cur_file[4096];
7422 leency 150
	dword i;
5957 punk_joker 151
 
5510 punk_joker 152
	for (i=0; i
6646 leency 153
	{
154
		if (getElementSelectedFlag(i) == true)
155
		{
6635 leency 156
			sprintf(#cur_file,"%s/%s",way,file_mas[i]*304+buf+72);
5691 punk_joker 157
			if (TestBit(ESDWORD[file_mas[i]*304+buf+32], 4) )
5510 punk_joker 158
			{
7369 leency 159
				more_files_count.calculate_loop(#cur_file);
160
				more_files_count.folders++;
5510 punk_joker 161
			}
162
			else
163
			{
5957 punk_joker 164
				GetFileInfo(#cur_file, #file_info_dirsize);
7369 leency 165
				more_files_count.bytes += file_info_dirsize.sizelo;
166
				more_files_count.files++;
5510 punk_joker 167
			}
6646 leency 168
		}
5510 punk_joker 169
	}
170
}
171
 
5447 punk_joker 172
void properties_dialog()
173
{
7244 leency 174
	int id;
5447 punk_joker 175
 
5688 punk_joker 176
	if (selected_count)
177
	{
7369 leency 178
		more_files_count.get(NULL);
5688 punk_joker 179
		GetSizeMoreFiles(#path);
7244 leency 180
		ch_read_only.checked = 0;
181
		ch_hidden.checked = 0;
182
		ch_system.checked = 0;
5688 punk_joker 183
	}
5510 punk_joker 184
	else
185
	{
186
		GetFileInfo(#file_path, #file_info_general);
187
		strcpy(#file_name2, #file_name);
5591 pavelyakov 188
		file_name_ed.size = strlen(#file_name2);
7369 leency 189
		if(itdir) dir_size.get(#file_path);
7244 leency 190
		ch_read_only.checked = file_info_general.readonly;
191
		ch_hidden.checked = file_info_general.hidden;