2015-02-17 17:46:38 +01:00
|
|
|
|
|
|
|
|
|
#ifdef LANG_RUS
|
2015-02-20 16:25:51 +01:00
|
|
|
|
?define EDIT_FILE_ASSOCIATIONS "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>樠樨 䠩<><E4A0A9><EFBFBD>"
|
2015-02-17 17:46:38 +01:00
|
|
|
|
?define TITLE_SETT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ன<EFBFBD><EFBFBD>"
|
2015-03-18 12:59:32 +01: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 17:02:42 +02:00
|
|
|
|
?define FONT_SIZE_LABEL "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2015-08-13 17:28:53 +02:00
|
|
|
|
?define USE_TWO_PANELS "<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2015-12-17 20:15:49 +01:00
|
|
|
|
?define smooth_FONT "<EFBFBD>ᯮ<EFBFBD>짮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᣫ<><E1A3AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>"
|
2015-03-18 12:59:32 +01: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-12-21 20:04:39 +01:00
|
|
|
|
?define SAVE_PATH_AS_DEFAULT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<>騩 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>譨<EFBFBD> <20><>⠫<EFBFBD><E2A0AB><EFBFBD><EFBFBD>"
|
2015-02-17 17:46:38 +01:00
|
|
|
|
#else
|
2015-02-20 16:25:51 +01:00
|
|
|
|
?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
|
2015-02-19 08:42:42 +01:00
|
|
|
|
?define TITLE_SETT "Settings"
|
2015-03-18 12:59:32 +01:00
|
|
|
|
?define SHOW_DEVICE_CLASS "Show device class name"
|
|
|
|
|
?define SHOW_REAL_NAMES "Show real file names without changing case"
|
2015-08-18 17:02:42 +02:00
|
|
|
|
?define FONT_SIZE_LABEL "Font size"
|
2015-08-13 17:28:53 +02:00
|
|
|
|
?define USE_TWO_PANELS "Two panels"
|
2015-12-17 20:15:49 +01:00
|
|
|
|
?define smooth_FONT "Use smooth font"
|
2015-03-18 12:59:32 +01:00
|
|
|
|
?define LIST_LINE_HEIGHT "List line height"
|
|
|
|
|
?define NOTIFY_COPY_END "Notify when copying finished"
|
2015-12-21 20:04:39 +01:00
|
|
|
|
?define SAVE_PATH_AS_DEFAULT "Save current path as home folder"
|
2015-02-17 17:46:38 +01:00
|
|
|
|
#endif
|
|
|
|
|
|
2015-08-19 15:17:24 +02:00
|
|
|
|
char config_section[] = "Config";
|
|
|
|
|
int WinX, WinY, WinW, WinH;
|
2015-02-17 17:46:38 +01:00
|
|
|
|
|
|
|
|
|
void settings_dialog()
|
|
|
|
|
{
|
|
|
|
|
byte id;
|
2015-08-22 15:27:12 +02:00
|
|
|
|
active_settings=1;
|
2015-07-16 03:44:30 +02:00
|
|
|
|
loop(){
|
2015-07-21 03:10:37 +02:00
|
|
|
|
switch(WaitEvent())
|
|
|
|
|
{
|
|
|
|
|
case evButton:
|
2015-02-17 17:46:38 +01:00
|
|
|
|
id=GetButtonID();
|
2015-08-22 15:27:12 +02:00
|
|
|
|
if (id==1) { ExitSettings(); break; }
|
2015-07-21 03:10:37 +02:00
|
|
|
|
else if (id==5)
|
2015-02-20 16:25:51 +01:00
|
|
|
|
{
|
|
|
|
|
RunProgram("tinypad", "/sys/settings/assoc.ini");
|
2015-02-24 18:47:47 +01:00
|
|
|
|
break;
|
2015-02-20 16:25:51 +01:00
|
|
|
|
}
|
2015-09-29 22:05:29 +02:00
|
|
|
|
else if (id==6)
|
|
|
|
|
{
|
|
|
|
|
ini_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,strlen(#path));
|
|
|
|
|
break;
|
|
|
|
|
}
|
2015-07-21 03:10:37 +02:00
|
|
|
|
else if (id==20) show_dev_name ^= 1;
|
2015-08-18 17:02:42 +02:00
|
|
|
|
else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
|
2015-07-21 03:10:37 +02:00
|
|
|
|
else if (id==22) info_after_copy ^= 1;
|
2015-10-12 13:42:35 +02:00
|
|
|
|
else if (id==24) two_panels ^= true;
|
2015-09-09 16:24:42 +02: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-12-18 22:10:45 +01:00
|
|
|
|
else if (id==30) { label.size.pt++; IF(!label.changeSIZE()) label.size.pt--; BigFontsChange(); }
|
|
|
|
|
else if (id==31) { label.size.pt--; IF(!label.changeSIZE()) label.size.pt++; BigFontsChange(); }
|
2015-07-23 13:54:26 +02:00
|
|
|
|
EventRedrawWindow(Form.left,Form.top);
|
2015-02-24 18:47:47 +01:00
|
|
|
|
DrawSettingsCheckBoxes();
|
2015-07-21 03:10:37 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evKey:
|
2015-08-10 12:55:14 +02:00
|
|
|
|
GetKeys();
|
2015-08-18 17:02:42 +02:00
|
|
|
|
if (key_scancode==SCAN_CODE_ESC) ExitSettings();
|
2015-02-17 17:46:38 +01:00
|
|
|
|
break;
|
2015-07-21 03:10:37 +02:00
|
|
|
|
|
|
|
|
|
case evReDraw:
|
2015-12-26 12:03:17 +01:00
|
|
|
|
DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 370, 243+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
|
2015-02-24 18:47:47 +01:00
|
|
|
|
DrawSettingsCheckBoxes();
|
2016-01-10 21:02:47 +01:00
|
|
|
|
DrawFlatButton(9, 166, strlen(SAVE_PATH_AS_DEFAULT)+3*8, 24, 6, SAVE_PATH_AS_DEFAULT);
|
|
|
|
|
DrawFlatButton(9, 200, strlen(EDIT_FILE_ASSOCIATIONS)+3*8, 24, 5, EDIT_FILE_ASSOCIATIONS);
|
2015-07-21 03:10:37 +02:00
|
|
|
|
}
|
2015-02-17 17:46:38 +01:00
|
|
|
|
}
|
2015-02-19 08:42:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
2015-08-18 17:02:42 +02:00
|
|
|
|
void ExitSettings()
|
|
|
|
|
{
|
2015-08-22 15:27:12 +02:00
|
|
|
|
active_settings = 0;
|
2015-08-18 17:02:42 +02:00
|
|
|
|
settings_window = 0;
|
|
|
|
|
cmd_free = 4;
|
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-24 18:47:47 +01:00
|
|
|
|
void DrawSettingsCheckBoxes()
|
|
|
|
|
{
|
2016-02-09 02:43:58 +01:00
|
|
|
|
CheckBox(10, 11, 20, SHOW_DEVICE_CLASS, show_dev_name);
|
|
|
|
|
CheckBox(10, 33, 21, SHOW_REAL_NAMES, real_files_names_case);
|
|
|
|
|
CheckBox(10, 55, 22, NOTIFY_COPY_END, info_after_copy);
|
|
|
|
|
CheckBox(10, 77, 24, USE_TWO_PANELS, two_panels);
|
|
|
|
|
MoreLessBox(10, 105, 25, 26, files.item_h, LIST_LINE_HEIGHT);
|
|
|
|
|
if (label.font) MoreLessBox(10, 132, 30, 31, label.size.pt, FONT_SIZE_LABEL);
|
2015-02-24 18:47:47 +01:00
|
|
|
|
}
|
|
|
|
|
|
2015-02-19 08:42:42 +01:00
|
|
|
|
|
2015-02-21 13:24:30 +01:00
|
|
|
|
void LoadIniSettings()
|
2015-02-19 08:42:42 +01:00
|
|
|
|
{
|
2015-08-23 15:06:45 +02:00
|
|
|
|
files.SetFont(6, 9, 10000000b);
|
|
|
|
|
FileShow.font_size_x = files.font_w;
|
|
|
|
|
FileShow.font_number = 0;
|
2015-08-19 15:17:24 +02: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;
|
2016-01-07 14:10:39 +01:00
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "FontSize", 12); label.size.pt = EAX;
|
2015-08-19 15:17:24 +02:00
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "TwoPanels", 0); two_panels = EAX;
|
2016-01-07 14:10:39 +01:00
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "LineHeight", 19); files.item_h = EAX;
|
2015-08-19 15:17:24 +02:00
|
|
|
|
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;
|
2016-01-07 14:10:39 +01:00
|
|
|
|
ini_get_int stdcall (eolite_ini_path, #config_section, "WinH", 506); WinH = EAX;
|
2015-12-16 17:13:34 +01:00
|
|
|
|
ini_get_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,4096,"/rd/1/");
|
|
|
|
|
|
2016-01-07 14:10:39 +01:00
|
|
|
|
|
2015-12-18 22:10:45 +01:00
|
|
|
|
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#temp,4096,DEFAULT_FONT);
|
|
|
|
|
label.init(#temp);
|
2015-12-16 17:13:34 +01:00
|
|
|
|
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");
|
2015-12-21 17:37:24 +01:00
|
|
|
|
if(!strcmp(#temp,"off")) label.smooth = false; else label.smooth = true;
|
2015-02-19 08:42:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
2015-08-06 18:13:03 +02:00
|
|
|
|
|
2015-02-21 13:24:30 +01:00
|
|
|
|
void SaveIniSettings()
|
|
|
|
|
{
|
2016-01-10 17:53:02 +01: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);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", label.size.pt);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h);
|
|
|
|
|
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 13:24:30 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-02-19 08:42:42 +01:00
|
|
|
|
|
|
|
|
|
void Write_Error(int error_number)
|
|
|
|
|
{
|
|
|
|
|
char error_message[500];
|
|
|
|
|
dword ii;
|
2015-09-09 16:24:42 +02:00
|
|
|
|
if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y);
|
2015-02-19 08:42:42 +01:00
|
|
|
|
pause(5);
|
2015-07-16 03:44:30 +02:00
|
|
|
|
sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
|
2015-07-29 14:14:49 +02:00
|
|
|
|
notify(#error_message);
|
2015-02-19 08:42:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SetAppColors()
|
|
|
|
|
{
|
2015-08-04 16:36:07 +02:00
|
|
|
|
system.color.work = 0xE4DFE1;
|
|
|
|
|
system.color.work_text = 0;
|
2016-02-09 02:43:58 +01:00
|
|
|
|
system.color.work_graph = 0x7E87A3; //A0A0B8;
|
|
|
|
|
system.color.work_button = 0x7E87A3;
|
2015-08-04 16:36:07 +02:00
|
|
|
|
system.color.work_button_text = 0x000000;
|
2015-02-19 08:42:42 +01:00
|
|
|
|
col_padding = 0xC8C9C9;
|
2015-08-23 15:06:45 +02:00
|
|
|
|
col_selec = 0x94AECE;
|
2015-02-19 08:42:42 +01:00
|
|
|
|
col_lpanel = 0x00699C;
|
2015-02-24 18:47:47 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-08-06 18:13:03 +02:00
|
|
|
|
void BigFontsChange()
|
|
|
|
|
{
|
2015-12-18 22:10:45 +01:00
|
|
|
|
files.item_h = label.size.pt + 4;
|
2015-09-09 16:24:42 +02:00
|
|
|
|
if (files.item_h<18) files.item_h = 18;
|
|
|
|
|
files_active.item_h = files_inactive.item_h = files.item_h;
|
2015-08-06 18:13:03 +02:00
|
|
|
|
}
|