2015-02-17 19:46:38 +03:00
|
|
|
|
|
|
|
|
|
#ifdef LANG_RUS
|
2015-02-20 18:25:51 +03:00
|
|
|
|
?define EDIT_FILE_ASSOCIATIONS "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>樠樨 䠩<><E4A0A9><EFBFBD>"
|
2015-02-17 19:46:38 +03:00
|
|
|
|
?define TITLE_SETT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ன<EFBFBD><EFBFBD>"
|
2015-03-18 14:59:32 +03:00
|
|
|
|
?define SHOW_DEVICE_CLASS "<EFBFBD>뢮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ன<EFBFBD><E0AEA9><EFBFBD>"
|
|
|
|
|
?define SHOW_REAL_NAMES "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> ॣ<><E0A5A3><EFBFBD><EFBFBD>"
|
2015-08-18 18:02:42 +03:00
|
|
|
|
?define FONT_SIZE_LABEL "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2015-08-13 18:28:53 +03:00
|
|
|
|
?define USE_TWO_PANELS "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2015-03-18 14:59:32 +03:00
|
|
|
|
?define LIST_LINE_HEIGHT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20> ᯨ᪥"
|
|
|
|
|
?define NOTIFY_COPY_END "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><E8A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD>"
|
2015-07-19 21:45:59 +03:00
|
|
|
|
?define T_DOUBLE_CLICK "<EFBFBD>६<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> (<28> <20><><EFBFBD><EFBFBD><EFBFBD>)"
|
2015-02-17 19:46:38 +03:00
|
|
|
|
#else
|
2015-02-20 18:25:51 +03:00
|
|
|
|
?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
|
2015-02-19 10:42:42 +03:00
|
|
|
|
?define TITLE_SETT "Settings"
|
2015-03-18 14:59:32 +03:00
|
|
|
|
?define SHOW_DEVICE_CLASS "Show device class name"
|
|
|
|
|
?define SHOW_REAL_NAMES "Show real file names without changing case"
|
2015-08-18 18:02:42 +03:00
|
|
|
|
?define FONT_SIZE_LABEL "Font size"
|
2015-08-13 18:28:53 +03:00
|
|
|
|
?define USE_TWO_PANELS "Two panels"
|
2015-03-18 14:59:32 +03:00
|
|
|
|
?define LIST_LINE_HEIGHT "List line height"
|
|
|
|
|
?define NOTIFY_COPY_END "Notify when copying finished"
|
2015-07-19 21:45:59 +03:00
|
|
|
|
?define T_DOUBLE_CLICK "Double click time (in hundredths)"
|
2015-02-17 19:46:38 +03:00
|
|
|
|
#endif
|
|
|
|
|
|
2015-08-19 16:17:24 +03:00
|
|
|
|
char config_section[] = "Config";
|
|
|
|
|
int WinX, WinY, WinW, WinH;
|
2015-02-17 19:46:38 +03:00
|
|
|
|
|
|
|
|
|
void settings_dialog()
|
|
|
|
|
{
|
|
|
|
|
byte id;
|
2015-08-22 16:27:12 +03:00
|
|
|
|
active_settings=1;
|
2015-07-16 04:44:30 +03:00
|
|
|
|
loop(){
|
2015-07-21 04:10:37 +03:00
|
|
|
|
switch(WaitEvent())
|
|
|
|
|
{
|
|
|
|
|
case evButton:
|
2015-02-17 19:46:38 +03:00
|
|
|
|
id=GetButtonID();
|
2015-08-22 16:27:12 +03:00
|
|
|
|
if (id==1) { ExitSettings(); break; }
|
2015-07-21 04:10:37 +03:00
|
|
|
|
else if (id==5)
|
2015-02-20 18:25:51 +03:00
|
|
|
|
{
|
|
|
|
|
RunProgram("tinypad", "/sys/settings/assoc.ini");
|
2015-02-24 20:47:47 +03:00
|
|
|
|
break;
|
2015-02-20 18:25:51 +03:00
|
|
|
|
}
|
2015-07-21 04:10:37 +03:00
|
|
|
|
else if (id==20) show_dev_name ^= 1;
|
2015-08-18 18:02:42 +03:00
|
|
|
|
else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
|
2015-07-21 04:10:37 +03:00
|
|
|
|
else if (id==22) info_after_copy ^= 1;
|
2015-08-13 18:28:53 +03:00
|
|
|
|
else if (id==24) two_panels ^= 1;
|
2015-09-09 17:24:42 +03:00
|
|
|
|
else if (id==25) { files.item_h++; files_active.item_h = files_inactive.item_h = files.item_h; }
|
|
|
|
|
else if (id==26) && (files.item_h>18) files.item_h--;
|
2015-07-21 04:10:37 +03:00
|
|
|
|
else if (id==27) MOUSE_TIME++;
|
|
|
|
|
else if (id==28) && (MOUSE_TIME>29) MOUSE_TIME--;
|
2015-08-22 16:27:12 +03:00
|
|
|
|
else if (id==30) { font.size.text++; IF(!font.changeSIZE()) font.size.text--; BigFontsChange(); }
|
|
|
|
|
else if (id==31) { font.size.text--; IF(!font.changeSIZE()) font.size.text++; BigFontsChange(); }
|
2015-07-23 14:54:26 +03:00
|
|
|
|
EventRedrawWindow(Form.left,Form.top);
|
2015-02-24 20:47:47 +03:00
|
|
|
|
DrawSettingsCheckBoxes();
|
2015-07-21 04:10:37 +03:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evKey:
|
2015-08-10 13:55:14 +03:00
|
|
|
|
GetKeys();
|
2015-08-18 18:02:42 +03:00
|
|
|
|
if (key_scancode==SCAN_CODE_ESC) ExitSettings();
|
2015-02-17 19:46:38 +03:00
|
|
|
|
break;
|
2015-07-21 04:10:37 +03:00
|
|
|
|
|
|
|
|
|
case evReDraw:
|
2015-08-18 18:02:42 +03:00
|
|
|
|
DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 300, 226+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
|
2015-02-24 20:47:47 +03:00
|
|
|
|
DrawSettingsCheckBoxes();
|
2015-08-13 18:28:53 +03:00
|
|
|
|
DrawFlatButton(9, 186, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
|
2015-07-21 04:10:37 +03:00
|
|
|
|
}
|
2015-02-17 19:46:38 +03:00
|
|
|
|
}
|
2015-02-19 10:42:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
2015-08-18 18:02:42 +03:00
|
|
|
|
void ExitSettings()
|
|
|
|
|
{
|
2015-08-22 16:27:12 +03:00
|
|
|
|
active_settings = 0;
|
2015-08-18 18:02:42 +03:00
|
|
|
|
settings_window = 0;
|
|
|
|
|
cmd_free = 4;
|
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-24 20:47:47 +03:00
|
|
|
|
void DrawSettingsCheckBoxes()
|
|
|
|
|
{
|
2015-03-18 14:59:32 +03:00
|
|
|
|
CheckBox2(10, 11, 20, SHOW_DEVICE_CLASS, show_dev_name);
|
|
|
|
|
CheckBox2(10, 33, 21, SHOW_REAL_NAMES, real_files_names_case);
|
|
|
|
|
CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy);
|
2015-08-18 18:02:42 +03:00
|
|
|
|
CheckBox2(10, 77, 24, USE_TWO_PANELS, two_panels);
|
2015-08-19 14:14:15 +03:00
|
|
|
|
MoreLessBox(10, 103, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
|
2015-09-09 17:24:42 +03:00
|
|
|
|
MoreLessBox(10, 130, 18, 25, 26, #system.color, files.item_h, LIST_LINE_HEIGHT);
|
2015-08-20 18:04:18 +03:00
|
|
|
|
if (font.data) MoreLessBox(10, 157, 18, 30, 31, #system.color, font.size.text, FONT_SIZE_LABEL);
|
2015-02-24 20:47:47 +03:00
|
|
|
|
}
|
|
|
|
|
|
2015-02-19 10:42:42 +03:00
|
|
|
|
|
2015-02-21 15:24:30 +03:00
|
|
|
|
void LoadIniSettings()
|
2015-02-19 10:42:42 +03:00
|
|
|
|
{
|
2015-08-23 16:06:45 +03:00
|
|
|
|
files.SetFont(6, 9, 10000000b);
|
|
|
|
|
FileShow.font_size_x = files.font_w;
|
|
|
|
|
FileShow.font_number = 0;
|
2015-08-19 16:17:24 +03:00
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "ShowDeviceName", 1); show_dev_name = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", 0); real_files_names_case = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", 0); info_after_copy = EAX;
|
2015-08-20 18:04:18 +03:00
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "FontSize", 9); font.size.text = EAX;
|
2015-08-19 16:17:24 +03:00
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "TwoPanels", 0); two_panels = EAX;
|
2015-09-09 17:24:42 +03:00
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "LineHeight", 18); files.item_h = EAX;
|
2015-08-19 16:17:24 +03:00
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", 50); MOUSE_TIME = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "WinH", 500); WinH = EAX;
|
2015-02-19 10:42:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
2015-08-06 19:13:03 +03:00
|
|
|
|
|
2015-02-21 15:24:30 +03:00
|
|
|
|
void SaveIniSettings()
|
|
|
|
|
{
|
2015-08-19 16:17:24 +03:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "ShowDeviceName", show_dev_name);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
|
2015-08-20 18:04:18 +03:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", font.size.text);
|
2015-08-19 16:17:24 +03:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
|
2015-09-09 17:24:42 +03:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h);
|
2015-08-19 16:17:24 +03:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "WinH", Form.height);
|
2015-02-21 15:24:30 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-02-19 10:42:42 +03:00
|
|
|
|
|
|
|
|
|
void Write_Error(int error_number)
|
|
|
|
|
{
|
|
|
|
|
char error_message[500];
|
|
|
|
|
dword ii;
|
2015-09-09 17:24:42 +03:00
|
|
|
|
if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y);
|
2015-02-19 10:42:42 +03:00
|
|
|
|
pause(5);
|
2015-07-16 04:44:30 +03:00
|
|
|
|
sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
|
2015-07-29 15:14:49 +03:00
|
|
|
|
notify(#error_message);
|
2015-02-19 10:42:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SetAppColors()
|
|
|
|
|
{
|
2015-08-04 17:36:07 +03:00
|
|
|
|
system.color.work = 0xE4DFE1;
|
|
|
|
|
system.color.work_text = 0;
|
|
|
|
|
system.color.work_graph = 0x9098B0; //A0A0B8; //0x819FC5;
|
|
|
|
|
system.color.work_button = 0xD2D3D3;
|
|
|
|
|
system.color.work_button_text = 0x000000;
|
2015-02-19 10:42:42 +03:00
|
|
|
|
col_padding = 0xC8C9C9;
|
2015-08-23 16:06:45 +03:00
|
|
|
|
col_selec = 0x94AECE;
|
2015-02-19 10:42:42 +03:00
|
|
|
|
col_lpanel = 0x00699C;
|
2015-02-24 20:47:47 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-08-06 19:13:03 +03:00
|
|
|
|
void BigFontsChange()
|
|
|
|
|
{
|
2015-09-09 17:24:42 +03:00
|
|
|
|
files.item_h = font.size.text + 4;
|
|
|
|
|
if (files.item_h<18) files.item_h = 18;
|
|
|
|
|
files_active.item_h = files_inactive.item_h = files.item_h;
|
2015-08-06 19:13:03 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-02-24 20:47:47 +03:00
|
|
|
|
void CheckBox2(dword x, y, id, text, byte value) {
|
2015-08-04 17:36:07 +03:00
|
|
|
|
CheckBox(x, y, 14, 14, id, text, system.color.work_graph, system.color.work_text, value);
|
2015-02-17 19:46:38 +03:00
|
|
|
|
}
|