From fb3c3f01e9a5d5eb11bc6dbd9105982ab9254c95 Mon Sep 17 00:00:00 2001 From: Serhii Sakhno Date: Tue, 19 Apr 2016 18:42:13 +0000 Subject: [PATCH] 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 --- programs/cmm/eolite/Eolite.c | 1 + programs/cmm/eolite/include/properties.h | 137 +++++++++++++-------- programs/cmm/eolite/include/settings.h | 40 +++++- programs/cmm/eolite/include/translations.h | 4 +- 4 files changed, 126 insertions(+), 56 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index e12a8e3c98..6b9f81b54c 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -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; diff --git a/programs/cmm/eolite/include/properties.h b/programs/cmm/eolite/include/properties.h index b84498d6a3..4bd4ef604f 100644 --- a/programs/cmm/eolite/include/properties.h +++ b/programs/cmm/eolite/include/properties.h @@ -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 "Подробнее" #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("", 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("", 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() diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index 79b1065d9b..c78a8b6b40 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -8,7 +8,8 @@ ?define USE_TWO_PANELS "Две панели" ?define FONT_SIZE_LABEL "Размер шрифта" ?define LIST_LINE_HEIGHT "Высота строки в списке" - ?define SAVE_PATH_AS_DEFAULT "Сделать текущий путь домашним каталогом" + ?define SAVE_PATH_AS_DEFAULT "Текущий путь" + ?define SAVE_START_PATH_AS_DEFAULT "Введенный путь" ?define EDIT_FILE_ASSOCIATIONS "Редактировать ассоциации файлов" #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); diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index e8e7c6ec50..6b70687409 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/translations.h @@ -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 "Файл"