Subversion Repositories Kolibri OS

Rev

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