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

View File

@ -17,45 +17,38 @@ Clipboard clipboard;
void Copy(dword pcth, char cut) void Copy(dword pcth, char cut)
{ {
dword selected_offset2; dword selected_offset2;
byte copy_t[4096]; byte copy_t[4096];
int cont = 0; dword buff_data;
dword buff_data; int ind = 0;
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++) for (i=0; i<files.count; i++)
{ {
selected_offset2 = file_mas[i]*304 + buf+32 + 7; selected_offset2 = file_mas[i]*304 + buf+32 + 7;
if (ESBYTE[selected_offset2]) cont++; if (ESBYTE[selected_offset2]) {
} strcpy(#copy_t, #path);
if (!cont) strcat(#copy_t, file_mas[i]*304+buf+72);
{ strlcpy(ind*4096+buff_data+10, #copy_t, 4096);;
buff_data = malloc(4106); ind++;
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++;
}
} }
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; cut_active = cut;
free(buff_data); free(buff_data);
} }

View File

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