Subversion Repositories Kolibri OS

Rev

Rev 5834 | Rev 5877 | 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;
5846 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, 280+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
5846 pavelyakov 73
				DrawSettingsCheckBoxes();
5463 leency 74
				DrawFlatButton(9, 208, strlen(SAVE_PATH_AS_DEFAULT)+4*6, 22, 6, 0xE4DFE1, SAVE_PATH_AS_DEFAULT);
5846 pavelyakov 75
				DrawFlatButton(9, 240, 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);
5846 pavelyakov 95
	MoreLessBox(10, 125, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
96
	MoreLessBox(10, 152, 18, 25, 26, #system.color, files.item_h, LIST_LINE_HEIGHT);
97
	if (font.data) MoreLessBox(10, 179, 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;
5846 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/");
5833 pavelyakov 119
}
5428 leency 120
121
 
5687 leency 122
 
5441 leency 123
{
124
5834 pavelyakov 125
 
5748 leency 126
	ini_set_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case);
127
	ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
128
	ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", font.size.text);
5753 leency 129
	ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
5748 leency 130
	ini_set_int stdcall (eolite_ini_path, #config_section, "UseSmoothFont", smooth_font);
5846 pavelyakov 131
	ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h);
5825 leency 132
	ini_set_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
5748 leency 133
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
134
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top);
135
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width);
136
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinH", Form.height);
137
5834 pavelyakov 138
 
139
	{
140
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "ShowDeviceName", show_dev_name);
141
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case);
142
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
143
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "FontSize", font.size.text);
144
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "TwoPanels", two_panels);
145
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "UseSmoothFont", smooth_font);
5846 pavelyakov 146
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "LineHeight", files.item_h);
5834 pavelyakov 147
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
148
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinX", Form.left);
149
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinY", Form.top);
150
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinW", Form.width);
151
		ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinH", Form.height);
152
	}
153
}
5441 leency 154
5428 leency 155
 
5441 leency 156
 
157
 
5428 leency 158
{
159
	char error_message[500];
160
	dword ii;
161
	if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y);
5825 leency 162
	pause(5);
5428 leency 163
	sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
5576 pavelyakov 164
	notify(#error_message);
5620 leency 165
}
5428 leency 166
167
 
168
 
169
{
170
	system.color.work = 0xE4DFE1;
5674 pavelyakov 171
	system.color.work_text = 0;
172
	system.color.work_graph  = 0x9098B0; //A0A0B8; //0x819FC5;
173
	system.color.work_button = 0xD2D3D3;
174
	system.color.work_button_text = 0x000000;
175
	col_padding = 0xC8C9C9;
5428 leency 176
	col_selec   = 0x94AECE;
5767 leency 177
	col_lpanel  = 0x00699C;
5428 leency 178
}
5463 leency 179
180
 
181
 
5687 leency 182
{
183
	files.item_h = font.size.text + 4;
5825 leency 184
	if (files.item_h<18) files.item_h = 18;
185
	files_active.item_h = files_inactive.item_h = files.item_h;
186
}
5687 leency 187
188
 
189
 
5463 leency 190
	CheckBox(x, y, 14, 14, id, text, system.color.work_graph, system.color.work_text, value);
5674 pavelyakov 191
}
5416 punk_joker 192