Subversion Repositories Kolibri OS

Rev

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