Eolite RC7:

- /sys support, use as default path
- fix the lag on app open

git-svn-id: svn://kolibrios.org@8981 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-06-29 20:31:23 +00:00
parent 01b9146608
commit 4c25714a78
5 changed files with 51 additions and 36 deletions

View File

@ -9,8 +9,8 @@ TODO:
*/ */
#define ABOUT_TITLE "EOLITE 5 RC6" #define ABOUT_TITLE "EOLITE 5 RC6"
#define TITLE_EOLITE "Eolite File Manager 5 RC6" #define TITLE_EOLITE "Eolite File Manager 5 RC7"
#define TITLE_KFM "Kolibri File Manager 2 RC6"; #define TITLE_KFM "Kolibri File Manager 2 RC7";
#define MEMSIZE 1024 * 250 #define MEMSIZE 1024 * 250
#include "../lib/clipboard.h" #include "../lib/clipboard.h"
@ -59,6 +59,7 @@ dword waves_pal[256];
//Folder data //Folder data
dword buf, buf_inactive; dword buf, buf_inactive;
collection_int items=0; collection_int items=0;
collection_int selected=0;
int selected_count; int selected_count;
int folder_count; int folder_count;
dword path; dword path;
@ -775,7 +776,8 @@ void Line_ReDraw(dword bgcol, filenum){
ext1="<DIR>"; ext1="<DIR>";
WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, col.list_gb_text, ext1); WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, col.list_gb_text, ext1);
} }
if (chrnum(path, '/')==1) && (streq(path, "/kolibrios")==false) file_size = GetDeviceSize(#full_path); if (chrnum(path, '/')==1) && (streq(path, "/kolibrios")==false)
&& (streq(path, "/sys")==false) file_size = GetDeviceSize(#full_path);
} }
else else
{ {
@ -929,7 +931,7 @@ void Dir_Up()
strcpy(#old_folder_name, path+iii); strcpy(#old_folder_name, path+iii);
if (iii>1) ESBYTE[path+iii-1]=NULL; else ESBYTE[path+iii]=NULL; if (iii>1) ESBYTE[path+iii-1]=NULL; else ESBYTE[path+iii]=NULL;
SelectFileByName(#old_folder_name); SelectFileByName(#old_folder_name);
if(efm)DrawPathBarKfm(); DrawPathBar();
} }
void EventOpenSelected() void EventOpenSelected()

View File

@ -171,15 +171,16 @@ enum {
char *devinfo = { char *devinfo = {
"r", 0, T_SYS, "sy", 0, T_SYS,
"k", 1, T_PROG, "rd", 0, T_SYS,
"f", 2, T_FD, "ko", 1, T_PROG,
"c", 3, T_CD, "fd", 2, T_FD,
"h", 4, T_HD, "cd", 3, T_CD,
"b", 4, T_HD, "hd", 4, T_HD,
"s", 4, T_SATA, "bd", 4, T_HD,
"t", 5, T_RAM, "sd", 4, T_SATA,
"u", 6, T_USB, "tm", 5, T_RAM,
"us", 6, T_USB,
0 0
}; };

View File

@ -230,7 +230,7 @@ void DrawPathBarKfm()
void DrawBreadCrumbs() void DrawBreadCrumbs()
collection_int breadCrumb=0; collection_int breadCrumb=0;
char PathShow_path[4096]; char PathShow_path[4096];
int btnx; int btnx, btnw;
int i; int i;
{ {
breadCrumb.drop(); breadCrumb.drop();
@ -247,13 +247,18 @@ void DrawBreadCrumbs()
} }
breadCrumb.add(i+1); breadCrumb.add(i+1);
if (!efm) btnx = 250-4; if (!efm) {
else btnx = Form.cwidth/2-2*active_panel + DDW + 2; btnx = 250-4;
btnw = Form.cwidth-278;
} else {
btnx = Form.cwidth/2-2*active_panel + DDW + 2;
btnw = 35*active_panel + Form.cwidth/2 - 17 - DDW - 2;
}
for (i=0; i<breadCrumb.count-1; i++) { for (i=0; i<breadCrumb.count-1; i++) {
EDI = breadCrumb.get(i) + #PathShow_path; EDI = breadCrumb.get(i) + #PathShow_path;
DrawFlatButtonSmall(btnx, KFM2_DEVH-1*i+SELECTY+KFM2_DEVH, DrawFlatButtonSmall(btnx, KFM2_DEVH-1*i+SELECTY+KFM2_DEVH,
250, KFM2_DEVH, i+BREADCRUMB_ID, EDI); btnw, KFM2_DEVH, i+BREADCRUMB_ID, EDI);
} }
} }

View File

@ -11,30 +11,37 @@ struct _SystemDiscs
void _SystemDiscs::Get() void _SystemDiscs::Get()
{ {
bool kolibrios_exists=false;
char dev_name[10], sys_discs[10]; char dev_name[10], sys_discs[10];
int i1, j1, dev_num_i, dev_disc_num; int i1, j1, dev_disc_num, real_dev_num;
dword devbuf, diskbuf; dword devbuf, diskbuf;
list.drop(); list.drop();
devbuf = malloc(10000); devbuf = malloc(10000);
ReadDir(19, devbuf, "/"); ReadDir(19, devbuf, "/");
dev_num = dev_num_i = EBX; dev_num = real_dev_num = EBX;
for (i1=0; i1<dev_num_i; i1++)
list.add("/sys");
dev_num++;
if (dir_exists("/kolibrios")) {
//need to check that /sys != /kolibrios
list.add("/kolibrios");
dev_num++;
}
for (i1=0; i1<real_dev_num; i1++)
{ {
sprintf(#dev_name,"/%s",i1*304+ devbuf+72); sprintf(#dev_name,"/%s",i1*304+ devbuf+72);
GetDir(#diskbuf, #dev_disc_num, #dev_name, DIRS_NOROOT); GetDir(#diskbuf, #dev_disc_num, #dev_name, DIRS_NOROOT);
for (j1=0; j1<dev_disc_num; j1++;) for (j1=0; j1<dev_disc_num; j1++;)
{ {
sprintf(#sys_discs,"%s/%s",#dev_name,j1*304+ diskbuf+72); sprintf(#sys_discs,"%s/%s",#dev_name,j1*304+ diskbuf+72);
if (sys_discs[1]=='c') || (dir_exists(#sys_discs)) list.add(#sys_discs); if (sys_discs[1]=='r') {
dev_num--;
continue;
} }
if (!strcmp(#sys_discs, "/rd/1")) if (sys_discs[1]=='c') || (sys_discs[1]=='f') || (dir_exists(#sys_discs)) {
{ list.add(#sys_discs);
if (dir_exists("/kolibrios")) && (!kolibrios_exists) {
kolibrios_exists=true;
list.add("/kolibrios");
dev_num++;
} }
} }
} }
@ -42,11 +49,11 @@ void _SystemDiscs::Get()
free(diskbuf); free(diskbuf);
} }
void GetDiskIconAndName(char disk_first_letter, dword dev_icon, dword disc_name) void GetDiskIconAndName(dword dev_name, dev_icon, disc_name)
{ {
int i; int i;
for (i=0; devinfo[i]!=0; i+=3) { for (i=0; devinfo[i]!=0; i+=3) {
if (disk_first_letter == ESBYTE[devinfo[i]]) { if (!strncmp(dev_name+1, devinfo[i], 2)) {
ESBYTE[dev_icon] = devinfo[i+1]; ESBYTE[dev_icon] = devinfo[i+1];
strcpy(disc_name, devinfo[i+2]); strcpy(disc_name, devinfo[i+2]);
return; return;
@ -74,7 +81,7 @@ void _SystemDiscs::Draw()
draw_x = 17; draw_x = 17;
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[1], #dev_icon, #disc_name); GetDiskIconAndName(#dev_name, #dev_icon, #disc_name);
if (strstr(path, #dev_name)==path) is_active=true; else is_active=false; if (strstr(path, #dev_name)==path) is_active=true; else is_active=false;
DrawBar(draw_x,draw_y,6,DEV_H+1,0xFFFFFF); DrawBar(draw_x,draw_y,6,DEV_H+1,0xFFFFFF);
@ -110,10 +117,10 @@ void _SystemDiscs::DrawSelect(int draw_x, btid, dword _path)
dev_icon = 0; dev_icon = 0;
} else if (chrnum(_path, '/')==1) { } else if (chrnum(_path, '/')==1) {
strcpy(#dev_name, _path); strcpy(#dev_name, _path);
GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name); GetDiskIconAndName(#dev_name, #dev_icon, #disc_name);
} else for (i=0;i<list.count;i++) { } else for (i=0;i<list.count;i++) {
strcpy(#dev_name, list.get(i)); strcpy(#dev_name, list.get(i));
GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name); GetDiskIconAndName(#dev_name, #dev_icon, #disc_name);
if (strstr(_path, #dev_name)-_path==0) break; if (strstr(_path, #dev_name)-_path==0) break;
} }
DrawRectangle(draw_x-1, SELECTY-1, DDW+2-KFM2_DEVH, KFM2_DEVH+1, sc.work_graph); DrawRectangle(draw_x-1, SELECTY-1, DDW+2-KFM2_DEVH, KFM2_DEVH+1, sc.work_graph);
@ -135,7 +142,7 @@ void _SystemDiscs::DrawOptions(int draw_x)
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[1], #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) is_active=true; else is_active=false;
DrawBar(draw_x, optionsy, DDW, KFM2_DEVH, 0xFFFFFF); DrawBar(draw_x, optionsy, DDW, KFM2_DEVH, 0xFFFFFF);

View File

@ -157,7 +157,7 @@ void LoadIniSettings()
Form.top = ini.GetInt("WinY", 30); Form.top = ini.GetInt("WinY", 30);
Form.width = ini.GetInt("WinW", efm*170+550); Form.width = ini.GetInt("WinW", efm*170+550);
Form.height = ini.GetInt("WinH", efm*100+517); Form.height = ini.GetInt("WinH", efm*100+517);
ini.GetString("DefaultPath", #path_start, 4096, "/rd/1"); ini.GetString("DefaultPath", #path_start, 4096, "/sys");
path_start_ed.size = path_start_ed.pos = strlen(#path_start); path_start_ed.size = path_start_ed.pos = strlen(#path_start);
kfont.init(DEFAULT_FONT); kfont.init(DEFAULT_FONT);
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on"); ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");