Subversion Repositories Kolibri OS

Rev

Rev 6746 | Rev 7004 | 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 "Стартовый путь:"
6406 punk_joker 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:"
6406 punk_joker 29
#endif
5416 punk_joker 30
31
 
5748 leency 32
int WinX, WinY, WinW, WinH;
33
5416 punk_joker 34
 
6403 punk_joker 35
char path_start[4096]="\0";
36
edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098,#path_start,#set_mouse_dd, 100000000000010b,0,0};
6678 leency 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_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,strlen(#path));
5833 pavelyakov 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_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path_start,strlen(#path_start));
70
					break;
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>15) files_inactive.item_h = files.item_h = files.item_h-1;
6291 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, 376, 370+skin_height,0x34,system.color.work,TITLE_SETT,0);
6746 leency 94
				DrawSettingsCheckBoxes();
5463 leency 95
		}
5591 pavelyakov 96
	}
5416 punk_joker 97
}
5428 leency 98
99
 
5743 leency 100
{
101
	active_settings = 0;
5761 leency 102
	settings_window = 0;
5743 leency 103
	cmd_free = 4;
104
	ExitProcess();
105
}
106
107
 
5463 leency 108
{
109
	incn y;
6289 leency 110
	int x=11, but_x;
6678 leency 111
	y.n = 0;
6289 leency 112
	CheckBox(x, y.inc(14), 20, SHOW_DEVICE_CLASS,  show_dev_name);
6290 leency 113
	CheckBox(x, y.inc(25), 21, SHOW_REAL_NAMES,  real_files_names_case);
114
	CheckBox(x, y.inc(25), 27, SHOW_STATUS_BAR,  show_status_bar);
6505 punk_joker 115
	CheckBox(x, y.inc(25), 22, NOTIFY_COPY_END,  info_after_copy);
6290 leency 116
	CheckBox(x, y.inc(25), 32, SHOW_BREADCRUMBS,  show_breadcrumb);
117
	CheckBox(x, y.inc(25), 24, USE_TWO_PANELS,  two_panels);
118
	MoreLessBox(x, y.inc(31), 30, 31, kfont.size.pt, FONT_SIZE_LABEL);
6806 leency 119
	MoreLessBox(x, y.inc(31), 25, 26, files.item_h, LIST_LINE_HEIGHT);
6290 leency 120
	WriteText(6, y.inc(28), 0xD0, system.color.work_text, START_PATH);
6406 punk_joker 121
	path_start_ed.top = y.inc(23);
122
	path_start_ed.left = x;
6403 punk_joker 123
	DrawEditBox(#path_start_ed);
6406 punk_joker 124
	but_x = DrawFlatButton(x-1, y.inc(34), 6, SAVE_PATH_AS_DEFAULT);
6678 leency 125
	DrawFlatButton(x-1+but_x, y.inc(0), 7, SAVE_START_PATH_AS_DEFAULT);
126
	DrawFlatButton(x-1, y.inc(38), 5, EDIT_FILE_ASSOCIATIONS);
127
}
5463 leency 128
5428 leency 129
 
5463 leency 130
 
5441 leency 131
{
5428 leency 132
	files.SetFont(6, 9, 10000000b);
5767 leency 133
	FileShow.font_size_x = files.font_w;
134
	FileShow.font_number = 0;
135
	ini_get_int stdcall   (eolite_ini_path, #config_section, "ShowDeviceName",    1); show_dev_name = EAX;
5748 leency 136
	ini_get_int stdcall   (eolite_ini_path, #config_section, "ShowStatusBar",    1); show_status_bar = EAX;
6505 punk_joker 137
	ini_get_int stdcall   (eolite_ini_path, #config_section, "RealFileNamesCase", 1); real_files_names_case = EAX;
138
	ini_get_int stdcall   (eolite_ini_path, #config_section, "InfoAfterCopy",     0); info_after_copy = EAX;
5748 leency 139
	ini_get_int stdcall   (eolite_ini_path, #config_section, "FontSize",         12); kfont.size.pt = EAX;
6806 leency 140
	ini_get_int stdcall   (eolite_ini_path, #config_section, "TwoPanels",         0); two_panels = EAX;
5748 leency 141
	ini_get_int stdcall   (eolite_ini_path, #config_section, "LineHeight",       19); files.item_h = EAX;
6039 leency 142
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX;
5748 leency 143
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX;
144
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX;
145
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinH", 506); WinH = EAX;
6039 leency 146
	ini_get_str stdcall   (eolite_ini_path, #config_section, "DefaultPath", #path,4096,"/rd/1");
6635 leency 147
	ini_get_str stdcall   (eolite_ini_path, #config_section, "DefaultPath", #path_start,4096,"/rd/1");
148
	path_start_ed.size = strlen(#path_start);
6403 punk_joker 149
	path_start_ed.pos = strlen(#path_start);
150
5974 leency 151
 
5987 leency 152
	kfont.init(#temp);
6806 leency 153
	ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
5974 leency 154
	if(!strcmp(#temp,"off")) kfont.smooth = false; else kfont.smooth = true;
6806 leency 155
}
5428 leency 156
157
 
5687 leency 158
 
5441 leency 159
{
160
	ini_set_int stdcall (eolite_ini_path, #config_section, "ShowDeviceName", show_dev_name);
6049 leency 161
	ini_set_int stdcall (eolite_ini_path, #config_section, "ShowStatusBar", show_status_bar);
6505 punk_joker 162
	ini_set_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case);
6049 leency 163
	ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
164
	ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", kfont.size.pt);
6806 leency 165
	ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
6049 leency 166
	ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h);
167
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
168
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top);
169
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width);
170
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinH", Form.height);
171
}
5441 leency 172
5428 leency 173
 
5441 leency 174
 
175
 
5428 leency 176
{
177
	char error_message[500];
178
	dword ii;
179
	if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y);
5825 leency 180
	pause(5);
5428 leency 181
	sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
5576 pavelyakov 182
	notify(#error_message);
5620 leency 183
}
5428 leency 184
185
 
186
 
187
{
188
	system.color.get();
6191 leency 189
	//system.color.work = 0xE4DFE1;
190
	//system.color.work_text = 0;
191
	//system.color.work_graph  = 0x7E87A3; //A0A0B8;
192
	//system.color.work_button = 0x7E87A3;
193
	//system.color.work_button_text = 0x000000
194
	col_work    = 0xE4DFE1;
195
	col_padding = 0xC8C9C9;
5428 leency 196
	col_selec   = 0x94AECE;
5767 leency 197
	col_lpanel  = 0x00699C;
5428 leency 198
	col_graph   = 0x7E87A3;
6191 leency 199
}
5463 leency 200
201
 
202
 
5687 leency 203
{
204
	files.item_h = kfont.size.pt + 4;
6806 leency 205
	if (files.item_h<18) files.item_h = 18;
5825 leency 206
	files_active.item_h = files_inactive.item_h = files.item_h;
207
}
5687 leency 208