Eolite 5.28

- deny renaming folder '..'
- 'show status bar' option removed
- add option 'bold font'
- Quark view changed to HEX View
This commit is contained in:
2025-03-12 11:34:52 +02:00
committed by Max Logaev
parent 4701a15222
commit 36ce6f0b74
5 changed files with 32 additions and 35 deletions

View File

@@ -11,9 +11,9 @@ TODO:
http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334 http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334
*/ */
#define ABOUT_TITLE "EOLITE 5.27" #define ABOUT_TITLE "EOLITE 5.28"
#define TITLE_EOLITE "Eolite File Manager 5.27" #define TITLE_EOLITE "Eolite File Manager 5.28"
#define TITLE_KFM "Kolibri File Manager 2.27"; #define TITLE_KFM "Kolibri File Manager 2.28";
#define MEMSIZE 1024 * 250 #define MEMSIZE 1024 * 250
#include "../lib/clipboard.h" #include "../lib/clipboard.h"
@@ -542,14 +542,11 @@ void draw_window()
static int rand_n; static int rand_n;
if (!rand_n) && (Form.width + 1 != screen.w) rand_n = random(80); if (!rand_n) && (Form.width + 1 != screen.w) rand_n = random(80);
if (show_status_bar.checked) {
#define STBAR_EOLITE_H 16 #define STBAR_EOLITE_H 16
#define STBAR_KFM_H 21 #define STBAR_KFM_H 21
if (efm) status_bar_h = STBAR_KFM_H; if (efm) status_bar_h = STBAR_KFM_H;
else status_bar_h = STBAR_EOLITE_H; else status_bar_h = STBAR_EOLITE_H;
} else {
status_bar_h = 0;
}
if (efm) title = TITLE_KFM; else title = TITLE_EOLITE; if (efm) title = TITLE_KFM; else title = TITLE_EOLITE;
DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,title,0); DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,title,0);
GetProcessInfo(#Form, SelfInfo); GetProcessInfo(#Form, SelfInfo);
@@ -597,7 +594,7 @@ void draw_window()
} }
//main rectangles //main rectangles
DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42-status_bar_h,sc.line); DrawRectangle(1,40,Form.cwidth-3,Form.cheight - 42-status_bar_h,sc.line);
DrawBar(0,39,1,-show_status_bar.checked*status_bar_h + Form.cheight - 40, sc.work); DrawBar(0,39,1,-status_bar_h + Form.cheight - 40, sc.work);
EBX = Form.cwidth-1 * 65536 + 1; EBX = Form.cwidth-1 * 65536 + 1;
$int 64 $int 64
for (i=0; i<6; i++) DrawBar(0, 34+i, Form.cwidth, 1, MixColors(sc.dark, sc.work, i*10)); for (i=0; i<6; i++) DrawBar(0, 34+i, Form.cwidth, 1, MixColors(sc.dark, sc.work, i*10));
@@ -652,17 +649,13 @@ void DrawStatusBar()
{ {
char status_bar_str[80]; char status_bar_str[80];
int go_up_folder_exists=0; int go_up_folder_exists=0;
dword topcolor; DrawBar(0, Form.cheight - status_bar_h-1, Form.cwidth, 1, sc.light);
if (show_status_bar.checked) topcolor=sc.light; else topcolor=sc.work;
DrawBar(0, Form.cheight - status_bar_h-1, Form.cwidth, 1, topcolor);
if (efm) { if (efm) {
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, 2, sc.work); DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, 2, sc.work);
DrawBar(0, Form.cheight - 2, Form.cwidth, 2, EDX); DrawBar(0, Form.cheight - 2, Form.cwidth, 2, EDX);
DrawBar(Form.cwidth-1, Form.cheight - 19, 1, 17, EDX); DrawBar(Form.cwidth-1, Form.cheight - 19, 1, 17, EDX);
DrawFuncButtonsInKfm(); DrawFuncButtonsInKfm();
} else if (show_status_bar.checked) { } else {
if (files.count>0) && (streq(items.get(0)*304+buf+72,"..")) go_up_folder_exists=1; if (files.count>0) && (streq(items.get(0)*304+buf+72,"..")) go_up_folder_exists=1;
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, sc.work); DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, sc.work);
sprintf(#status_bar_str, T_STATUS_EVEMENTS, folder_count-go_up_folder_exists, files.count-folder_count); sprintf(#status_bar_str, T_STATUS_EVEMENTS, folder_count-go_up_folder_exists, files.count-folder_count);
@@ -1116,7 +1109,6 @@ void EventClosePopinForm()
void ShowPopinForm(byte _popin_type) void ShowPopinForm(byte _popin_type)
{ {
int popinx; int popinx;
popin_string[0] = -1;
switch(_popin_type) { switch(_popin_type) {
case POPIN_PATH: case POPIN_PATH:
edit_box_set_text stdcall (#popin_text, path); edit_box_set_text stdcall (#popin_text, path);
@@ -1131,6 +1123,7 @@ void ShowPopinForm(byte _popin_type)
DrawEolitePopup(T_CREATE, T_CANCEL); DrawEolitePopup(T_CREATE, T_CANCEL);
break; break;
case POPIN_RENAME: case POPIN_RENAME:
if (itdir) && (streq(#file_name,"..")) return;
edit_box_set_text stdcall (#popin_text, #file_name); edit_box_set_text stdcall (#popin_text, #file_name);
DrawEolitePopup(T_RENAME, T_CANCEL); DrawEolitePopup(T_RENAME, T_CANCEL);
break; break;
@@ -1188,7 +1181,7 @@ void FnProcess(byte N)
if (files.count) ShowPopinForm(POPIN_RENAME); if (files.count) ShowPopinForm(POPIN_RENAME);
break; break;
case 3: case 3:
if (files.count) && (!itdir) RunProgram("/kolibrios/utils/quark", #file_path); if (files.count) && (!itdir) RunProgram("/sys/develop/heed", #file_path);
break; break;
case 4: case 4:
if (files.count) && (!itdir) RunProgram("/sys/develop/cedit", #file_path); if (files.count) && (!itdir) RunProgram("/sys/develop/cedit", #file_path);

View File

@@ -42,7 +42,7 @@ void about_dialog()
about_x = -strlen(ABOUT_TITLE)*18+about_form.cwidth/2; about_x = -strlen(ABOUT_TITLE)*18+about_form.cwidth/2;
WriteTextB(about_x+2,107,0x82,0xD49CD2,ABOUT_TITLE); WriteTextB(about_x+2,107,0x82,0xD49CD2,ABOUT_TITLE);
WriteTextB(about_x,105,0x82,0x9D129D,ABOUT_TITLE); WriteTextB(about_x,105,0x82,0x9D129D,ABOUT_TITLE);
WriteTextLines(73,163,0x90,sc.work_text," By Leency\nand KolibriOS Team\n 2008-2021",20); WriteTextLines(73,163,0x90,sc.work_text," By Leency\nand KolibriOS Team\n 2008-2025",20);
#ifdef LANG_RUS #ifdef LANG_RUS
DrawStandartCaptButton(60,about_form.cheight-38,11,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧࠡ<E0A0A7>"); DrawStandartCaptButton(60,about_form.cheight-38,11,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧࠡ<E0A0A7>");
#endif #endif

View File

@@ -38,7 +38,7 @@
char *kfm_func = { char *kfm_func = {
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.",
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "HEX-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.",
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.",
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
@@ -86,9 +86,9 @@ char *actions[] = {
#define TITLE_SETT "<22><><EFBFBD><EFBFBD><EFBFBD><E0AEA9>" #define TITLE_SETT "<22><><EFBFBD><EFBFBD><EFBFBD><E0AEA9>"
#define SHOW_DEVICE_CLASS "<22><EFBFBD><EBA2AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0AEA9><EFBFBD>" #define SHOW_DEVICE_CLASS "<22><EFBFBD><EBA2AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0AEA9><EFBFBD>"
#define SHOW_STATUS_BAR "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA2A0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>"
#define BIG_ICONS "<22><EFBFBD><EFBFBD><ECA7AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" #define BIG_ICONS "<22><EFBFBD><EFBFBD><ECA7AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#define COLORED_LINES "<22><><EFBFBD>ᢥ稢<E1A2A5><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> ᯨ᪥" #define COLORED_LINES "<22><><EFBFBD>ᢥ稢<E1A2A5><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> ᯨ᪥"
#define FONT_BOLD "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>"
#define FONT_SIZE_LABEL "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" #define FONT_SIZE_LABEL "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#define LIST_LINE_HEIGHT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> ᯨ᪥" #define LIST_LINE_HEIGHT "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> ᯨ᪥"
#define SAVE_PATH_AS_DEFAULT "<22><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD>" #define SAVE_PATH_AS_DEFAULT "<22><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD>"
@@ -137,7 +137,7 @@ char *actions[] = {
char *kfm_func = { char *kfm_func = {
"Info", "Info",
"Rename", "Rename",
"View", "HEX View",
"Edit", "Edit",
"Copy", "Copy",
"Move", "Move",
@@ -185,9 +185,9 @@ char *actions[] = {
#define TITLE_SETT "Settings" #define TITLE_SETT "Settings"
#define SHOW_DEVICE_CLASS "Show device class name" #define SHOW_DEVICE_CLASS "Show device class name"
#define SHOW_STATUS_BAR "Show status bar"
#define BIG_ICONS "Big icons in list" #define BIG_ICONS "Big icons in list"
#define COLORED_LINES "Highlight even lines in list" #define COLORED_LINES "Highlight even lines in list"
#define FONT_BOLD "Bold font"
#define FONT_SIZE_LABEL "Font size" #define FONT_SIZE_LABEL "Font size"
#define LIST_LINE_HEIGHT "List line height" #define LIST_LINE_HEIGHT "List line height"
#define SAVE_PATH_AS_DEFAULT "Current path" #define SAVE_PATH_AS_DEFAULT "Current path"

View File

@@ -158,25 +158,27 @@ void _SystemDiscs::DrawOptions(int draw_x)
SystemDiscs.Get(); SystemDiscs.Get();
DrawPopup(draw_x, optionsy, DDW, list.count*KFM2_DEVH, 1, -1, sc.line); DrawPopup(draw_x, optionsy, DDW, list.count*KFM2_DEVH, 1, -1, sc.line);
EAX = kfont.bold;
$push eax
for (i=0;i<list.count;i++) { for (i=0;i<list.count;i++) {
strcpy(#dev_name, list.get(i)); strcpy(#dev_name, list.get(i));
GetDiskIconAndName(#dev_name, #dev_icon, #disc_name); GetDiskIconAndName(#dev_name, #dev_icon, #disc_name);
if (strstr(path, #dev_name)!=0) is_active=true; else is_active=false; if (strstr(path, #dev_name)!=0) kfont.bold=true; else kfont.bold=false;
DrawBar(draw_x, optionsy, DDW, KFM2_DEVH, 0xFFFFFF); DrawBar(draw_x, optionsy, DDW, KFM2_DEVH, 0xFFFFFF);
DefineButton(draw_x, optionsy, DDW, KFM2_DEVH-1, 100+i+BT_HIDE,0xFFFFFF); DefineButton(draw_x, optionsy, DDW, KFM2_DEVH-1, 100+i+BT_HIDE,0xFFFFFF);
PutImage(draw_x + 5, optionsy+2, 18,17, is_active*7+dev_icon*17*18*3+#devices); PutImage(draw_x + 5, optionsy+2, 18,17, kfont.bold*7+dev_icon*17*18*3+#devices);
if (is_active) kfont.bold = true;
//strncpy(#volume_label, GetVolumeLabel(#dev_name), sizeof(volume_label)); //strncpy(#volume_label, GetVolumeLabel(#dev_name), sizeof(volume_label));
strcpy(#label_file_name, #dev_name); strcpy(#label_file_name, #dev_name);
//if (dev_name[1]!='k') && (dev_name[2]!='y') { //if (dev_name[1]!='k') && (dev_name[2]!='y') {
// if (volume_label) sprintf(#label_file_name, "%s [%s]", #dev_name, #volume_label); // if (volume_label) sprintf(#label_file_name, "%s [%s]", #dev_name, #volume_label);
//} //}
kfont.WriteIntoWindow(draw_x + 24, optionsy+2, 0xFFFfff, 0x000000, kfont.size.pt, #label_file_name+1); kfont.WriteIntoWindow(draw_x + 24, optionsy+2, 0xFFFfff, 0x000000, kfont.size.pt, #label_file_name+1);
kfont.bold = false;
optionsy += KFM2_DEVH; optionsy += KFM2_DEVH;
} }
$pop eax
kfont.bold = EAX;
} }

View File

@@ -9,9 +9,9 @@ edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x100000
more_less_box font_size = { NULL, 9, 22, FONT_SIZE_LABEL }; more_less_box font_size = { NULL, 9, 22, FONT_SIZE_LABEL };
more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT }; more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT };
checkbox show_dev_name = { SHOW_DEVICE_CLASS }; checkbox show_dev_name = { SHOW_DEVICE_CLASS };
checkbox show_status_bar = { SHOW_STATUS_BAR };
checkbox big_icons = { BIG_ICONS }; checkbox big_icons = { BIG_ICONS };
checkbox colored_lines = { COLORED_LINES }; checkbox colored_lines = { COLORED_LINES };
checkbox bold_font = { FONT_BOLD };
void settings_dialog() void settings_dialog()
@@ -51,8 +51,10 @@ void settings_dialog()
break; break;
} }
show_dev_name.click(id); show_dev_name.click(id);
show_status_bar.click(id);
colored_lines.click(id); colored_lines.click(id);
if (bold_font.click(id)) {
kfont.bold^=1;
}
if (font_size.click(id)) { if (font_size.click(id)) {
kfont.size.pt = font_size.value; kfont.size.pt = font_size.value;
kfont.changeSIZE(); kfont.changeSIZE();
@@ -72,7 +74,7 @@ void settings_dialog()
case evReDraw: case evReDraw:
DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 400, DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 400,
-efm*42+345+skin_h,0x34,sc.work,TITLE_SETT,0); 345+skin_h,0x34,sc.work,TITLE_SETT,0);
GetProcessInfo(#Settings, SelfInfo); GetProcessInfo(#Settings, SelfInfo);
DrawSettingsCheckBoxes(); DrawSettingsCheckBoxes();
} }
@@ -96,10 +98,10 @@ void DrawSettingsCheckBoxes()
y.n = 0; y.n = 0;
if (!efm) { if (!efm) {
show_dev_name.draw(XXX, y.inc(14)); show_dev_name.draw(XXX, y.inc(14));
show_status_bar.draw(XXX, y.inc(25));
} }
big_icons.draw(XXX, y.inc(25)); big_icons.draw(XXX, y.inc(25));
colored_lines.draw(XXX, y.inc(25)); colored_lines.draw(XXX, y.inc(25));
bold_font.draw(XXX, y.inc(25));
font_size.draw(XXX, y.inc(31)); font_size.draw(XXX, y.inc(31));
line_height.draw(XXX, y.inc(31)); line_height.draw(XXX, y.inc(31));
@@ -121,7 +123,7 @@ void LoadIniSettings()
files.SetFont(6, 9, 10000000b); files.SetFont(6, 9, 10000000b);
show_dev_name.checked = ini.GetInt("ShowDeviceName", true); show_dev_name.checked = ini.GetInt("ShowDeviceName", true);
show_status_bar.checked = ini.GetInt("ShowStatusBar", true); kfont.bold = bold_font.checked = ini.GetInt("BoldFont", false);
big_icons.checked = ini.GetInt("BigIcons", false); BigIconsSwitch(); big_icons.checked = ini.GetInt("BigIcons", false); BigIconsSwitch();
colored_lines.checked = ini.GetInt("ColoredLines", true); colored_lines.checked = ini.GetInt("ColoredLines", true);
kfont.size.pt = ini.GetInt("FontSize", 13); kfont.size.pt = ini.GetInt("FontSize", 13);
@@ -141,7 +143,7 @@ void LoadIniSettings()
void SaveIniSettings() void SaveIniSettings()
{ {
ini.SetInt("ShowDeviceName", show_dev_name.checked); ini.SetInt("ShowDeviceName", show_dev_name.checked);
ini.SetInt("ShowStatusBar", show_status_bar.checked); ini.SetInt("BoldFont", bold_font.checked);
ini.SetInt("BigIcons", big_icons.checked); ini.SetInt("BigIcons", big_icons.checked);
ini.SetInt("ColoredLines", colored_lines.checked); ini.SetInt("ColoredLines", colored_lines.checked);
ini.SetInt("FontSize", kfont.size.pt); ini.SetInt("FontSize", kfont.size.pt);