Eolite 3.57: the ability to manually enter the path to open when the Eolite starts

git-svn-id: svn://kolibrios.org@6403 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Serhii Sakhno 2016-04-19 18:42:13 +00:00
parent e4f7770378
commit fb3c3f01e9
4 changed files with 126 additions and 56 deletions

View File

@ -55,6 +55,7 @@ word settings_window;
byte active_settings=0;
dword _not_draw = false;
byte menu_call_mouse=0;
byte exif_load=0;
byte del_active=0;
byte new_element_active=0;

View File

@ -16,6 +16,8 @@
?define PR_T_SYSTEM "‘¨á⥬­ë©"
?define PR_T_ONLY_READ "’®«ìª® ç⥭¨¥"
?define SET_BYTE_LANG "¡ ©â"
?define TAB_T_BASIC "Ž¡é¨¥"
?define TAB_T_DETAILS "<EFBFBD>®¤à®¡­¥¥"
#else // Apply to all subfolders
?define WINDOW_TITLE_PROPERTIES "Properties"
?define BTN_CLOSE "Close"
@ -34,15 +36,24 @@
?define PR_T_SYSTEM "System"
?define PR_T_ONLY_READ "Read-only"
?define SET_BYTE_LANG "byte"
?define TAB_T_BASIC "Basic"
?define TAB_T_DETAILS "Details"
#endif
dword mouse_ddd2;
char path_to_file[4096]="\0";
char file_name2[4096]="\0";
edit_box file_name_ed = {230,50,27,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,4098,#file_name2,#mouse_ddd2, 1000000000000000b,2,2};
edit_box path_to_file_ed = {160,120,49,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,4098,#path_to_file,#mouse_ddd2, 1000000000000000b,2,2};
frame flags_frame = { 0, NULL, 10, 92, 182, 0x000111, 0xFFFfff, 1, FLAGS, 0, 1, 12, 0x000111, 0xFFFFFF };
edit_box file_name_ed = {230,50,57,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,4098,#file_name2,#mouse_ddd2, 1000000000000000b,2,2};
edit_box path_to_file_ed = {160,120,79,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,4098,#path_to_file,#mouse_ddd2, 1000000000000000b,2,2};
frame flags_frame = { 0, NULL, 10, 92, 212, 0x000111, 0xFFFfff, 1, FLAGS, 0, 1, 12, 0x000111, 0xFFFFFF };
//NewElement options
enum {
TAB_BASIC,
TAB_DETAILS,
};
byte active_tab;
int file_count, dir_count, size_dir;
char folder_info[200];
dword element_size;
@ -270,10 +281,31 @@ void properties_dialog()
}
break;
}
if (id==20) atr_readonly ^= 1;
if (id==21) atr_hidden ^= 1;
if (id==22) atr_system ^= 1;
DrawPropertiesCheckBoxes();
if (id==12)
{
active_tab = TAB_BASIC;
DrawPropertiesWindow();
}
if (id==13)
{
active_tab = TAB_DETAILS;
DrawPropertiesWindow();
}
if (id==20)
{
atr_readonly ^= 1;
DrawPropertiesCheckBoxes();
}
if (id==21)
{
atr_hidden ^= 1;
DrawPropertiesCheckBoxes();
}
if (id==22)
{
atr_system ^= 1;
DrawPropertiesCheckBoxes();
}
break;
case evMouse:
@ -320,56 +352,65 @@ void properties_dialog()
void DrawPropertiesWindow()
{
DefineAndDrawWindow(Form.left + 150,150,305,330+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES);
DefineAndDrawWindow(Form.left + 150,150,305,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES);
GetProcessInfo(#settings_form, SelfInfo);
DrawFlatButton(10, 5, 80, 24, 12, TAB_T_BASIC);
if (exif_load==1) DrawFlatButton(92, 5, 80, 24, 13, TAB_T_DETAILS);
DrawFlatButton(settings_form.cwidth - 93, settings_form.cheight-34, 80, 24, 10, BTN_CLOSE);
DrawFlatButton(settings_form.cwidth -183, settings_form.cheight-34, 80, 24, 11, BTN_APPLY);
WriteText(10, 48, 0x90, 0x000000, PR_T_DEST);
edit_box_draw stdcall (#path_to_file_ed);
WriteText(10, 67, 0x90, 0x000000, PR_T_SIZE);
if (selected_count)
if (active_tab == TAB_BASIC)
{
DrawIconByExtension(NULL, 18, 19, system.color.work);
sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count);
WriteText(50, 19, 0x90, 0x000000, #folder_info);
sprintf(#element_size_label,"%s (%d %s)",ConvertSize(size_dir),size_dir,SET_BYTE_LANG);
WriteText(120, 67, 0x90, 0x000000, #element_size_label);
WriteText(10, 78, 0x90, 0x000000, PR_T_DEST);
edit_box_draw stdcall (#path_to_file_ed);
WriteText(10, 97, 0x90, 0x000000, PR_T_SIZE);
if (selected_count)
{
DrawIconByExtension(NULL, 18, 19, system.color.work);
sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count);
WriteText(50, 49, 0x90, 0x000000, #folder_info);
sprintf(#element_size_label,"%s (%d %s)",ConvertSize(size_dir),size_dir,SET_BYTE_LANG);
WriteText(120, 97, 0x90, 0x000000, #element_size_label);
}
else
{
if ( file_info_general.isfolder )
DrawIconByExtension("<DIR>", 18, 49, system.color.work);
else
DrawIconByExtension(#file_name2+strrchr(#file_name2,'.'), 18, 49, system.color.work);
WriteText(50, 40, 0x90, 0x000000, PR_T_NAME);
edit_box_draw stdcall (#file_name_ed);
if (!itdir) element_size = file_info_general.sizelo;
else
{
WriteText(10,116, 0x90, 0x000000, PR_T_CONTAINS);
sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count);
WriteText(120, 116, 0x90, 0x000000, #folder_info);
element_size = size_dir;
}
WriteTextLines(10, 136, 0x90, 0x000000, CREATED_OPENED_MODIFIED, 20);
DrawDate(120, 136, 0, #file_info_general.datecreate);
DrawDate(120, 156, 0, #file_info_general.datelastaccess);
DrawDate(120, 176, 0, #file_info_general.datelastedit);
sprintf(#element_size_label,"%s (%d %s)",ConvertSize(element_size),element_size,SET_BYTE_LANG);
WriteText(120, 99, 0x90, 0x000000, #element_size_label);
}
flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2;
flags_frame.font_color = system.color.work_text;
flags_frame.ext_col = system.color.work_graph;
flags_frame.font_backgr_color = system.color.work;
frame_draw stdcall (#flags_frame);
DrawPropertiesCheckBoxes();
}
else
{
if ( file_info_general.isfolder )
DrawIconByExtension("<DIR>", 18, 19, system.color.work);
else
DrawIconByExtension(#file_name2+strrchr(#file_name2,'.'), 18, 19, system.color.work);
WriteText(50, 10, 0x90, 0x000000, PR_T_NAME);
edit_box_draw stdcall (#file_name_ed);
if (!itdir) element_size = file_info_general.sizelo;
else
{
WriteText(10, 86, 0x90, 0x000000, PR_T_CONTAINS);
sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count);
WriteText(120, 86, 0x90, 0x000000, #folder_info);
element_size = size_dir;
}
WriteTextLines(10, 106, 0x90, 0x000000, CREATED_OPENED_MODIFIED, 20);
DrawDate(120, 106, 0, #file_info_general.datecreate);
DrawDate(120, 126, 0, #file_info_general.datelastaccess);
DrawDate(120, 146, 0, #file_info_general.datelastedit);
sprintf(#element_size_label,"%s (%d %s)",ConvertSize(element_size),element_size,SET_BYTE_LANG);
WriteText(120, 69, 0x90, 0x000000, #element_size_label);
WriteText(10, 78, 0x90, 0x000000, "EXIF");
}
flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2;
flags_frame.font_color = system.color.work_text;
flags_frame.ext_col = system.color.work_graph;
flags_frame.font_backgr_color = system.color.work;
frame_draw stdcall (#flags_frame);
DrawPropertiesCheckBoxes();
}
void DrawPropertiesCheckBoxes()

View File

@ -8,7 +8,8 @@
?define USE_TWO_PANELS "„¢¥ ¯ ­¥«¨"
?define FONT_SIZE_LABEL "<EFBFBD> §¬¥à èà¨äâ "
?define LIST_LINE_HEIGHT "‚ëá®â  áâப¨ ¢ ᯨ᪥"
?define SAVE_PATH_AS_DEFAULT "‘¤¥« âì ⥪ã騩 ¯ãâì ¤®¬ è­¨¬ ª â «®£®¬"
?define SAVE_PATH_AS_DEFAULT "’¥ªã騩 ¯ãâì"
?define SAVE_START_PATH_AS_DEFAULT "‚¢¥¤¥­­ë© ¯ãâì"
?define EDIT_FILE_ASSOCIATIONS "<EFBFBD>¥¤ ªâ¨à®¢ âì  áá®æ¨ æ¨¨ ä ©«®¢"
#else
?define TITLE_SETT "Settings"
@ -19,20 +20,30 @@
?define USE_TWO_PANELS "Two panels"
?define FONT_SIZE_LABEL "Font size"
?define LIST_LINE_HEIGHT "List line height"
?define SAVE_PATH_AS_DEFAULT "Save current path as home folder"
?define SAVE_PATH_AS_DEFAULT "urrent path"
?define SAVE_START_PATH_AS_DEFAULT "Typed path"
?define EDIT_FILE_ASSOCIATIONS "Edit file associations"
#endif
char config_section[] = "Config";
int WinX, WinY, WinW, WinH;
dword set_mouse_dd;
char path_start[4096]="\0";
edit_box path_start_ed = {230,50,57,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#path_start,#set_mouse_dd, 100000000000010b,0,0};
void settings_dialog()
{
byte id;
active_settings=1;
SetEventMask(0x27);
loop(){
switch(WaitEvent())
{
case evMouse:
edit_box_mouse stdcall (#path_start_ed);
break;
case evButton:
id=GetButtonID();
if (id==1) { ExitSettings(); break; }
@ -43,7 +54,16 @@ void settings_dialog()
}
else if (id==6)
{
strcpy(#path_start,#path);
path_start_ed.size = strlen(#path_start);
path_start_ed.pos = strlen(#path_start);
ini_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,strlen(#path));
edit_box_draw stdcall (#path_start_ed);
break;
}
else if (id==7)
{
ini_set_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path_start,strlen(#path_start));
break;
}
else if (id==20) show_dev_name ^= 1;
@ -56,15 +76,17 @@ void settings_dialog()
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(); }
EventRedrawWindow(Form.left,Form.top);
break;
break;
case evKey:
GetKeys();
if (key_scancode==SCAN_CODE_ESC) ExitSettings();
EAX= key_ascii << 8;
edit_box_key stdcall (#path_start_ed);
break;
case evReDraw:
DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 376, 292+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 376, 312+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
DrawSettingsCheckBoxes();
}
}
@ -90,7 +112,11 @@ void DrawSettingsCheckBoxes()
CheckBox(x, y.inc(25), 24, USE_TWO_PANELS, two_panels);
MoreLessBox(x, y.inc(31), 30, 31, label.size.pt, FONT_SIZE_LABEL);
MoreLessBox(x, y.inc(31), 25, 26, files.item_h, LIST_LINE_HEIGHT);
DrawFlatButton(x-1, y.inc(36), strlen(SAVE_PATH_AS_DEFAULT)+3*8, 24, 6, SAVE_PATH_AS_DEFAULT);
path_start_ed.top = y.inc(31);
path_start_ed.left = x;
edit_box_draw stdcall (#path_start_ed);
DrawFlatButton(x-1, y.inc(26), strlen(SAVE_PATH_AS_DEFAULT)+3*8, 24, 6, SAVE_PATH_AS_DEFAULT);
DrawFlatButton(x-1+strlen(SAVE_PATH_AS_DEFAULT)+3*8, y.inc(0), strlen(SAVE_START_PATH_AS_DEFAULT)+3*8, 24, 7, SAVE_START_PATH_AS_DEFAULT);
DrawFlatButton(x-1, y.inc(36), strlen(EDIT_FILE_ASSOCIATIONS)+3*8, 24, 5, EDIT_FILE_ASSOCIATIONS);
}
@ -111,7 +137,9 @@ void LoadIniSettings()
ini_get_int stdcall (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "WinH", 506); WinH = EAX;
ini_get_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path,4096,"/rd/1/");
ini_get_str stdcall (eolite_ini_path, #config_section, "DefaultPath", #path_start,4096,"/rd/1/");
path_start_ed.size = strlen(#path_start);
path_start_ed.pos = strlen(#path_start);
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font file",#temp,4096,DEFAULT_FONT);
label.init(#temp);

View File

@ -1,5 +1,5 @@
#define TITLE "Eolite File Manager v3.56"
#define ABOUT_TITLE "EOLITE 3.56"
#define TITLE "Eolite File Manager v3.57"
#define ABOUT_TITLE "EOLITE 3.57"
#ifdef LANG_RUS
?define T_FILE "” ©«"