Subversion Repositories Kolibri OS

Rev

Rev 6197 | Rev 6289 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6197 Rev 6278
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 smooth_FONT "ˆá¯®«ì§®¢ âì ᣫ ¦¥­­ë© èà¨äâ"
8
	?define smooth_FONT "ˆá¯®«ì§®¢ âì ᣫ ¦¥­­ë© èà¨äâ"
9
	?define LIST_LINE_HEIGHT "‚ëá®â  áâப¨ ¢ ᯨ᪥"
9
	?define LIST_LINE_HEIGHT "‚ëá®â  áâப¨ ¢ ᯨ᪥"
10
	?define NOTIFY_COPY_END "“¢¥¤®¬«ïâì ® § ¢¥à襭¨¨ ª®¯¨à®¢ ­¨ï"
10
	?define NOTIFY_COPY_END "“¢¥¤®¬«ïâì ® § ¢¥à襭¨¨ ª®¯¨à®¢ ­¨ï"
11
	?define SAVE_PATH_AS_DEFAULT "‘¤¥« âì ⥪ã騩 ¯ãâì ¤®¬ è­¨¬ ª â «®£®¬"
11
	?define SAVE_PATH_AS_DEFAULT "‘¤¥« âì ⥪ã騩 ¯ãâì ¤®¬ è­¨¬ ª â «®£®¬"
12
#else
12
#else
13
	?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
13
	?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
14
	?define TITLE_SETT "Settings"
14
	?define TITLE_SETT "Settings"
15
	?define SHOW_DEVICE_CLASS "Show device class name"
15
	?define SHOW_DEVICE_CLASS "Show device class name"
16
	?define SHOW_REAL_NAMES "Show real file names without changing case"
16
	?define SHOW_REAL_NAMES "Show file names in original case"
17
	?define FONT_SIZE_LABEL "Font size"
17
	?define FONT_SIZE_LABEL "Font size"
18
	?define USE_TWO_PANELS "Two panels"
18
	?define USE_TWO_PANELS "Two panels"
19
	?define smooth_FONT "Use smooth font"
19
	?define smooth_FONT "Use smooth font"
20
	?define LIST_LINE_HEIGHT "List line height"
20
	?define LIST_LINE_HEIGHT "List line height"
21
	?define NOTIFY_COPY_END "Notify when copying finished"
21
	?define NOTIFY_COPY_END "Notify when copying finished"
22
	?define SAVE_PATH_AS_DEFAULT "Save current path as home folder"
22
	?define SAVE_PATH_AS_DEFAULT "Save current path as home folder"
23
#endif
23
#endif
24
 
24
 
25
char config_section[] = "Config";
25
char config_section[] = "Config";
26
int WinX, WinY, WinW, WinH;
26
int WinX, WinY, WinW, WinH;
27
 
27
 
28
void settings_dialog()
28
void settings_dialog()
29
{   
29
{   
30
	byte id;
30
	byte id;
31
	active_settings=1;
31
	active_settings=1;
32
	loop(){
32
	loop(){
33
		switch(WaitEvent())
33
		switch(WaitEvent())
34
		{
34
		{
35
			case evButton: 
35
			case evButton: 
36
				id=GetButtonID();
36
				id=GetButtonID();
37
				if (id==1) { ExitSettings(); break; }
37
				if (id==1) { ExitSettings(); break; }
38
				else if (id==5)
38
				else if (id==5)
39
				{
39
				{
40
					RunProgram("tinypad", "/sys/settings/assoc.ini");
40
					RunProgram("tinypad", "/sys/settings/assoc.ini");
41
					break;
41
					break;
42
				}
42
				}
43
				else if (id==6)
43
				else if (id==6)
44
				{
44
				{
45
					ini_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,strlen(#path));
45
					ini_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,strlen(#path));
46
					break;
46
					break;
47
				}
47
				}
48
				else if (id==20) show_dev_name ^= 1;
48
				else if (id==20) show_dev_name ^= 1;
49
				else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
49
				else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
50
				else if (id==22) info_after_copy ^= 1;
50
				else if (id==22) info_after_copy ^= 1;
51
				else if (id==24) two_panels ^= true;
51
				else if (id==24) two_panels ^= true;
52
				else if (id==25) { files.item_h++; files_active.item_h = files_inactive.item_h = files.item_h; }
52
				else if (id==25) { files.item_h++; files_active.item_h = files_inactive.item_h = files.item_h; }
53
				else if (id==26) && (files.item_h>18) files.item_h--;
53
				else if (id==26) && (files.item_h>18) files.item_h--;
54
				else if (id==30) { label.size.pt++; IF(!label.changeSIZE()) label.size.pt--; BigFontsChange(); }
54
				else if (id==30) { label.size.pt++; IF(!label.changeSIZE()) label.size.pt--; BigFontsChange(); }
55
				else if (id==31) { label.size.pt--; IF(!label.changeSIZE()) label.size.pt++; BigFontsChange(); }
55
				else if (id==31) { label.size.pt--; IF(!label.changeSIZE()) label.size.pt++; BigFontsChange(); }
56
				EventRedrawWindow(Form.left,Form.top);
56
				EventRedrawWindow(Form.left,Form.top);
57
				DrawSettingsCheckBoxes();
57
				DrawSettingsCheckBoxes();
58
			break;
58
			break;
59
					
59
					
60
			case evKey:
60
			case evKey:
61
				GetKeys();
61
				GetKeys();
62
				if (key_scancode==SCAN_CODE_ESC) ExitSettings();
62
				if (key_scancode==SCAN_CODE_ESC) ExitSettings();
63
				break;
63
				break;
64
				
64
				
65
			case evReDraw:
65
			case evReDraw:
66
				DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 370, 258+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
66
				DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 370, 258+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
67
				DrawSettingsCheckBoxes();
67
				DrawSettingsCheckBoxes();
68
				DrawFlatButton(9, 180, strlen(SAVE_PATH_AS_DEFAULT)+3*8, 24, 6, SAVE_PATH_AS_DEFAULT);
68
				DrawFlatButton(9, 180, strlen(SAVE_PATH_AS_DEFAULT)+3*8, 24, 6, SAVE_PATH_AS_DEFAULT);
69
				DrawFlatButton(9, 216, strlen(EDIT_FILE_ASSOCIATIONS)+3*8, 24, 5, EDIT_FILE_ASSOCIATIONS);
69
				DrawFlatButton(9, 216, strlen(EDIT_FILE_ASSOCIATIONS)+3*8, 24, 5, EDIT_FILE_ASSOCIATIONS);
70
		}
70
		}
71
	}
71
	}
72
}
72
}
73
 
73
 
74
void ExitSettings()
74
void ExitSettings()
75
{
75
{
76
	active_settings = 0;
76
	active_settings = 0;
77
	settings_window = 0;
77
	settings_window = 0;
78
	cmd_free = 4;
78
	cmd_free = 4;
79
	ExitProcess();
79
	ExitProcess();
80
}
80
}
81
 
81
 
82
void DrawSettingsCheckBoxes()
82
void DrawSettingsCheckBoxes()
83
{
83
{
84
	CheckBox(10, 13, 20, SHOW_DEVICE_CLASS,  show_dev_name);
84
	CheckBox(10, 13, 20, SHOW_DEVICE_CLASS,  show_dev_name);
85
	CheckBox(10, 37, 21, SHOW_REAL_NAMES,  real_files_names_case);
85
	CheckBox(10, 37, 21, SHOW_REAL_NAMES,  real_files_names_case);
86
	CheckBox(10, 61, 22, NOTIFY_COPY_END,  info_after_copy);
86
	CheckBox(10, 61, 22, NOTIFY_COPY_END,  info_after_copy);
87
	CheckBox(10, 85, 24, USE_TWO_PANELS,  two_panels);
87
	CheckBox(10, 85, 24, USE_TWO_PANELS,  two_panels);
88
	MoreLessBox(10, 115, 25, 26, files.item_h, LIST_LINE_HEIGHT);
88
	MoreLessBox(10, 115, 25, 26, files.item_h, LIST_LINE_HEIGHT);
89
	if (label.font) MoreLessBox(10, 144, 30, 31, label.size.pt, FONT_SIZE_LABEL);
89
	if (label.font) MoreLessBox(10, 144, 30, 31, label.size.pt, FONT_SIZE_LABEL);
90
}
90
}
91
 
91
 
92
 
92
 
93
void LoadIniSettings()
93
void LoadIniSettings()
94
{
94
{
95
	files.SetFont(6, 9, 10000000b);
95
	files.SetFont(6, 9, 10000000b);
96
	FileShow.font_size_x = files.font_w;
96
	FileShow.font_size_x = files.font_w;
97
	FileShow.font_number = 0;
97
	FileShow.font_number = 0;
98
	ini_get_int stdcall   (eolite_ini_path, #config_section, "ShowDeviceName",    1); show_dev_name = EAX;
98
	ini_get_int stdcall   (eolite_ini_path, #config_section, "ShowDeviceName",    1); show_dev_name = EAX;
99
	ini_get_int stdcall   (eolite_ini_path, #config_section, "RealFileNamesCase", 0); real_files_names_case = EAX;
99
	ini_get_int stdcall   (eolite_ini_path, #config_section, "RealFileNamesCase", 0); real_files_names_case = EAX;
100
	ini_get_int stdcall   (eolite_ini_path, #config_section, "InfoAfterCopy",     0); info_after_copy = EAX;
100
	ini_get_int stdcall   (eolite_ini_path, #config_section, "InfoAfterCopy",     0); info_after_copy = EAX;
101
	ini_get_int stdcall   (eolite_ini_path, #config_section, "FontSize",         12); label.size.pt = EAX;
101
	ini_get_int stdcall   (eolite_ini_path, #config_section, "FontSize",         12); label.size.pt = EAX;
102
	ini_get_int stdcall   (eolite_ini_path, #config_section, "TwoPanels",         0); two_panels = EAX;
102
	ini_get_int stdcall   (eolite_ini_path, #config_section, "TwoPanels",         0); two_panels = EAX;
103
	ini_get_int stdcall   (eolite_ini_path, #config_section, "LineHeight",       19); files.item_h = EAX;
103
	ini_get_int stdcall   (eolite_ini_path, #config_section, "LineHeight",       19); files.item_h = EAX;
104
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX;
104
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX;
105
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX;
105
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX;
106
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX;
106
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX;
107
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinH", 506); WinH = EAX;
107
	ini_get_int stdcall   (eolite_ini_path, #config_section, "WinH", 506); WinH = EAX;
108
	ini_get_str stdcall   (eolite_ini_path, #config_section, "DefaultPath", #path,4096,"/rd/1/");
108
	ini_get_str stdcall   (eolite_ini_path, #config_section, "DefaultPath", #path,4096,"/rd/1/");
109
 
109
 
110
 
110
 
111
	ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#temp,4096,DEFAULT_FONT);
111
	ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#temp,4096,DEFAULT_FONT);
112
	label.init(#temp);
112
	label.init(#temp);
113
	ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
113
	ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
114
	if(!strcmp(#temp,"off")) label.smooth = false; else label.smooth = true;
114
	if(!strcmp(#temp,"off")) label.smooth = false; else label.smooth = true;
115
}
115
}
116
 
116
 
117
 
117
 
118
void SaveIniSettings()
118
void SaveIniSettings()
119
{
119
{
120
	ini_set_int stdcall (eolite_ini_path, #config_section, "ShowDeviceName", show_dev_name);
120
	ini_set_int stdcall (eolite_ini_path, #config_section, "ShowDeviceName", show_dev_name);
121
	ini_set_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case);
121
	ini_set_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case);
122
	ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
122
	ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
123
	ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", label.size.pt);
123
	ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", label.size.pt);
124
	ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
124
	ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
125
	ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h);
125
	ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h);
126
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
126
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
127
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top);
127
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top);
128
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width);
128
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width);
129
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinH", Form.height);
129
	ini_set_int stdcall (eolite_ini_path, #config_section, "WinH", Form.height);
130
}
130
}
131
 
131
 
132
 
132
 
133
 
133
 
134
void Write_Error(int error_number)
134
void Write_Error(int error_number)
135
{
135
{
136
	char error_message[500];
136
	char error_message[500];
137
	dword ii;
137
	dword ii;
138
	if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y);
138
	if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y);
139
	pause(5);
139
	pause(5);
140
	sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
140
	sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
141
	notify(#error_message);	
141
	notify(#error_message);	
142
}
142
}
143
 
143
 
144
 
144
 
145
void SetAppColors()
145
void SetAppColors()
146
{
146
{
147
	system.color.get();
147
	system.color.get();
148
	//system.color.work = 0xE4DFE1;
148
	//system.color.work = 0xE4DFE1;
149
	//system.color.work_text = 0;
149
	//system.color.work_text = 0;
150
	//system.color.work_graph  = 0x7E87A3; //A0A0B8;
150
	//system.color.work_graph  = 0x7E87A3; //A0A0B8;
151
	//system.color.work_button = 0x7E87A3;
151
	//system.color.work_button = 0x7E87A3;
152
	//system.color.work_button_text = 0x000000
152
	//system.color.work_button_text = 0x000000
153
	col_work    = 0xE4DFE1;
153
	col_work    = 0xE4DFE1;
154
	col_padding = 0xC8C9C9;
154
	col_padding = 0xC8C9C9;
155
	col_selec   = 0x94AECE;
155
	col_selec   = 0x94AECE;
156
	col_lpanel  = 0x00699C;
156
	col_lpanel  = 0x00699C;
157
	col_graph   = 0x7E87A3;
157
	col_graph   = 0x7E87A3;
158
}
158
}
159
 
159
 
160
 
160
 
161
void BigFontsChange()
161
void BigFontsChange()
162
{
162
{
163
	files.item_h = label.size.pt + 4;
163
	files.item_h = label.size.pt + 4;
164
	if (files.item_h<18) files.item_h = 18;
164
	if (files.item_h<18) files.item_h = 18;
165
	files_active.item_h = files_inactive.item_h = files.item_h;
165
	files_active.item_h = files_inactive.item_h = files.item_h;
166
}
166
}