Subversion Repositories Kolibri OS

Rev

Rev 7245 | Rev 7254 | 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 "Current path"
7245 leency 28
	?define SAVE_START_PATH_AS_DEFAULT "Typed path"
6403 punk_joker 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
 
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
7243 leency 49
 
50
 
5416 punk_joker 51
{
52
	int id;
7244 leency 53
	active_settings=1;
5761 leency 54
	font_size.value = kfont.size.pt;
7243 leency 55
	line_height.value = files.item_h;
7252 leency 56
	SetEventMask(0x27);
6403 punk_joker 57
	loop(){
5576 pavelyakov 58
		switch(WaitEvent())
5591 pavelyakov 59
		{
60
			case evMouse:
6403 punk_joker 61
				edit_box_mouse stdcall (#path_start_ed);
62
				break;
63
64
 
5591 pavelyakov 65
				id=GetButtonID();
5416 punk_joker 66
				if (1==id) { ExitSettings(); break; }
7244 leency 67
				else if (id==5)
5591 pavelyakov 68
				{
5435 leency 69
					RunProgram("tinypad", "/sys/settings/assoc.ini");
70
					break;
5463 leency 71
				}
5435 leency 72
				else if (id==6)
5833 pavelyakov 73
				{
74
					strcpy(#path_start,#path);
6403 punk_joker 75
					path_start_ed.size = path_start_ed.pos = strlen(#path_start);
7245 leency 76
					ini.SetString("DefaultPath", #path, strlen(#path));
7202 leency 77
					edit_box_draw stdcall (#path_start_ed);
6403 punk_joker 78
					break;
5833 pavelyakov 79
				}
80
				else if (id==7)
6403 punk_joker 81
				{
82
					ini.SetString("DefaultPath", #path_start,strlen(#path_start));
7202 leency 83
					break;
6403 punk_joker 84
				}
85
				show_dev_name.click(id);
7244 leency 86
				if (show_real_names.click(id)) action_buf=109;
87
				info_after_copy.click(id);
88
				two_panels.click(id);
89
				show_breadcrumb.click(id);
90
				show_status_bar.click(id);
91
				if (font_size.click(id)) {
92
					kfont.size.pt = font_size.value;
7243 leency 93
					kfont.changeSIZE();
94
					BigFontsChange();
95
				}
96
				if (line_height.click(id)) files.item_h = line_height.value;
7244 leency 97
				if (big_icons.click(id)) BigIconsSwitch();
98
				EventRedrawWindow(Form.left,Form.top);
5606 pavelyakov 99
				break;
6403 punk_joker 100
5591 pavelyakov 101
 
102
				GetKeys();
5707 leency 103
				if (key_scancode==SCAN_CODE_ESC) ExitSettings();
5743 leency 104
				EAX= key_ascii << 8;
6403 punk_joker 105
				edit_box_key stdcall (#path_start_ed);
106
				break;
5416 punk_joker 107
5591 pavelyakov 108
 
109
				DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 400,
7242 leency 110
					410+skin_height,0x34,system.color.work,TITLE_SETT,0);
111
				DrawSettingsCheckBoxes();
5463 leency 112
		}
5591 pavelyakov 113
	}
5416 punk_joker 114
}
5428 leency 115
116
 
5743 leency 117
{
118
	active_settings = 0;
5761 leency 119
	settings_window = 0;
5743 leency 120
	cmd_free = 4;
121
	ExitProcess();
122
}
123
124
 
5463 leency 125
{
126
	incn y;
6289 leency 127
	int x=11, frx=26, but_x;
7227 leency 128
	y.n = 0;
6289 leency 129
	show_dev_name.draw(x, y.inc(14));
7244 leency 130
	show_real_names.draw(x, y.inc(25));
131
	show_status_bar.draw(x, y.inc(25));
132
	info_after_copy.draw(x, y.inc(25));
133
	show_breadcrumb.draw(x, y.inc(25));
134
	big_icons.draw(x, y.inc(25));
135
	two_panels.draw(x, y.inc(25));
136
	font_size.draw(x, y.inc(31));
7243 leency 137
	line_height.draw(x, y.inc(31));
138
7227 leency 139
 
140
	// START_PATH {
141
	DrawEditBoxPos(frx, y.inc(21), #path_start_ed);
7245 leency 142
	but_x = DrawStandartCaptButton(frx, y.inc(34), 6, SAVE_PATH_AS_DEFAULT);
7227 leency 143
	DrawStandartCaptButton(frx+but_x, y.inc(0), 7, SAVE_START_PATH_AS_DEFAULT);
144
	// } START_PATH
145
146
 
147
}
5463 leency 148
5428 leency 149
 
5463 leency 150
 
5441 leency 151
{
5428 leency 152
	ini.path = GetIni(#eolite_ini_path, "EOLITE.INI");
7202 leency 153
	ini.section = "Config";
154
155
 
5767 leency 156
	show_real_names.checked = ini.GetInt("RealFileNamesCase", true);
7244 leency 157
	show_dev_name.checked   = ini.GetInt("ShowDeviceName", true);
158
	show_status_bar.checked = ini.GetInt("ShowStatusBar", true);
159
	info_after_copy.checked = ini.GetInt("InfoAfterCopy", false);
160
	two_panels.checked      = ini.GetInt("TwoPanels", false);
161
	kfont.size.pt   = ini.GetInt("FontSize", 13);
7202 leency 162
	files.item_h    = ini.GetInt("LineHeight", 19);
163
	WinX = ini.GetInt("WinX", 200);
164
	WinY = ini.GetInt("WinY", 50);
165
	WinW = ini.GetInt("WinW", 550);
166
	WinH = ini.GetInt("WinH", 506);
167
	ini.GetString("DefaultPath", #path, 4096, "/rd/1");
168
	ini.GetString("DefaultPath", #path_start, 4096, "/rd/1");
169
	path_start_ed.size = path_start_ed.pos = strlen(#path_start);
7252 leency 170
5974 leency 171
 
5987 leency 172
	kfont.init(#temp);
6806 leency 173
	ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
5974 leency 174
	if(!strcmp(#temp,"off")) kfont.smooth = false; else kfont.smooth = true;
6806 leency 175
}
5428 leency 176
177
 
5687 leency 178
 
5441 leency 179
{
180
	ini.SetInt("ShowDeviceName", show_dev_name.checked);
7244 leency 181
	ini.SetInt("ShowStatusBar", show_status_bar.checked);
182
	ini.SetInt("RealFileNamesCase", show_real_names.checked);
183
	ini.SetInt("InfoAfterCopy", info_after_copy.checked);
184
	ini.SetInt("FontSize", kfont.size.pt);
7202 leency 185
	ini.SetInt("TwoPanels", two_panels.checked);
7244 leency 186
	ini.SetInt("LineHeight", files.item_h);
7202 leency 187
	ini.SetInt("WinX", Form.left);
188
	ini.SetInt("WinY", Form.top);
189
	ini.SetInt("WinW", Form.width);
190
	ini.SetInt("WinH", Form.height);
191
}
5441 leency 192
5428 leency 193
 
5441 leency 194
 
195
 
5428 leency 196
{
197
	char error_message[500];
198
	dword ii;
199
	if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y);
5825 leency 200
	pause(5);
5428 leency 201
	sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
5576 pavelyakov 202
	notify(#error_message);
5620 leency 203
}
5428 leency 204
205
 
206
 
207
{
208
	system.color.get();
6191 leency 209
	//system.color.work = 0xE4DFE1;
210
	//system.color.work_text = 0;
211
	//system.color.work_graph  = 0x7E87A3; //A0A0B8;
212
	//system.color.work_button = 0x7E87A3;
213
	//system.color.work_button_text = 0x000000
214
	col_work    = 0xE4DFE1;
215
	col_padding = 0xC8C9C9;
5428 leency 216
	col_selec   = 0x94AECE;
5767 leency 217
	col_lpanel  = 0x00699C;
5428 leency 218
	col_graph   = 0x7E87A3;
6191 leency 219
}
5463 leency 220
221
 
222
 
5687 leency 223
{
224
	files.item_h = kfont.size.pt + 4;
6806 leency 225
	if (files.item_h<18) files.item_h = 18;
5825 leency 226
	files_active.item_h = files_inactive.item_h = files.item_h;
227
}
5687 leency 228
7244 leency 229
 
230
{
231
	if (big_icons.checked)
232
	{
233
		icon_size=32;
234
		files.item_h = line_height.value = 34;
235
		if (!icons32_default.image)
236
		{
237
			Libimg_LoadImage(#icons32_default, "/sys/icons32.png");
238
			Libimg_LoadImage(#icons32_selected, "/sys/icons32.png");
239
			Libimg_ReplaceColor(icons32_default.image, icons32_selected.w,
240
				icons32_selected.h, 0x00000000, 0xffFFFfff);
241
			Libimg_ReplaceColor(icons32_selected.image, icons32_selected.w,
242
				icons32_selected.h, 0x00000000, col_selec);
243
		}
244
	}
245
	else {
246
		icon_size=16;
247
		files.item_h = line_height.value = 18;
248
	}
249
}
250