Eolite 2.62: small optimized

git-svn-id: svn://kolibrios.org@5513 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Serhii Sakhno 2015-03-09 18:02:10 +00:00
parent 3d6423b368
commit f74f8c194a
3 changed files with 58 additions and 66 deletions

View File

@ -89,8 +89,8 @@
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
#define TITLE "Eolite File Manager v2.63"
#define ABOUT_TITLE "Eolite v2.63"
#define TITLE "Eolite File Manager v2.64"
#define ABOUT_TITLE "Eolite v2.64"
dword col_padding, col_selec, col_lpanel;
int toolbar_buttons_x[7]={9,46,85,134,167,203};
@ -131,6 +131,7 @@ dword file_mas[6898];
int j, i;
int action_buf;
int rand_n;
int selected_count;
edit_box edit2 = {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,#mouse_dd,64,6,6};
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
@ -392,6 +393,7 @@ void main()
{
selected_offset = file_mas[i]*304 + buf+32 + 7;
ESBYTE[selected_offset] = 1;
selected_count++;
}
List_ReDraw();
break;
@ -402,6 +404,7 @@ void main()
selected_offset = file_mas[i]*304 + buf+32 + 7;
ESBYTE[selected_offset] = 0;
}
selected_count = 0;
List_ReDraw();
break;
case ASCII_KEY_ESC:
@ -443,7 +446,16 @@ void main()
break;
case ASCII_KEY_INS:
selected_offset = file_mas[files.current+files.first]*304 + buf+32 + 7;
if (ESBYTE[selected_offset]) ESBYTE[selected_offset]=0; else ESBYTE[selected_offset] = 1;
if (ESBYTE[selected_offset])
{
ESBYTE[selected_offset]=0;
selected_count--;
}
else
{
ESBYTE[selected_offset] = 1;
selected_count++;
}
List_Current(1);
break;
case 048...059: //F1-F10
@ -831,7 +843,6 @@ void Del_File(byte dodel)
byte del_from[4096];
dword selected_offset2;
int tst, count, i;
int cont = 0;
if (dodel==true)
{
@ -839,27 +850,21 @@ void Del_File(byte dodel)
if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0);
del_error = 0;
for (i=0; i<files.count; i++)
{
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
if (ESBYTE[selected_offset2]) cont++;
}
if (!cont)
if (selected_count)
{
Del_File2(#file_path);
for (i=0; i<files.count; i++)
{
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
if (ESBYTE[selected_offset2]) {
strcpy(#del_from, #path);
strcat(#del_from, file_mas[i]*304+buf+72);
Del_File2(#del_from);
}
}
}
else
{
for (i=0; i<files.count; i++)
{
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
if (ESBYTE[selected_offset2]) {
strcpy(#del_from, #path);
strcat(#del_from, file_mas[i]*304+buf+72);
Del_File2(#del_from);
}
}
Del_File2(#file_path);
}
if (del_error) Write_Error(del_error);
}
@ -938,6 +943,7 @@ void Dir_Up()
void Open(byte rez)
{
byte temp[4096];
selected_count = 0;
if (rez)
{
if (!strcmp(#file_name,"..")) return;

View File

@ -17,45 +17,38 @@ Clipboard clipboard;
void Copy(dword pcth, char cut)
{
dword selected_offset2;
byte copy_t[4096];
int cont = 0;
dword buff_data;
int ind = 0;
dword selected_offset2;
byte copy_t[4096];
dword buff_data;
int ind = 0;
if (selected_count)
{
buff_data = malloc(selected_count*4096+10);
ESDWORD[buff_data] = selected_count*4096+10;
ESDWORD[buff_data+4] = 3;
ESINT[buff_data+8] = selected_count;
for (i=0; i<files.count; i++)
{
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
if (ESBYTE[selected_offset2]) cont++;
}
if (!cont)
{
buff_data = malloc(4106);
ESDWORD[buff_data] = 4106;
ESDWORD[buff_data+4] = 3;
ESINT[buff_data+8] = 1;
strlcpy(buff_data+10, #file_path, 4096);;
clipboard.SetSlotData(4106, buff_data);
}
else
{
buff_data = malloc(cont*4096+10);
ESDWORD[buff_data] = cont*4096+10;
ESDWORD[buff_data+4] = 3;
ESINT[buff_data+8] = cont;
for (i=0; i<files.count; i++)
{
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
if (ESBYTE[selected_offset2]) {
strcpy(#copy_t, #path);
strcat(#copy_t, file_mas[i]*304+buf+72);
strlcpy(ind*4096+buff_data+10, #copy_t, 4096);;
ind++;
}
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
if (ESBYTE[selected_offset2]) {
strcpy(#copy_t, #path);
strcat(#copy_t, file_mas[i]*304+buf+72);
strlcpy(ind*4096+buff_data+10, #copy_t, 4096);;
ind++;
}
clipboard.SetSlotData(cont*4096+10, buff_data);
}
}
clipboard.SetSlotData(selected_count*4096+10, buff_data);
}
else
{
buff_data = malloc(4106);
ESDWORD[buff_data] = 4106;
ESDWORD[buff_data+4] = 3;
ESINT[buff_data+8] = 1;
strlcpy(buff_data+10, #file_path, 4096);;
clipboard.SetSlotData(4106, buff_data);
}
cut_active = cut;
free(buff_data);
}

View File

@ -117,7 +117,6 @@ void properties_dialog()
dword file_name_off;
dword element_size;
dword selected_offset2;
int cont = 0;
char element_size_label[32];
proc_info settings_form;
@ -125,14 +124,8 @@ void properties_dialog()
file_count = 0;
dir_count = 0;
size_dir = 0;
for (i=0; i<files.count; i++)
{
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
if (ESBYTE[selected_offset2]) cont++;
}
if (cont) GetSizeMoreFiles(#path);
if (selected_count) GetSizeMoreFiles(#path);
else
{
GetFileInfo(#file_path, #file_info_general);
@ -175,7 +168,7 @@ void properties_dialog()
WriteText(10, 65, 0x80, 0x000000, PR_T_SIZE);
if (cont)
if (selected_count)
{
Put_icon('', 18, 20, 0xFFFfff, 0);
strcpy(#folder_info, SET_6);