Subversion Repositories Kolibri OS

Rev

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