2015-02-19 08:42:42 +01:00
|
|
|
|
//Leency 2008-2015
|
2015-02-17 17:46:38 +01:00
|
|
|
|
|
|
|
|
|
#define EDITOR_PATH "/sys/tinypad"
|
|
|
|
|
|
|
|
|
|
#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-02-19 08:42:42 +01:00
|
|
|
|
?define SET_1 "<EFBFBD>뢮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ன<EFBFBD><E0AEA9><EFBFBD>"
|
|
|
|
|
?define SET_2 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> ॣ<><E0A5A3><EFBFBD><EFBFBD>"
|
|
|
|
|
?define SET_3 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20> ᯨ᪥"
|
2015-02-24 13:48:22 +01:00
|
|
|
|
?define SET_4 "<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-02-17 18:01:43 +01:00
|
|
|
|
?define CANCEL_T "<EFBFBD>⬥<EFBFBD><EFBFBD>"
|
|
|
|
|
?define APPLY_T "<EFBFBD>ਬ<EFBFBD><EFBFBD><EFBFBD><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"
|
|
|
|
|
?define SET_1 "Show device class name"
|
|
|
|
|
?define SET_2 "Show real file names without changing case"
|
|
|
|
|
?define SET_3 "List line height"
|
2015-02-24 13:48:22 +01:00
|
|
|
|
?define SET_4 "To notify the completion of the copy"
|
2015-02-19 08:42:42 +01:00
|
|
|
|
?define CANCEL_T "Cancel"
|
|
|
|
|
?define APPLY_T "Apply"
|
2015-02-17 17:46:38 +01:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
int mouse_ddd;
|
|
|
|
|
char lineh_s[30]="18\0";
|
2015-02-24 13:48:22 +01:00
|
|
|
|
edit_box LineHeight_ed = {52,10,90,0xffffff,0x94AECE,0xffc90E,0xffffff,2,4,#lineh_s,#mouse_ddd, 1000000000000000b,2,2};
|
2015-02-20 17:25:57 +01:00
|
|
|
|
checkbox2 ShowDeviceName_chb = {10*65536+15, 10*65536+15, 5, 0xffffff, 0x9098B0, 0x80000000, SET_1, CH_FLAG_MIDDLE, 0};
|
|
|
|
|
checkbox2 RealFileNamesCase_chb = {10*65536+15, 30*65536+15, 5, 0xffffff, 0x9098B0, 0x80000000, SET_2, CH_FLAG_MIDDLE, 0};
|
2015-02-24 13:48:22 +01:00
|
|
|
|
checkbox2 InfoAfterCopy_chb = {10*65536+15, 50*65536+15, 5, 0xffffff, 0x9098B0, 0x80000000, SET_4, CH_FLAG_MIDDLE, 0};
|
2015-02-17 17:46:38 +01:00
|
|
|
|
|
|
|
|
|
void settings_dialog()
|
|
|
|
|
{
|
|
|
|
|
byte id;
|
|
|
|
|
unsigned int key;
|
2015-02-20 16:25:51 +01:00
|
|
|
|
proc_info settings_form;
|
2015-02-24 13:48:22 +01:00
|
|
|
|
|
|
|
|
|
if (active_settings) ExitProcess();
|
|
|
|
|
active_settings=1;
|
2015-02-20 17:25:57 +01:00
|
|
|
|
|
|
|
|
|
ShowDeviceName_chb.size_of_str = strlen(SET_1) * 6;
|
|
|
|
|
RealFileNamesCase_chb.size_of_str = strlen(SET_2) * 6;
|
2015-02-24 13:48:22 +01:00
|
|
|
|
InfoAfterCopy_chb.size_of_str = strlen(SET_4) * 6;
|
2015-02-20 17:25:57 +01:00
|
|
|
|
|
2015-02-17 17:46:38 +01:00
|
|
|
|
SetEventMask(0x27);
|
|
|
|
|
loop() switch(WaitEvent())
|
|
|
|
|
{
|
|
|
|
|
case evButton:
|
|
|
|
|
id=GetButtonID();
|
|
|
|
|
if (id==10)
|
|
|
|
|
{
|
2015-02-21 13:24:30 +01:00
|
|
|
|
SaveIniSettings();
|
2015-02-24 13:48:22 +01:00
|
|
|
|
active_settings=0;
|
2015-02-19 08:42:42 +01:00
|
|
|
|
action_buf = 300;
|
2015-02-17 17:46:38 +01:00
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
2015-02-19 08:42:42 +01:00
|
|
|
|
if (id==1) || (id==11)
|
2015-02-17 17:46:38 +01:00
|
|
|
|
{
|
2015-02-24 13:48:22 +01:00
|
|
|
|
active_settings=0;
|
2015-02-17 17:46:38 +01:00
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
2015-02-20 16:25:51 +01:00
|
|
|
|
if (id==5)
|
|
|
|
|
{
|
|
|
|
|
RunProgram("tinypad", "/sys/settings/assoc.ini");
|
|
|
|
|
}
|
2015-02-17 17:46:38 +01:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evKey:
|
|
|
|
|
key = GetKey();
|
2015-02-19 08:42:42 +01:00
|
|
|
|
if (key==27)
|
2015-02-17 17:46:38 +01:00
|
|
|
|
{
|
2015-02-24 13:48:22 +01:00
|
|
|
|
active_settings=0;
|
2015-02-19 08:42:42 +01:00
|
|
|
|
action_buf = 300;
|
2015-02-17 17:46:38 +01:00
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
|
|
|
|
EAX=key<<8;
|
|
|
|
|
edit_box_key stdcall(#LineHeight_ed);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evMouse:
|
|
|
|
|
check_box_mouse stdcall (#ShowDeviceName_chb);
|
|
|
|
|
check_box_mouse stdcall (#RealFileNamesCase_chb);
|
2015-02-24 13:48:22 +01:00
|
|
|
|
check_box_mouse stdcall (#InfoAfterCopy_chb);
|
2015-02-17 17:46:38 +01:00
|
|
|
|
edit_box_mouse stdcall (#LineHeight_ed);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evReDraw:
|
2015-02-19 08:42:42 +01:00
|
|
|
|
DefineAndDrawWindow(Form.left + 100, 150, 300, 200+GetSkinHeight(),0x34,sc.work,TITLE_SETT);
|
2015-02-20 16:25:51 +01:00
|
|
|
|
GetProcessInfo(#settings_form, SelfInfo);
|
2015-02-21 22:32:15 +01:00
|
|
|
|
|
|
|
|
|
ShowDeviceName_chb.flags |= 1 << show_dev_name;
|
|
|
|
|
RealFileNamesCase_chb.flags |= 1 << real_files_names_case;
|
2015-02-24 13:48:22 +01:00
|
|
|
|
InfoAfterCopy_chb.flags |= 1 << info_after_copy;
|
2015-02-21 22:32:15 +01:00
|
|
|
|
|
2015-02-17 17:46:38 +01:00
|
|
|
|
key = itoa(files.line_h);
|
|
|
|
|
strcpy(#lineh_s, key);
|
|
|
|
|
|
|
|
|
|
check_box_draw stdcall (#ShowDeviceName_chb);
|
|
|
|
|
check_box_draw stdcall (#RealFileNamesCase_chb);
|
2015-02-24 13:48:22 +01:00
|
|
|
|
check_box_draw stdcall (#InfoAfterCopy_chb);
|
2015-02-17 17:46:38 +01:00
|
|
|
|
edit_box_draw stdcall (#LineHeight_ed);
|
2015-02-20 16:25:51 +01:00
|
|
|
|
DrawRectangle(LineHeight_ed.left-1, LineHeight_ed.top-1, LineHeight_ed.width+2, 16, sc.work_graph);
|
2015-02-24 13:48:22 +01:00
|
|
|
|
WriteText(10, 77, 0x80, 0x000000, SET_3);
|
|
|
|
|
DrawFlatButton(9, 120, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
|
2015-02-20 16:25:51 +01:00
|
|
|
|
DrawFlatButton(128, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, APPLY_T);
|
|
|
|
|
DrawFlatButton(208, settings_form.cheight - 34, 70, 22, 11, 0xE4DFE1, CANCEL_T);
|
2015-02-17 17:46:38 +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
|
|
|
|
{
|
|
|
|
|
ini_get_color stdcall (eolite_ini_path, "Config", "SelectionColor", 0x94AECE);
|
|
|
|
|
edit2.shift_color = EAX;
|
|
|
|
|
col_selec = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, "Config", "LineHeight", 18);
|
|
|
|
|
files.line_h = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", 1);
|
|
|
|
|
show_dev_name = EAX;
|
|
|
|
|
ini_get_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", 0);
|
|
|
|
|
real_files_names_case = EAX;
|
2015-02-24 13:48:22 +01:00
|
|
|
|
ini_get_int stdcall (eolite_ini_path, "Config", "InfoAfterCopy", 0);
|
|
|
|
|
info_after_copy = EAX;
|
2015-02-19 08:42:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
2015-02-21 13:24:30 +01:00
|
|
|
|
void SaveIniSettings()
|
|
|
|
|
{
|
2015-02-21 22:32:15 +01:00
|
|
|
|
show_dev_name = TestBit(ShowDeviceName_chb.flags, 1);
|
|
|
|
|
real_files_names_case = TestBit(RealFileNamesCase_chb.flags, 1);
|
2015-02-24 13:48:22 +01:00
|
|
|
|
info_after_copy = TestBit(InfoAfterCopy_chb.flags, 1);
|
2015-02-21 13:24:30 +01:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, "Config", "ShowDeviceName", show_dev_name);
|
|
|
|
|
ini_set_int stdcall (eolite_ini_path, "Config", "RealFileNamesCase", real_files_names_case);
|
2015-02-24 13:48:22 +01:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, "Config", "InfoAfterCopy", info_after_copy);
|
2015-02-21 13:24:30 +01:00
|
|
|
|
ini_set_int stdcall (eolite_ini_path, "Config", "LineHeight", atoi(#lineh_s));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-02-19 08:42:42 +01:00
|
|
|
|
|
|
|
|
|
void Write_Error(int error_number)
|
|
|
|
|
{
|
|
|
|
|
char error_message[500];
|
|
|
|
|
dword ii;
|
|
|
|
|
if (files.current>=0) Line_ReDraw(0xFF0000, files.current);
|
|
|
|
|
pause(5);
|
|
|
|
|
strcpy(#error_message, "\"Eolite\n");
|
|
|
|
|
ii = get_error(error_number);
|
|
|
|
|
strcat(#error_message, ii);
|
|
|
|
|
strcat(#error_message, "\" -tE");
|
|
|
|
|
notify(#error_message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SetAppColors()
|
|
|
|
|
{
|
|
|
|
|
sc.work = 0xE4DFE1;
|
|
|
|
|
sc.work_text = 0;
|
|
|
|
|
sc.work_graph = 0x9098B0; //A0A0B8; //0x819FC5;
|
|
|
|
|
sc.work_button_text = 0x000000;
|
|
|
|
|
col_padding = 0xC8C9C9;
|
|
|
|
|
//col_selec = 0x94AECE;
|
|
|
|
|
col_lpanel = 0x00699C;
|
2015-02-17 17:46:38 +01:00
|
|
|
|
}
|