Subversion Repositories Kolibri OS

Rev

Rev 7256 | Rev 7278 | 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
	proc_info Settings;
7254 leency 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;
7252 leency 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
				//RefreshWindow(Form.slot, Settings.slot);
7266 leency 101
				break;
6403 punk_joker 102
5591 pavelyakov 103
 
104
				GetKeys();
5707 leency 105
				if (key_scancode==SCAN_CODE_ESC) ExitSettings();
5743 leency 106
				EAX= key_ascii << 8;
6403 punk_joker 107
				edit_box_key stdcall (#path_start_ed);
108
				break;
5416 punk_joker 109
5591 pavelyakov 110
 
111
				DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 400,
7242 leency 112
					410+skin_height,0x34,system.color.work,TITLE_SETT,0);
113
				GetProcessInfo(#Settings, SelfInfo);
7254 leency 114
				DrawSettingsCheckBoxes();
5463 leency 115
		}
5591 pavelyakov 116
	}
5416 punk_joker 117
}
5428 leency 118
119
 
5743 leency 120
{
121
	active_settings = 0;
5761 leency 122
	settings_window = 0;
5743 leency 123
	cmd_free = 4;
124
	ExitProcess();
125
}
126
127
 
5463 leency 128
{
129
	incn y;
6289 leency 130
	int x=11, frx=26, but_x;
7227 leency 131
	y.n = 0;
6289 leency 132
	show_dev_name.draw(x, y.inc(14));
7244 leency 133
	show_real_names.draw(x, y.inc(25));
134
	show_status_bar.draw(x, y.inc(25));
135
	info_after_copy.draw(x, y.inc(25));
136
	show_breadcrumb.draw(x, y.inc(25));
137
	big_icons.draw(x, y.inc(25));
138
	two_panels.draw(x, y.inc(25));
139
	font_size.draw(x, y.inc(31));
7243 leency 140
	line_height.draw(x, y.inc(31));
141
7227 leency 142
 
143
	// START_PATH {
144
	DrawEditBoxPos(frx, y.inc(21), #path_start_ed);
7245 leency 145
	but_x = DrawStandartCaptButton(frx, y.inc(34), 6, SAVE_PATH_AS_DEFAULT);
7227 leency 146
	DrawStandartCaptButton(frx+but_x, y.inc(0), 7, SAVE_START_PATH_AS_DEFAULT);
147
	// } START_PATH
148
149
 
150
}
5463 leency 151
5428 leency 152
 
5463 leency 153
 
5441 leency 154
{
5428 leency 155
	ini.path = GetIni(#eolite_ini_path, "EOLITE.INI");
7202 leency 156
	ini.section = "Config";
157
158
 
5767 leency 159
	show_real_names.checked = ini.GetInt("RealFileNamesCase", true);
7244 leency 160
	show_dev_name.checked   = ini.GetInt("ShowDeviceName", true);
161
	show_status_bar.checked = ini.GetInt("ShowStatusBar", true);
162
	info_after_copy.checked = ini.GetInt("InfoAfterCopy", false);
163
	two_panels.checked      = ini.GetInt("TwoPanels", false);
164
	kfont.size.pt   = ini.GetInt("FontSize", 13);
7202 leency 165
	files.item_h    = ini.GetInt("LineHeight", 19);
166
	WinX = ini.GetInt("WinX", 200);
167
	WinY = ini.GetInt("WinY", 50);
168
	WinW = ini.GetInt("WinW", 550);
169
	WinH = ini.GetInt("WinH", 506);
170
	ini.GetString("DefaultPath", #path, 4096, "/rd/1");
171
	ini.GetString("DefaultPath", #path_start, 4096, "/rd/1");
172
	path_start_ed.size = path_start_ed.pos = strlen(#path_start);
7252 leency 173
5974 leency 174
 
5987 leency 175
	kfont.init(#temp);
6806 leency 176
	ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
5974 leency 177
	if(!strcmp(#temp,"off")) kfont.smooth = false; else kfont.smooth = true;