Subversion Repositories Kolibri OS

Rev

Rev 5877 | Rev 5981 | 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 EDIT_FILE_ASSOCIATIONS "Редактировать ассоциации файлов"
5435 leency 3
	?define TITLE_SETT "Настройки"
5416 punk_joker 4
	?define SHOW_DEVICE_CLASS "Выводить названия класса устройств"
5526 leency 5
	?define SHOW_REAL_NAMES "Показывать имена файлов не меняя регистр"
6
	?define FONT_SIZE_LABEL "Размер шрифта"
5743 leency 7
	?define USE_TWO_PANELS "Две панели"
5719 leency 8
	?define USE_SMOOTH_FONT "Использовать сглаженный шрифт"
5846 pavelyakov 9
	?define LIST_LINE_HEIGHT "Высота строки в списке"
5526 leency 10
	?define NOTIFY_COPY_END "Уведомлять о завершении копирования"
11
	?define T_DOUBLE_CLICK "Время двойного клика (в сотых)"
5581 leency 12
	#define SAVE_PATH_AS_DEFAULT "Сохранить текущий путь по умолчанию"
5833 pavelyakov 13
#else
5416 punk_joker 14
	?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
5435 leency 15
	?define TITLE_SETT "Settings"
5428 leency 16
	?define SHOW_DEVICE_CLASS "Show device class name"
5526 leency 17
	?define SHOW_REAL_NAMES "Show real file names without changing case"
18
	?define FONT_SIZE_LABEL "Font size"
5743 leency 19
	?define USE_TWO_PANELS "Two panels"
5719 leency 20
	?define USE_SMOOTH_FONT "Use smooth font"
5846 pavelyakov 21
	?define LIST_LINE_HEIGHT "List line height"
5526 leency 22
	?define NOTIFY_COPY_END "Notify when copying finished"
23
	?define T_DOUBLE_CLICK "Double click time (in hundredths)"
5581 leency 24
	#define SAVE_PATH_AS_DEFAULT "Save the current default path"
5833 pavelyakov 25
#endif
5416 punk_joker 26
27
 
5748 leency 28
int WinX, WinY, WinW, WinH;
29
5416 punk_joker 30
 
31
{
32
	byte id;
33
	active_settings=1;
5761 leency 34
	loop(){
5576 pavelyakov 35
		switch(WaitEvent())
5591 pavelyakov 36
		{
37
			case evButton:
38
				id=GetButtonID();
5416 punk_joker 39
				if (id==1) { ExitSettings(); break; }
5761 leency 40
				else if (id==5)
5591 pavelyakov 41
				{
5435 leency 42
					RunProgram("tinypad", "/sys/settings/assoc.ini");
43
					break;
5463 leency 44
				}
5435 leency 45
				else if (id==6)
5833 pavelyakov 46
				{
47
					ini_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,strlen(#path));
48
					IF(CMD_ENABLE_SAVE_IMG)ini_set_str stdcall (fd_path_eolite_ini_path, #config_section, "DefaultPath", #path,strlen(#path));
5834 pavelyakov 49
					break;
5833 pavelyakov 50
				}
51
				else if (id==20) show_dev_name ^= 1;
5591 pavelyakov 52
				else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
5743 leency 53
				else if (id==22) info_after_copy ^= 1;
5591 pavelyakov 54
				else if (id==24) two_panels ^= true;
5846 pavelyakov 55
				else if (id==25) { files.item_h++; files_active.item_h = files_inactive.item_h = files.item_h; }
5825 leency 56
				else if (id==26) && (files.item_h>18) files.item_h--;
57
				else if (id==27) MOUSE_TIME++;
5591 pavelyakov 58
				else if (id==28) && (MOUSE_TIME>29) MOUSE_TIME--;
59
				//else if (id==29) smooth_font ^= true;
5877 pavelyakov 60
				else if (id==30) { font.size.text++; IF(!font.changeSIZE()) font.size.text--; BigFontsChange(); }
5761 leency 61
				else if (id==31) { font.size.text--; IF(!font.changeSIZE()) font.size.text++; BigFontsChange(); }
62
				EventRedrawWindow(Form.left,Form.top);
5606 pavelyakov 63
				DrawSettingsCheckBoxes();
5463 leency 64
			break;
5591 pavelyakov 65
66
 
67
				GetKeys();
5707 leency 68
				if (key_scancode==SCAN_CODE_ESC) ExitSettings();
5743 leency 69
				break;
5416 punk_joker 70
5591 pavelyakov 71
 
72
				DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 300, 260+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
5877 pavelyakov 73
				DrawSettingsCheckBoxes();
5463 leency 74
				DrawFlatButton(9, 183, strlen(SAVE_PATH_AS_DEFAULT)+4*6, 22, 6, 0xE4DFE1, SAVE_PATH_AS_DEFAULT);
5877 pavelyakov 75
				DrawFlatButton(9, 215, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
76
		}
5591 pavelyakov 77
	}
5416 punk_joker 78
}
5428 leency 79
80
 
5743 leency 81
{
82
	active_settings = 0;
5761 leency 83
	settings_window = 0;
5743 leency 84
	cmd_free = 4;
85
	ExitProcess();
86
}
87
88
 
5463 leency 89
{
90
	CheckBox2(10, 11, 20, SHOW_DEVICE_CLASS,  show_dev_name);
5526 leency 91
	CheckBox2(10, 33, 21, SHOW_REAL_NAMES,  real_files_names_case);
92
	CheckBox2(10, 55, 22, NOTIFY_COPY_END,  info_after_copy);
93
	CheckBox2(10, 77, 24, USE_TWO_PANELS,  two_panels);
5743 leency 94
	//CheckBox2(10, 99, 29, USE_SMOOTH_FONT,  smooth_font);
5877 pavelyakov 95
	MoreLessBox(10, 99, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
96
	MoreLessBox(10, 125, 18, 25, 26, #system.color, files.item_h, LIST_LINE_HEIGHT);
97
	if (font.data) MoreLessBox(10, 152, 18, 30, 31, #system.color, font.size.text, FONT_SIZE_LABEL);
98
}
5463 leency 99
5428 leency 100
 
5463 leency 101
 
5441 leency 102
{
5428 leency 103
	files.SetFont(6, 9, 10000000b);
5767 leency 104
	FileShow.font_size_x = files.font_w;
105
	FileShow.font_number = 0;
106
	ini_get_int stdcall   (eolite_ini_path, #config_section, "ShowDeviceName",    1); show_dev_name = EAX;
5748 leency 107
	ini_get_int stdcall   (eolite_ini_path, #config_section, "RealFileNamesCase", 0); real_files_names_case = EAX;
108
	ini_get_int stdcall   (eolite_ini_path, #config_section, "InfoAfterCopy",     0); info_after_copy = EAX;
109
	ini_get_int stdcall   (eolite_ini_path, #config_section, "FontSize",          9); font.size.text = EAX;
5753 leency 110
	ini_get_int stdcall   (eolite_ini_path, #config_section, "TwoPanels",         0); two_panels = EAX;
5748 leency 111
	//ini_get_int stdcall   (eolite_ini_path, #config_section, "UseSmoothFont",     true);smooth_font = EAX;
5877 pavelyakov 112
	ini_get_int stdcall   (eolite_ini_path, #config_section, "LineHeight",       18); files.item_h = EAX;
5825 leency 113
	ini_get_int stdcall   (eolite_ini_path, #config_section, "TimeDoubleClick",  50); MOUSE_TIME = EAX;
5748 leency 114
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX;
115
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX;
116
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX;
117
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinH", 500); WinH = EAX;
118
	ini_get_str stdcall   (eolite_ini_path, #config_section, "DefaultPath", #path,4096,"/rd/1/");
5974 leency 119
120
 
121
	ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#temp,4096,"/sys/FONTS/Tahoma.kf");
122
	font.load(#temp);
123
	ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
124
	if(!strcmp(#temp,"off"))smooth_font = false;
125
	else smooth_font = true;
126
}
5428 leency 127
128
 
5687 leency 129
 
5441 leency 130
{
131
5834 pavelyakov 132
 
5748 leency 133
	ini_set_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case);
134
	ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
135
	ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", font.size.text);
5753 leency 136
	ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
5748 leency 137
	//ini_set_int stdcall (eolite_ini_path, #config_section, "UseSmoothFont", smooth_font);
5877 pavelyakov 138
	ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h);
5825 leency 139
	ini_set_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
5748 leency 140
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
141
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top);
142
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width);
143
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinH", Form.height);
144
5834 pavelyakov 145
 
146
	{
147
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "ShowDeviceName", show_dev_name);
148
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case);
149
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
150
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "FontSize", font.size.text);
151
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "TwoPanels", two_panels);
152
		//ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "UseSmoothFont", smooth_font);
5877 pavelyakov 153
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "LineHeight", files.item_h);
5834 pavelyakov 154
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
155
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinX", Form.left);
156
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinY", Form.top);
157
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinW", Form.width);
158
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinH", Form.height);
159
	}
160
}
5441 leency 161
5428 leency 162
 
5441 leency 163
 
164
 
5428 leency 165
{
166
	char error_message[500];
167
	dword ii;
168
	if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y);
5825 leency 169
	pause(5);
5428 leency 170
	sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
5576 pavelyakov 171
	notify(#error_message);
5620 leency 172
}
5428 leency 173
174
 
175
 
176
{
177
	system.color.work = 0xE4DFE1;
5674 pavelyakov 178
	system.color.work_text = 0;
179
	system.color.work_graph  = 0x9098B0; //A0A0B8; //0x819FC5;
180
	system.color.work_button = 0xD2D3D3;
181
	system.color.work_button_text = 0x000000;
182
	col_padding = 0xC8C9C9;
5428 leency 183
	col_selec   = 0x94AECE;
5767 leency 184
	col_lpanel  = 0x00699C;
5428 leency 185
}
5463 leency 186
187
 
188
 
5687 leency 189
{
190
	files.item_h = font.size.text + 4;
5825 leency 191
	if (files.item_h<18) files.item_h = 18;
192
	files_active.item_h = files_inactive.item_h = files.item_h;
193
}
5687 leency 194
195
 
196
 
5463 leency 197
	CheckBox(x, y, 14, 14, id, text, system.color.work_graph, system.color.work_text, value);
5674 pavelyakov 198
}
5416 punk_joker 199