Subversion Repositories Kolibri OS

Rev

Rev 5767 | Rev 5825 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5767 Rev 5776
1
#ifdef LANG_RUS
1
#ifdef LANG_RUS
2
	?define EDIT_FILE_ASSOCIATIONS "¥¤ ªâ¨à®¢ âì  áá®æ¨ æ¨¨ ä ©«®¢"
2
	?define EDIT_FILE_ASSOCIATIONS "¥¤ ªâ¨à®¢ âì  áá®æ¨ æ¨¨ ä ©«®¢"
3
	?define TITLE_SETT " áâனª¨"
3
	?define TITLE_SETT " áâனª¨"
4
	?define SHOW_DEVICE_CLASS "‚뢮¤¨âì ­ §¢ ­¨ï ª« áá  ãáâனáâ¢"
4
	?define SHOW_DEVICE_CLASS "‚뢮¤¨âì ­ §¢ ­¨ï ª« áá  ãáâனáâ¢"
5
	?define SHOW_REAL_NAMES "®ª §ë¢ âì ¨¬¥­  ä ©«®¢ ­¥ ¬¥­ïï ॣ¨áâà"
5
	?define SHOW_REAL_NAMES "®ª §ë¢ âì ¨¬¥­  ä ©«®¢ ­¥ ¬¥­ïï ॣ¨áâà"
6
	?define FONT_SIZE_LABEL " §¬¥à èà¨äâ "
6
	?define FONT_SIZE_LABEL " §¬¥à èà¨äâ "
7
	?define USE_TWO_PANELS "„¢¥ ¯ ­¥«¨"
7
	?define USE_TWO_PANELS "„¢¥ ¯ ­¥«¨"
8
	?define LIST_LINE_HEIGHT "‚ëá®â  áâப¨ ¢ ᯨ᪥"
8
	?define LIST_LINE_HEIGHT "‚ëá®â  áâப¨ ¢ ᯨ᪥"
9
	?define NOTIFY_COPY_END "“¢¥¤®¬«ïâì ® § ¢¥à襭¨¨ ª®¯¨à®¢ ­¨ï"
9
	?define NOTIFY_COPY_END "“¢¥¤®¬«ïâì ® § ¢¥à襭¨¨ ª®¯¨à®¢ ­¨ï"
10
	?define T_DOUBLE_CLICK "‚à¥¬ï ¤¢®©­®£® ª«¨ª  (¢ á®âëå)"
10
	?define T_DOUBLE_CLICK "‚à¥¬ï ¤¢®©­®£® ª«¨ª  (¢ á®âëå)"
11
#else
11
#else
12
	?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
12
	?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
13
	?define TITLE_SETT "Settings"
13
	?define TITLE_SETT "Settings"
14
	?define SHOW_DEVICE_CLASS "Show device class name"
14
	?define SHOW_DEVICE_CLASS "Show device class name"
15
	?define SHOW_REAL_NAMES "Show real file names without changing case"
15
	?define SHOW_REAL_NAMES "Show real file names without changing case"
16
	?define FONT_SIZE_LABEL "Font size"
16
	?define FONT_SIZE_LABEL "Font size"
17
	?define USE_TWO_PANELS "Two panels"
17
	?define USE_TWO_PANELS "Two panels"
18
	?define LIST_LINE_HEIGHT "List line height"
18
	?define LIST_LINE_HEIGHT "List line height"
19
	?define NOTIFY_COPY_END "Notify when copying finished"
19
	?define NOTIFY_COPY_END "Notify when copying finished"
20
	?define T_DOUBLE_CLICK "Double click time (in hundredths)"
20
	?define T_DOUBLE_CLICK "Double click time (in hundredths)"
21
#endif
21
#endif
22
 
22
 
23
char config_section[] = "Config";
23
char config_section[] = "Config";
24
int WinX, WinY, WinW, WinH;
24
int WinX, WinY, WinW, WinH;
25
 
25
 
26
void settings_dialog()
26
void settings_dialog()
27
{   
27
{   
28
	byte id;
28
	byte id;
29
	active_settings=1;
29
	active_settings=1;
30
	loop(){
30
	loop(){
31
		switch(WaitEvent())
31
		switch(WaitEvent())
32
		{
32
		{
33
			case evButton: 
33
			case evButton: 
34
				id=GetButtonID();
34
				id=GetButtonID();
35
				if (id==1) { ExitSettings(); break; }
35
				if (id==1) { ExitSettings(); break; }
36
				else if (id==5)
36
				else if (id==5)
37
				{
37
				{
38
					RunProgram("tinypad", "/sys/settings/assoc.ini");
38
					RunProgram("tinypad", "/sys/settings/assoc.ini");
39
					break;
39
					break;
40
				}
40
				}
41
				else if (id==20) show_dev_name ^= 1;
41
				else if (id==20) show_dev_name ^= 1;
42
				else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
42
				else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
43
				else if (id==22) info_after_copy ^= 1;
43
				else if (id==22) info_after_copy ^= 1;
44
				else if (id==24) two_panels ^= 1;
44
				else if (id==24) two_panels ^= 1;
45
				else if (id==25) files.line_h++;
45
				else if (id==25) { files.line_h++; files_active.line_h = files_inactive.line_h = files.line_h; }
46
				else if (id==26) && (files.line_h>18) files.line_h--;
46
				else if (id==26) && (files.line_h>18) files.line_h--;
47
				else if (id==27) MOUSE_TIME++;
47
				else if (id==27) MOUSE_TIME++;
48
				else if (id==28) && (MOUSE_TIME>29) MOUSE_TIME--;
48
				else if (id==28) && (MOUSE_TIME>29) MOUSE_TIME--;
49
				else if (id==30) { font.size.text++; IF(!font.changeSIZE()) font.size.text--; BigFontsChange(); }
49
				else if (id==30) { font.size.text++; IF(!font.changeSIZE()) font.size.text--; BigFontsChange(); }
50
				else if (id==31) { font.size.text--; IF(!font.changeSIZE()) font.size.text++; BigFontsChange(); }
50
				else if (id==31) { font.size.text--; IF(!font.changeSIZE()) font.size.text++; BigFontsChange(); }
51
				EventRedrawWindow(Form.left,Form.top);
51
				EventRedrawWindow(Form.left,Form.top);
52
				DrawSettingsCheckBoxes();
52
				DrawSettingsCheckBoxes();
53
			break;
53
			break;
54
					
54
					
55
			case evKey:
55
			case evKey:
56
				GetKeys();
56
				GetKeys();
57
				if (key_scancode==SCAN_CODE_ESC) ExitSettings();
57
				if (key_scancode==SCAN_CODE_ESC) ExitSettings();
58
				break;
58
				break;
59
				
59
				
60
			case evReDraw:
60
			case evReDraw:
61
				DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 300, 226+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
61
				DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 300, 226+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
62
				DrawSettingsCheckBoxes();
62
				DrawSettingsCheckBoxes();
63
				DrawFlatButton(9, 186, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
63
				DrawFlatButton(9, 186, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
64
		}
64
		}
65
	}
65
	}
66
}
66
}
67
 
67
 
68
void ExitSettings()
68
void ExitSettings()
69
{
69
{
70
	active_settings = 0;
70
	active_settings = 0;
71
	settings_window = 0;
71
	settings_window = 0;
72
	cmd_free = 4;
72
	cmd_free = 4;
73
	ExitProcess();
73
	ExitProcess();
74
}
74
}
75
 
75
 
76
void DrawSettingsCheckBoxes()
76
void DrawSettingsCheckBoxes()
77
{
77
{
78
	CheckBox2(10, 11, 20, SHOW_DEVICE_CLASS,  show_dev_name);
78
	CheckBox2(10, 11, 20, SHOW_DEVICE_CLASS,  show_dev_name);
79
	CheckBox2(10, 33, 21, SHOW_REAL_NAMES,  real_files_names_case);
79
	CheckBox2(10, 33, 21, SHOW_REAL_NAMES,  real_files_names_case);
80
	CheckBox2(10, 55, 22, NOTIFY_COPY_END,  info_after_copy);
80
	CheckBox2(10, 55, 22, NOTIFY_COPY_END,  info_after_copy);
81
	CheckBox2(10, 77, 24, USE_TWO_PANELS,  two_panels); 
81
	CheckBox2(10, 77, 24, USE_TWO_PANELS,  two_panels); 
82
	MoreLessBox(10, 103, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
82
	MoreLessBox(10, 103, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
83
	MoreLessBox(10, 130, 18, 25, 26, #system.color, files.line_h, LIST_LINE_HEIGHT);
83
	MoreLessBox(10, 130, 18, 25, 26, #system.color, files.line_h, LIST_LINE_HEIGHT);
84
	if (font.data) MoreLessBox(10, 157, 18, 30, 31, #system.color, font.size.text, FONT_SIZE_LABEL);
84
	if (font.data) MoreLessBox(10, 157, 18, 30, 31, #system.color, font.size.text, FONT_SIZE_LABEL);
85
}
85
}
86
 
86
 
87
 
87
 
88
void LoadIniSettings()
88
void LoadIniSettings()
89
{
89
{
90
	files.SetFont(6, 9, 10000000b);
90
	files.SetFont(6, 9, 10000000b);
91
	FileShow.font_size_x = files.font_w;
91
	FileShow.font_size_x = files.font_w;
92
	FileShow.font_number = 0;
92
	FileShow.font_number = 0;
93
	ini_get_int stdcall   (eolite_ini_path, #config_section, "ShowDeviceName",    1); show_dev_name = EAX;
93
	ini_get_int stdcall   (eolite_ini_path, #config_section, "ShowDeviceName",    1); show_dev_name = EAX;
94
	ini_get_int stdcall   (eolite_ini_path, #config_section, "RealFileNamesCase", 0); real_files_names_case = EAX;
94
	ini_get_int stdcall   (eolite_ini_path, #config_section, "RealFileNamesCase", 0); real_files_names_case = EAX;
95
	ini_get_int stdcall   (eolite_ini_path, #config_section, "InfoAfterCopy",     0); info_after_copy = EAX;
95
	ini_get_int stdcall   (eolite_ini_path, #config_section, "InfoAfterCopy",     0); info_after_copy = EAX;
96
	ini_get_int stdcall   (eolite_ini_path, #config_section, "FontSize",          9); font.size.text = EAX;
96
	ini_get_int stdcall   (eolite_ini_path, #config_section, "FontSize",          9); font.size.text = EAX;
97
	ini_get_int stdcall   (eolite_ini_path, #config_section, "TwoPanels",         0); two_panels = EAX;
97
	ini_get_int stdcall   (eolite_ini_path, #config_section, "TwoPanels",         0); two_panels = EAX;
98
	ini_get_int stdcall   (eolite_ini_path, #config_section, "LineHeight",       18); files.line_h = EAX;
98
	ini_get_int stdcall   (eolite_ini_path, #config_section, "LineHeight",       18); files.line_h = EAX;
99
	ini_get_int stdcall   (eolite_ini_path, #config_section, "TimeDoubleClick",  50); MOUSE_TIME = EAX;
99
	ini_get_int stdcall   (eolite_ini_path, #config_section, "TimeDoubleClick",  50); MOUSE_TIME = EAX;
100
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX;
100
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX;
101
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX;
101
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX;
102
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX;
102
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX;
103
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinH", 500); WinH = EAX;
103
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinH", 500); WinH = EAX;
104
}
104
}
105
 
105
 
106
 
106
 
107
void SaveIniSettings()
107
void SaveIniSettings()
108
{
108
{
109
	ini_set_int stdcall (eolite_ini_path, #config_section, "ShowDeviceName", show_dev_name);
109
	ini_set_int stdcall (eolite_ini_path, #config_section, "ShowDeviceName", show_dev_name);
110
	ini_set_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case);
110
	ini_set_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case);
111
	ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
111
	ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
112
	ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", font.size.text);
112
	ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", font.size.text);
113
	ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
113
	ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
114
	ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.line_h);
114
	ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.line_h);
115
	ini_set_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
115
	ini_set_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
116
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
116
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
117
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top);
117
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top);
118
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width);
118
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width);
119
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinH", Form.height);
119
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinH", Form.height);
120
}
120
}
121
 
121
 
122
 
122
 
123
 
123
 
124
void Write_Error(int error_number)
124
void Write_Error(int error_number)
125
{
125
{
126
	char error_message[500];
126
	char error_message[500];
127
	dword ii;
127
	dword ii;
128
	if (files.current>=0) Line_ReDraw(0xFF0000, files.current);
128
	if (files.current>=0) Line_ReDraw(0xFF0000, files.current);
129
	pause(5);
129
	pause(5);
130
	sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
130
	sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
131
	notify(#error_message);	
131
	notify(#error_message);	
132
}
132
}
133
 
133
 
134
 
134
 
135
void SetAppColors()
135
void SetAppColors()
136
{
136
{
137
	system.color.work = 0xE4DFE1;
137
	system.color.work = 0xE4DFE1;
138
	system.color.work_text = 0;
138
	system.color.work_text = 0;
139
	system.color.work_graph  = 0x9098B0; //A0A0B8; //0x819FC5;
139
	system.color.work_graph  = 0x9098B0; //A0A0B8; //0x819FC5;
140
	system.color.work_button = 0xD2D3D3;
140
	system.color.work_button = 0xD2D3D3;
141
	system.color.work_button_text = 0x000000;
141
	system.color.work_button_text = 0x000000;
142
	col_padding = 0xC8C9C9;
142
	col_padding = 0xC8C9C9;
143
	col_selec   = 0x94AECE;
143
	col_selec   = 0x94AECE;
144
	col_lpanel  = 0x00699C;
144
	col_lpanel  = 0x00699C;
145
}
145
}
146
 
146
 
147
 
147
 
148
void BigFontsChange()
148
void BigFontsChange()
149
{
149
{
150
	files.line_h = font.size.text + 4;
150
	files.line_h = font.size.text + 4;
151
	if (files.line_h<18) files.line_h = 18;
151
	if (files.line_h<18) files.line_h = 18;
152
	files_active.line_h = files_inactive.line_h = files.line_h;
152
	files_active.line_h = files_inactive.line_h = files.line_h;
153
}
153
}
154
 
154
 
155
 
155
 
156
void CheckBox2(dword x, y, id, text, byte value) {
156
void CheckBox2(dword x, y, id, text, byte value) {
157
	CheckBox(x, y, 14, 14, id, text, system.color.work_graph, system.color.work_text, value);
157
	CheckBox(x, y, 14, 14, id, text, system.color.work_graph, system.color.work_text, value);
158
}
158
}