Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
5416 punk_joker 1
 
2
	?define TITLE_SETT "Настройки"
3
	?define SHOW_DEVICE_CLASS "Выводить названия класса устройств"
5526 leency 4
	?define SHOW_REAL_NAMES "Показывать имена файлов не меняя регистр"
5
	?define SHOW_STATUS_BAR "Показывать статус бар"
6505 punk_joker 6
	?define NOTIFY_COPY_END "Уведомлять о завершении копирования"
6290 leency 7
	?define SHOW_BREADCRUMBS "Использовать 'хлебные крошки'"
8
	?define BIG_ICONS "Использовать большие иконки"
7242 leency 9
	?define USE_TWO_PANELS "Две панели"
6290 leency 10
	?define FONT_SIZE_LABEL "Размер шрифта"
5743 leency 11
	?define LIST_LINE_HEIGHT "Высота строки в списке"
5526 leency 12
	?define SAVE_PATH_AS_DEFAULT "Текущий путь"
6403 punk_joker 13
	?define SAVE_START_PATH_AS_DEFAULT "Введенный путь"
14
	?define EDIT_FILE_ASSOCIATIONS "Редактировать ассоциации файлов"
6290 leency 15
	?define START_PATH " Стартовый путь: "
7227 leency 16
#else
5416 punk_joker 17
	?define TITLE_SETT "Settings"
5428 leency 18
	?define SHOW_DEVICE_CLASS "Show device class name"
5526 leency 19
	?define SHOW_REAL_NAMES "Show file names in original case"
6278 leency 20
	?define SHOW_STATUS_BAR "Show status bar"
6505 punk_joker 21
	?define NOTIFY_COPY_END "Notify when copying finished"
6290 leency 22
	?define SHOW_BREADCRUMBS "Show breadcrumbs"
23
	?define BIG_ICONS "Big icons in list"
7242 leency 24
	?define USE_TWO_PANELS "Two panels"
6290 leency 25
	?define FONT_SIZE_LABEL "Font size"
5743 leency 26
	?define LIST_LINE_HEIGHT "List line height"
5526 leency 27
	?define SAVE_PATH_AS_DEFAULT "Сurrent path"
6403 punk_joker 28
	?define SAVE_START_PATH_AS_DEFAULT "Typed path"
29
	?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
6290 leency 30
	?define START_PATH " Start path: "
7227 leency 31
#endif
5416 punk_joker 32
33
 
5748 leency 34
5416 punk_joker 35
 
6403 punk_joker 36
char path_start[4096]="\0";
37
edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098,
7227 leency 38
	                      #path_start,#set_mouse_dd, 100000000000010b,0,0};
39
6403 punk_joker 40
 
7244 leency 41
more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT };
7243 leency 42
checkbox show_dev_name    = { SHOW_DEVICE_CLASS };
7244 leency 43
checkbox show_real_names  = { SHOW_REAL_NAMES };
44
checkbox show_status_bar  = { SHOW_STATUS_BAR };
45
checkbox info_after_copy  = { NOTIFY_COPY_END };
46
checkbox show_breadcrumb  = { SHOW_BREADCRUMBS };
47
checkbox big_icons        = { BIG_ICONS };
48
checkbox two_panels       = { USE_TWO_PANELS };
49
7243 leency 50
 
51
 
5416 punk_joker 52
{
53
	int id;
7244 leency 54
	active_settings=1;
5761 leency 55
	font_size.value = kfont.size.pt;
7243 leency 56
	line_height.value = files.item_h;
57
	SetEventMask(0x27);
6403 punk_joker 58
	loop(){
5576 pavelyakov 59
		switch(WaitEvent())
5591 pavelyakov 60
		{
61
			case evMouse:
6403 punk_joker 62
				edit_box_mouse stdcall (#path_start_ed);
63
				break;
64
65
 
5591 pavelyakov 66
				id=GetButtonID();
5416 punk_joker 67
				if (1==id) { ExitSettings(); break; }
7244 leency 68
				else if (id==5)
5591 pavelyakov 69
				{
5435 leency 70
					RunProgram("tinypad", "/sys/settings/assoc.ini");
71
					break;
5463 leency 72
				}
5435 leency 73
				else if (id==6)
5833 pavelyakov 74
				{
75
					strcpy(#path_start,#path);
6403 punk_joker 76
					path_start_ed.size = strlen(#path_start);
77
					path_start_ed.pos = strlen(#path_start);
78
					ini.SetString("DefaultPath", #path, strlen(#path));
7202 leency 79
					edit_box_draw stdcall (#path_start_ed);
6403 punk_joker 80
					break;
5833 pavelyakov 81
				}
82
				else if (id==7)
6403 punk_joker 83
				{
84
					ini.SetString("DefaultPath", #path_start,strlen(#path_start));
7202 leency 85
					break;
6403 punk_joker 86
				}
87
				show_dev_name.click(id);
7244 leency 88
				if (show_real_names.click(id)) action_buf=109;
89
				info_after_copy.click(id);
90
				two_panels.click(id);
91
				show_breadcrumb.click(id);
92
				show_status_bar.click(id);
93
				if (font_size.click(id)) {
94
					kfont.size.pt = font_size.value;
7243 leency 95
					kfont.changeSIZE();
96
					BigFontsChange();
97
				}
98
				if (line_height.click(id)) files.item_h = line_height.value;
7244 leency 99
				if (big_icons.click(id)) BigIconsSwitch();
100
				EventRedrawWindow(Form.left,Form.top);
5606 pavelyakov 101
				break;
6403 punk_joker 102
5591 pavelyakov 103
 
104
				GetKeys();
5707 leency 105
				if (key_scancode==SCAN_CODE_ESC) ExitSettings();
5743 leency 106
				EAX= key_ascii << 8;
6403 punk_joker 107
				edit_box_key stdcall (#path_start_ed);
108
				break;
5416 punk_joker 109
5591 pavelyakov 110
 
111
				DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 400,
7242 leency 112
					410+skin_height,0x34,system.color.work,TITLE_SETT,0);
113
				DrawSettingsCheckBoxes();
5463 leency 114
		}
5591 pavelyakov 115
	}
5416 punk_joker 116
}
5428 leency 117
118
 
5743 leency 119
{
120
	active_settings = 0;
5761 leency 121
	settings_window = 0;
5743 leency 122
	cmd_free = 4;
123
	ExitProcess();
124
}
125
126
 
5463 leency 127
{
128
	incn y;
6289 leency 129
	int x=11, frx=26, but_x;
7227 leency 130
	y.n = 0;
6289 leency 131
	show_dev_name.draw(x, y.inc(14));
7244 leency 132
	show_real_names.draw(x, y.inc(25));
133
	show_status_bar.draw(x, y.inc(25));
134
	info_after_copy.draw(x, y.inc(25));
135
	show_breadcrumb.draw(x, y.inc(25));
136
	big_icons.draw(x, y.inc(25));
137
	two_panels.draw(x, y.inc(25));
138
	font_size.draw(x, y.inc(31));
7243 leency 139
	line_height.draw(x, y.inc(31));
140
7227 leency 141
 
142
	// START_PATH {
143
	path_start_ed.top = y.inc(21);
144
	path_start_ed.left = frx;
145
	DrawEditBox(#path_start_ed);
6406 punk_joker 146
	but_x = DrawStandartCaptButton(frx, y.inc(34), 6, SAVE_PATH_AS_DEFAULT);
7227 leency 147
	DrawStandartCaptButton(frx+but_x, y.inc(0), 7, SAVE_START_PATH_AS_DEFAULT);
148
	// } START_PATH
149
150
 
151
}
5463 leency 152
5428 leency 153
 
5463 leency 154
 
5441 leency 155
{
5428 leency 156
	ini.path = GetIni(#eolite_ini_path, "EOLITE.INI");
7202 leency 157
	ini.section = "Config";
158
159
 
5767 leency 160
	show_real_names.checked = ini.GetInt("RealFileNamesCase", true);
7244 leency 161
	show_dev_name.checked   = ini.GetInt("ShowDeviceName", true);
162
	show_status_bar.checked = ini.GetInt("ShowStatusBar", true);
163
	info_after_copy.checked = ini.GetInt("InfoAfterCopy", false);
164
	two_panels.checked      = ini.GetInt("TwoPanels", false);
165
	kfont.size.pt   = ini.GetInt("FontSize", 13);
7202 leency 166
	files.item_h    = ini.GetInt("LineHeight", 19);
167
	WinX = ini.GetInt("WinX", 200);
168
	WinY = ini.GetInt("WinY", 50);
169
	WinW = ini.GetInt("WinW", 550);
170
	WinH = ini.GetInt("WinH", 506);
171
	ini.GetString("DefaultPath", #path, 4096, "/rd/1");
172
	ini.GetString("DefaultPath", #path_start, 4096, "/rd/1");
173
	path_start_ed.size = strlen(#path_start);
6403 punk_joker 174
	path_start_ed.pos = strlen(#path_start);
175
5974 leency 176
 
5987 leency 177
	kfont.init(#temp);
6806 leency 178
	ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
5974 leency 179
	if(!strcmp(#temp,"off")) kfont.smooth = false; else kfont.smooth = true;
6806 leency 180
}
5428 leency 181
182
 
5687 leency 183
 
5441 leency 184
{
185
	ini.SetInt("ShowDeviceName", show_dev_name.checked);
7244 leency 186
	ini.SetInt("ShowStatusBar", show_status_bar.checked);
187
	ini.SetInt("RealFileNamesCase", show_real_names.checked);
188
	ini.SetInt("InfoAfterCopy", info_after_copy.checked);
189
	ini.SetInt("FontSize", kfont.size.pt);
7202 leency 190
	ini.SetInt("TwoPanels", two_panels.checked);
7244 leency 191
	ini.SetInt("LineHeight", files.item_h);
7202 leency 192
	ini.SetInt("WinX", Form.left);
193
	ini.SetInt("WinY", Form.top);
194
	ini.SetInt("WinW", Form.width);
195
	ini.SetInt("WinH", Form.height);
196
}
5441 leency 197
5428 leency 198
 
5441 leency 199
 
200
 
5428 leency 201
{
202
	char error_message[500];
203
	dword ii;
204
	if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y);
5825 leency 205
	pause(5);
5428 leency 206
	sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
5576 pavelyakov 207
	notify(#error_message);
5620 leency 208
}
5428 leency 209
210
 
211
 
212
{
213
	system.color.get();
6191 leency 214
	//system.color.work = 0xE4DFE1;
215
	//system.color.work_text = 0;
216
	//system.color.work_graph  = 0x7E87A3; //A0A0B8;
217
	//system.color.work_button = 0x7E87A3;
218
	//system.color.work_button_text = 0x000000
219
	col_work    = 0xE4DFE1;
220
	col_padding = 0xC8C9C9;
5428 leency 221
	col_selec   = 0x94AECE;
5767 leency 222
	col_lpanel  = 0x00699C;
5428 leency 223
	col_graph   = 0x7E87A3;
6191 leency 224
}
5463 leency 225
226
 
227
 
5687 leency 228
{
229
	files.item_h = kfont.size.pt + 4;
6806 leency 230
	if (files.item_h<18) files.item_h = 18;
5825 leency 231
	files_active.item_h = files_inactive.item_h = files.item_h;
232
}
5687 leency 233
7244 leency 234
 
235
{
236
	if (big_icons.checked)
237
	{
238
		icon_size=32;
239
		files.item_h = line_height.value = 34;
240
		if (!icons32_default.image)
241
		{
242
			Libimg_LoadImage(#icons32_default, "/sys/icons32.png");
243
			Libimg_LoadImage(#icons32_selected, "/sys/icons32.png");
244
			Libimg_ReplaceColor(icons32_default.image, icons32_selected.w,
245
				icons32_selected.h, 0x00000000, 0xffFFFfff);
246
			Libimg_ReplaceColor(icons32_selected.image, icons32_selected.w,
247
				icons32_selected.h, 0x00000000, col_selec);
248
		}
249
	}
250
	else {
251
		icon_size=16;
252
		files.item_h = line_height.value = 18;
253
	}
254
}
255