Subversion Repositories Kolibri OS

Rev

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