From e4d175d63513a7e1942f13072ab7ea01a8f7c5a7 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Fri, 31 Dec 2021 00:14:50 +0000 Subject: [PATCH] Eolite -> Properties dialog: do not show dates for devices and disks, make window shorter if dates are not shown git-svn-id: svn://kolibrios.org@9535 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 6 +-- programs/cmm/eolite/include/const.h | 14 ++---- programs/cmm/eolite/include/properties.h | 63 +++++++++++++----------- 3 files changed, 41 insertions(+), 42 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 899ddbafac..c786774b10 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -11,9 +11,9 @@ TODO: http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334 */ -#define ABOUT_TITLE "EOLITE 5.18" -#define TITLE_EOLITE "Eolite File Manager 5.18" -#define TITLE_KFM "Kolibri File Manager 2.18"; +#define ABOUT_TITLE "EOLITE 5.19" +#define TITLE_EOLITE "Eolite File Manager 5.19" +#define TITLE_KFM "Kolibri File Manager 2.19"; #define MEMSIZE 1024 * 250 #include "../lib/clipboard.h" diff --git a/programs/cmm/eolite/include/const.h b/programs/cmm/eolite/include/const.h index d338508741..203ff2c791 100644 --- a/programs/cmm/eolite/include/const.h +++ b/programs/cmm/eolite/include/const.h @@ -73,16 +73,14 @@ char *actions[] = { #define QUEST_2 "файлам и папкам?" #define PR_T_NAME "Имя:" #define PR_T_DEST "Расположение:" -#define PR_T_SIZE "Размер:" #define CREATED_OPENED_MODIFIED "Создан:\nОткрыт:\nИзменен:" -#define SET_6 "Файлов: " -#define SET_7 " Папок: " +#define T_FILES_FOLDERS "Файлов: %i Папок: %i" #define PR_T_CONTAINS "Содержит: " #define FLAGS " Аттрибуты " #define PR_T_HIDDEN "Скрытый" #define PR_T_SYSTEM "Системный" #define PR_T_ONLY_READ "Только чтение" -#define SET_BYTE_LANG "байт" +#define T_PROP_SIZE "Размер: %s (%i байт)" #define TITLE_SETT "Настройки" #define SHOW_DEVICE_CLASS "Выводить названия класса устройств" @@ -171,17 +169,15 @@ char *actions[] = { #define QUEST_1 "Apply to all subfolders" #define QUEST_2 "files and Folders?" #define PR_T_NAME "Name:" -#define PR_T_DEST "Destination:" -#define PR_T_SIZE "Size:" +#define PR_T_DEST "Location:" #define CREATED_OPENED_MODIFIED "Created:\nOpened:\nModified:" -#define SET_6 "Files: " -#define SET_7 " Folders: " +#define T_FILES_FOLDERS "Files: %i Folders: %i" #define PR_T_CONTAINS "Contains: " #define FLAGS " Attributes " #define PR_T_HIDDEN "Hidden" #define PR_T_SYSTEM "System" #define PR_T_ONLY_READ "Read-only" -#define SET_BYTE_LANG "byte" +#define T_PROP_SIZE "Size: %s (%i byte)" #define TITLE_SETT "Settings" #define SHOW_DEVICE_CLASS "Show device class name" diff --git a/programs/cmm/eolite/include/properties.h b/programs/cmm/eolite/include/properties.h index 294e3054d3..7ed8536b1c 100644 --- a/programs/cmm/eolite/include/properties.h +++ b/programs/cmm/eolite/include/properties.h @@ -1,6 +1,6 @@ -char path_to_file[4096]; -char file_name2[4096]; +char path_to_file[PATHLEN]; +char file_name2[PATHLEN]; edit_box file_name_ed = {230,59,32,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(file_name2)-2,#file_name2,NULL, 0b,2,2}; edit_box path_to_file_ed = {160,120,79,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,sizeof(path_to_file)-2,#path_to_file,NULL, 0b,2,2}; @@ -32,14 +32,12 @@ void SetPropertiesDir(dword way) dword cur_file; if (dir_exists(way)) { - cur_file = malloc(4096); + cur_file = malloc(PATHLEN); GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); for (i=0; i1) || (streq(path, "/kolibrios")) || (streq(path, "/sys")) show_date = true; + if (getSelectedCount()) show_date = false; + + DefineAndDrawWindow(Form.left + 150,150,315,show_date*60+300+skin_height,0x34,sc.work,WINDOW_TITLE_PROPERTIES,0); GetProcessInfo(#pform, SelfInfo); DrawStandartCaptButton(pform.cwidth - 96, pform.cheight-34, B_CLOSE, T_CLOSE); @@ -235,16 +238,14 @@ void DrawPropertiesWindow() WriteText(10, 78, 0x90, sc.work_text, PR_T_DEST); edit_box_draw stdcall (#path_to_file_ed); - - WriteText(10, 97, 0x90, sc.work_text, PR_T_SIZE); if (getSelectedCount()) { PropertiesDrawIcon(NULL, ""); - sprintf(#folder_info,"%s%d%s%d",SET_6,more_files_count.files,SET_7,more_files_count.folders); + sprintf(#folder_info,T_FILES_FOLDERS,more_files_count.files,more_files_count.folders); WriteText(file_name_ed.left+4, 30, 0x90, sc.work_text, #folder_info); - sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(more_files_count.bytes, NULL),more_files_count.bytes,SET_BYTE_LANG); - WriteText(120, 97, 0x90, sc.work_text, #element_size_label); + sprintf(#element_size_label,T_PROP_SIZE,ConvertSize64(more_files_count.bytes, NULL),more_files_count.bytes); + WriteText(10, 97, 0x90, sc.work_text, #element_size_label); } else { @@ -259,24 +260,26 @@ void DrawPropertiesWindow() WriteText(file_name_ed.left, file_name_ed.top-15, 0x80, sc.work_text, PR_T_NAME); DrawEditBox(#file_name_ed); - if (!itdir) element_size = file_info_general.sizelo; - else - { - WriteText(10,116, 0x90, sc.work_text, PR_T_CONTAINS); - sprintf(#folder_info,"%s%d%s%d",SET_6,dir_size.files,SET_7,dir_size.folders); - WriteText(120, 116, 0x90, sc.work_text, #folder_info); + if (!itdir) { + element_size = file_info_general.sizelo; + } else { + sprintf(#folder_info,PR_T_CONTAINS,dir_size.files,dir_size.folders); + WriteText(10, 117, 0x90, sc.work_text, PR_T_CONTAINS); + WriteText(120, 117, 0x90, sc.work_text, #folder_info); element_size = dir_size.bytes; } - WriteTextLines(10, 136, 0x90, sc.work_text, CREATED_OPENED_MODIFIED, 20); - DrawDate(120, 136, sc.work_text, #file_info_general.datecreate); - DrawDate(120, 156, sc.work_text, #file_info_general.datelastaccess); - DrawDate(120, 176, sc.work_text, #file_info_general.datelastedit); - - sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(element_size, NULL),element_size,SET_BYTE_LANG); - WriteText(120, 99, 0x90, sc.work_text, #element_size_label); + sprintf(#element_size_label,T_PROP_SIZE,ConvertSize64(element_size, NULL),element_size); + WriteText(10, 99, 0x90, sc.work_text, #element_size_label); } - DrawFrame(10, 212, -10*2 + pform.cwidth - 2, 92, FLAGS); - y.n = 212; //212 => attributes_frame.y + + if (show_date) { + WriteTextLines(10, 136, 0x90, sc.work_text, CREATED_OPENED_MODIFIED, 20); + DrawDate(120, 136, sc.work_text, #file_info_general.datecreate); + DrawDate(120, 156, sc.work_text, #file_info_general.datelastaccess); + DrawDate(120, 176, sc.work_text, #file_info_general.datelastedit); + } + + DrawFrame(10, y.set(pform.cheight - 143), -10*2 + pform.cwidth - 2, 92, FLAGS); ch_read_only.draw(24, y.inc(18)); ch_hidden.draw(24, y.inc(24)); ch_system.draw(24, y.inc(24));