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 TITLE_EOLITE "Eolite File Manager 5 RC6"
#define TITLE_KFM "Kolibri File Manager 2 RC6";
#define TITLE_EOLITE "Eolite File Manager 5 RC7"
#define TITLE_KFM "Kolibri File Manager 2 RC7";
#define MEMSIZE 1024 * 250
#include "../lib/clipboard.h"
@ -59,6 +59,7 @@ dword waves_pal[256];
//Folder data
dword buf, buf_inactive;
collection_int items=0;
collection_int selected=0;
int selected_count;
int folder_count;
dword path;
@ -775,7 +776,8 @@ void Line_ReDraw(dword bgcol, filenum){
ext1="<DIR>";
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
{
@ -929,7 +931,7 @@ void Dir_Up()
strcpy(#old_folder_name, path+iii);
if (iii>1) ESBYTE[path+iii-1]=NULL; else ESBYTE[path+iii]=NULL;
SelectFileByName(#old_folder_name);
if(efm)DrawPathBarKfm();
DrawPathBar();
}
void EventOpenSelected()

View File

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

View File

@ -230,7 +230,7 @@ void DrawPathBarKfm()
void DrawBreadCrumbs()
collection_int breadCrumb=0;
char PathShow_path[4096];
int btnx;
int btnx, btnw;
int i;
{
breadCrumb.drop();
@ -247,13 +247,18 @@ void DrawBreadCrumbs()
}
breadCrumb.add(i+1);
if (!efm) btnx = 250-4;
else btnx = Form.cwidth/2-2*active_panel + DDW + 2;
if (!efm) {
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++) {
EDI = breadCrumb.get(i) + #PathShow_path;
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()
{
bool kolibrios_exists=false;
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;
list.drop();
devbuf = malloc(10000);
ReadDir(19, devbuf, "/");
dev_num = dev_num_i = EBX;
for (i1=0; i1<dev_num_i; i1++)
dev_num = real_dev_num = EBX;
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);
GetDir(#diskbuf, #dev_disc_num, #dev_name, DIRS_NOROOT);
for (j1=0; j1<dev_disc_num; j1++;)
{
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 (dir_exists("/kolibrios")) && (!kolibrios_exists) {
kolibrios_exists=true;
list.add("/kolibrios");
dev_num++;
if (sys_discs[1]=='c') || (sys_discs[1]=='f') || (dir_exists(#sys_discs)) {
list.add(#sys_discs);
}
}
}
@ -42,11 +49,11 @@ void _SystemDiscs::Get()
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;
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];
strcpy(disc_name, devinfo[i+2]);
return;
@ -74,7 +81,7 @@ void _SystemDiscs::Draw()
draw_x = 17;
for (i=0;i<list.count;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;
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;
} else if (chrnum(_path, '/')==1) {
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++) {
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;
}
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++) {
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;
DrawBar(draw_x, optionsy, DDW, KFM2_DEVH, 0xFFFFFF);

View File

@ -157,7 +157,7 @@ void LoadIniSettings()
Form.top = ini.GetInt("WinY", 30);
Form.width = ini.GetInt("WinW", efm*170+550);
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);
kfont.init(DEFAULT_FONT);
ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on");