Subversion Repositories Kolibri OS

Rev

Rev 7202 | Rev 7242 | 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 USE_TWO_PANELS "Две панели"
9
	?define FONT_SIZE_LABEL "Размер шрифта"
5743 leency 10
	?define LIST_LINE_HEIGHT "Высота строки в списке"
5526 leency 11
	?define SAVE_PATH_AS_DEFAULT "Текущий путь"
6403 punk_joker 12
	?define SAVE_START_PATH_AS_DEFAULT "Введенный путь"
13
	?define EDIT_FILE_ASSOCIATIONS "Редактировать ассоциации файлов"
6290 leency 14
	?define START_PATH " Стартовый путь: "
7227 leency 15
#else
5416 punk_joker 16
	?define TITLE_SETT "Settings"
5428 leency 17
	?define SHOW_DEVICE_CLASS "Show device class name"
5526 leency 18
	?define SHOW_REAL_NAMES "Show file names in original case"
6278 leency 19
	?define SHOW_STATUS_BAR "Show status bar"
6505 punk_joker 20
	?define NOTIFY_COPY_END "Notify when copying finished"
6290 leency 21
	?define SHOW_BREADCRUMBS "Show breadcrumbs"
22
	?define USE_TWO_PANELS "Two panels"
23
	?define FONT_SIZE_LABEL "Font size"
5743 leency 24
	?define LIST_LINE_HEIGHT "List line height"
5526 leency 25
	?define SAVE_PATH_AS_DEFAULT "Сurrent path"
6403 punk_joker 26
	?define SAVE_START_PATH_AS_DEFAULT "Typed path"
27
	?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
6290 leency 28
	?define START_PATH " Start path: "
7227 leency 29
#endif
5416 punk_joker 30
31
 
5748 leency 32
5416 punk_joker 33
 
6403 punk_joker 34
char path_start[4096]="\0";
35
edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098,
7227 leency 36
	                      #path_start,#set_mouse_dd, 100000000000010b,0,0};
37
6403 punk_joker 38
 
5416 punk_joker 39
{
40
	byte id;
41
	active_settings=1;
5761 leency 42
	SetEventMask(0x27);
6403 punk_joker 43
	loop(){
5576 pavelyakov 44
		switch(WaitEvent())
5591 pavelyakov 45
		{
46
			case evMouse:
6403 punk_joker 47
				edit_box_mouse stdcall (#path_start_ed);
48
				break;
49
50
 
5591 pavelyakov 51
				id=GetButtonID();
5416 punk_joker 52
				if (id==1) { ExitSettings(); break; }
5761 leency 53
				else if (id==5)
5591 pavelyakov 54
				{
5435 leency 55
					RunProgram("tinypad", "/sys/settings/assoc.ini");
56
					break;
5463 leency 57
				}
5435 leency 58
				else if (id==6)
5833 pavelyakov 59
				{
60
					strcpy(#path_start,#path);
6403 punk_joker 61
					path_start_ed.size = strlen(#path_start);
62
					path_start_ed.pos = strlen(#path_start);
63
					ini.SetString("DefaultPath", #path, strlen(#path));
7202 leency 64
					edit_box_draw stdcall (#path_start_ed);
6403 punk_joker 65
					break;
5833 pavelyakov 66
				}
67
				else if (id==7)
6403 punk_joker 68
				{
69
					ini.SetString("DefaultPath", #path_start,strlen(#path_start));
7202 leency 70
					break;
6403 punk_joker 71
				}
72
				else if (id==20) show_dev_name ^= 1;
5591 pavelyakov 73
				else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
5743 leency 74
				else if (id==22) info_after_copy ^= 1;
5591 pavelyakov 75
				else if (id==24) two_panels ^= true;
5846 pavelyakov 76
				else if (id==32) show_breadcrumb ^= true;
6289 leency 77
				else if (id==25) { files.item_h++; files_active.item_h = files_inactive.item_h = files.item_h; }
5825 leency 78
				else if (id==26) && (files.item_h>16) files_inactive.item_h = files.item_h = files.item_h-1;
7054 leency 79
				else if (id==27) show_status_bar ^= 1;
6505 punk_joker 80
				else if (id==30) { kfont.size.pt++; IF(!kfont.changeSIZE()) kfont.size.pt--; BigFontsChange(); }
6806 leency 81
				else if (id==31) { kfont.size.pt--; IF(!kfont.changeSIZE()) kfont.size.pt++; BigFontsChange(); }
82
				EventRedrawWindow(Form.left,Form.top);
5606 pavelyakov 83
				break;
6403 punk_joker 84
5591 pavelyakov 85
 
86
				GetKeys();
5707 leency 87
				if (key_scancode==SCAN_CODE_ESC) ExitSettings();
5743 leency 88
				EAX= key_ascii << 8;
6403 punk_joker 89
				edit_box_key stdcall (#path_start_ed);
90
				break;
5416 punk_joker 91
5591 pavelyakov 92
 
93
				DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 380,
7227 leency 94
					390+skin_height,0x34,system.color.work,TITLE_SETT,0);
95
				DrawSettingsCheckBoxes();
5463 leency 96
		}
5591 pavelyakov 97
	}
5416 punk_joker 98
}
5428 leency 99
100
 
5743 leency 101
{
102
	active_settings = 0;
5761 leency 103
	settings_window = 0;
5743 leency 104
	cmd_free = 4;
105
	ExitProcess();
106
}
107
108
 
5463 leency 109
{
110
	incn y;
6289 leency 111
	int x=11, frx=26, but_x;
7227 leency 112
	y.n = 0;
6289 leency 113
	CheckBox(x, y.inc(14), 20, SHOW_DEVICE_CLASS,  show_dev_name);
6290 leency 114
	CheckBox(x, y.inc(25), 21, SHOW_REAL_NAMES,  real_files_names_case);
115
	CheckBox(x, y.inc(25), 27, SHOW_STATUS_BAR,  show_status_bar);
6505 punk_joker 116
	CheckBox(x, y.inc(25), 22, NOTIFY_COPY_END,  info_after_copy);
6290 leency 117
	CheckBox(x, y.inc(25), 32, SHOW_BREADCRUMBS,  show_breadcrumb);
118
	CheckBox(x, y.inc(25), 24, USE_TWO_PANELS,  two_panels);
119
	MoreLessBox(x, y.inc(31), 30, 31, kfont.size.pt, FONT_SIZE_LABEL);
6806 leency 120
	MoreLessBox(x, y.inc(31), 25, 26, files.item_h, LIST_LINE_HEIGHT);
6290 leency 121
7227 leency 122
 
123
	// START_PATH {
124
	path_start_ed.top = y.inc(21);
125
	path_start_ed.left = frx;
126
	DrawEditBox(#path_start_ed);
6406 punk_joker 127
	but_x = DrawStandartCaptButton(frx, y.inc(34), 6, SAVE_PATH_AS_DEFAULT);
7227 leency 128
	DrawStandartCaptButton(frx+but_x, y.inc(0), 7, SAVE_START_PATH_AS_DEFAULT);
129
	// } START_PATH
130
131
 
132
}
5463 leency 133
5428 leency 134
 
5463 leency 135
 
5441 leency 136
{
5428 leency 137
	ini.path = GetIni(#eolite_ini_path, "EOLITE.INI");
7202 leency 138
	ini.section = "Config";
139
140
 
5767 leency 141
	real_files_names_case = ini.GetInt("RealFileNamesCase", 1);
7202 leency 142
	show_dev_name   = ini.GetInt("ShowDeviceName", 1);
143
	show_status_bar = ini.GetInt("ShowStatusBar", 1);
144
	info_after_copy = ini.GetInt("InfoAfterCopy", 0);
145
	kfont.size.pt   = ini.GetInt("FontSize", 13);
146
	two_panels      = ini.GetInt("TwoPanels", 0);
147
	files.item_h    = ini.GetInt("LineHeight", 19);
148
	WinX = ini.GetInt("WinX", 200);
149
	WinY = ini.GetInt("WinY", 50);
150
	WinW = ini.GetInt("WinW", 550);
151
	WinH = ini.GetInt("WinH", 506);
152
	ini.GetString("DefaultPath", #path, 4096, "/rd/1");
153
	ini.GetString("DefaultPath", #path_start, 4096, "/rd/1");
154
	path_start_ed.size = strlen(#path_start);
6403 punk_joker 155
	path_start_ed.pos = strlen(#path_start);
156
5974 leency 157
 
5987 leency 158
	kfont.init(#temp);
6806 leency 159
	ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
5974 leency 160
	if(!strcmp(#temp,"off")) kfont.smooth = false; else kfont.smooth = true;
6806 leency 161
}
5428 leency 162
163
 
5687 leency 164
 
5441 leency 165
{
166
	ini.SetInt("ShowDeviceName", show_dev_name);
7202 leency 167
	ini.SetInt("ShowStatusBar", show_status_bar);
168
	ini.SetInt("RealFileNamesCase", real_files_names_case);
169
	ini.SetInt("InfoAfterCopy", info_after_copy);
170
	ini.SetInt("FontSize", kfont.size.pt);
171
	ini.SetInt("TwoPanels", two_panels);
172
	ini.SetInt("LineHeight", files.item_h);
173
	ini.SetInt("WinX", Form.left);
174
	ini.SetInt("WinY", Form.top);
175
	ini.SetInt("WinW", Form.width);
176
	ini.SetInt("WinH", Form.height);
177
}
5441 leency 178
5428 leency 179
 
5441 leency 180
 
181
 
5428 leency 182
{
183
	char error_message[500];
184
	dword ii;
185
	if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y);
5825 leency 186
	pause(5);
5428 leency 187
	sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
5576 pavelyakov 188
	notify(#error_message);
5620 leency 189
}
5428 leency 190
191
 
192
 
193
{
194
	system.color.get();
6191 leency 195
	//system.color.work = 0xE4DFE1;
196
	//system.color.work_text = 0;
197
	//system.color.work_graph  = 0x7E87A3; //A0A0B8;
198
	//system.color.work_button = 0x7E87A3;
199
	//system.color.work_button_text = 0x000000
200
	col_work    = 0xE4DFE1;
201
	col_padding = 0xC8C9C9;
5428 leency 202
	col_selec   = 0x94AECE;
5767 leency 203
	col_lpanel  = 0x00699C;
5428 leency 204
	col_graph   = 0x7E87A3;
6191 leency 205
}
5463 leency 206
207
 
208
 
5687 leency 209
{
210
	files.item_h = kfont.size.pt + 4;
6806 leency 211
	if (files.item_h<18) files.item_h = 18;
5825 leency 212
	files_active.item_h = files_inactive.item_h = files.item_h;
213
}
5687 leency 214