forked from KolibriOS/kolibrios
Eolite 2.17: copy multiple files / directories
git-svn-id: svn://kolibrios.org@4698 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
8c3cc24496
commit
1603a31044
@ -80,8 +80,8 @@
|
|||||||
|
|
||||||
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
|
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
|
||||||
|
|
||||||
#define TITLE "Eolite File Manager v2.16.2"
|
#define TITLE "Eolite File Manager v2.17"
|
||||||
#define ABOUT_TITLE "Eolite v2.16.2"
|
#define ABOUT_TITLE "Eolite v2.17"
|
||||||
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};
|
||||||
@ -305,9 +305,11 @@ void main()
|
|||||||
Dir_Up();
|
Dir_Up();
|
||||||
break;
|
break;
|
||||||
case 24: //cut
|
case 24: //cut
|
||||||
|
add_to_copy(#file_path);
|
||||||
Copy(#file_path, CUT);
|
Copy(#file_path, CUT);
|
||||||
break;
|
break;
|
||||||
case 25: //copy
|
case 25: //copy
|
||||||
|
add_to_copy(#file_path);
|
||||||
Copy(#file_path, NOCUT);
|
Copy(#file_path, NOCUT);
|
||||||
break;
|
break;
|
||||||
case 26: //paste
|
case 26: //paste
|
||||||
@ -385,9 +387,11 @@ void main()
|
|||||||
RunProgram("/sys/File Managers/Eolite", #path);
|
RunProgram("/sys/File Managers/Eolite", #path);
|
||||||
break;
|
break;
|
||||||
case 024: //Ctrl+X
|
case 024: //Ctrl+X
|
||||||
|
add_to_copy(#file_path);
|
||||||
Copy(#file_path, CUT);
|
Copy(#file_path, CUT);
|
||||||
break;
|
break;
|
||||||
case 003: //Ctrl+C
|
case 003: //Ctrl+C
|
||||||
|
add_to_copy(#file_path);
|
||||||
Copy(#file_path, NOCUT);
|
Copy(#file_path, NOCUT);
|
||||||
break;
|
break;
|
||||||
case 022: //Ctrl+V
|
case 022: //Ctrl+V
|
||||||
@ -429,6 +433,9 @@ void main()
|
|||||||
case 182: //del
|
case 182: //del
|
||||||
Del_Form();
|
Del_Form();
|
||||||
break;
|
break;
|
||||||
|
case 185: //ins
|
||||||
|
add_to_copy(#file_path);
|
||||||
|
break;
|
||||||
case 050...059: //F1-F10
|
case 050...059: //F1-F10
|
||||||
FnProcess(key-49);
|
FnProcess(key-49);
|
||||||
break;
|
break;
|
||||||
@ -594,7 +601,6 @@ void Line_ReDraw(dword color, filenum){
|
|||||||
name_len=0,
|
name_len=0,
|
||||||
attr,
|
attr,
|
||||||
y=filenum*files.line_h+files.y;
|
y=filenum*files.line_h+files.y;
|
||||||
if (filenum==-1) return;
|
|
||||||
DrawBar(files.x,y,3,files.line_h,color);
|
DrawBar(files.x,y,3,files.line_h,color);
|
||||||
DrawBar(files.x+19,y,files.w-19,files.line_h,color);
|
DrawBar(files.x+19,y,files.w-19,files.line_h,color);
|
||||||
DrawBar(files.x+3,y+17,16,1,color);
|
DrawBar(files.x+3,y+17,16,1,color);
|
||||||
@ -607,7 +613,7 @@ void Line_ReDraw(dword color, filenum){
|
|||||||
if (! TestBit(attr, 4) ) //file or folder?
|
if (! TestBit(attr, 4) ) //file or folder?
|
||||||
{
|
{
|
||||||
Put_icon(off+_strrchr(off,'.'), files.x+3, files.line_h/2-7+y, color, 0);
|
Put_icon(off+_strrchr(off,'.'), files.x+3, files.line_h/2-7+y, color, 0);
|
||||||
WriteText(7-strlen(ConvertSize(ESDWORD[off-8]))*6+onLeft(75,0),files.line_h-6/2+y,0x80,0,ConvertSize(ESDWORD[off-8])); //size
|
WriteText(7-strlen(ConvertMemSize(ESDWORD[off-8]))*6+onLeft(75,0),files.line_h-6/2+y,0x80,0,ConvertMemSize(ESDWORD[off-8])); //size
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (!strcmp("..",off))
|
if (!strcmp("..",off))
|
||||||
|
@ -2,18 +2,39 @@
|
|||||||
|
|
||||||
byte copy_to[4096];
|
byte copy_to[4096];
|
||||||
byte cut_active=0;
|
byte cut_active=0;
|
||||||
|
byte id_add_to_copy=0;
|
||||||
|
byte add_to_copy_active=0;
|
||||||
enum {NOCUT, CUT, COPY_PASTE_END};
|
enum {NOCUT, CUT, COPY_PASTE_END};
|
||||||
|
|
||||||
|
struct path_str {
|
||||||
|
char Item[4096];
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MAX_HISTORY_NUM 10
|
||||||
|
|
||||||
Clipboard clipboard;
|
Clipboard clipboard;
|
||||||
|
|
||||||
|
struct Copy_Path {
|
||||||
|
dword size;
|
||||||
|
dword type;
|
||||||
|
path_str copy_list[MAX_HISTORY_NUM];
|
||||||
|
};
|
||||||
|
|
||||||
|
Copy_Path copy_path;
|
||||||
|
|
||||||
|
void add_to_copy(dword pcth)
|
||||||
|
{
|
||||||
|
add_to_copy_active=1;
|
||||||
|
strlcpy(#copy_path.copy_list[id_add_to_copy].Item, pcth);
|
||||||
|
id_add_to_copy++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Copy(dword pcth, char cut)
|
void Copy(dword pcth, char cut)
|
||||||
{
|
{
|
||||||
clipboard.data.size = sizeof(buffer_data);
|
copy_path.type = 3;
|
||||||
clipboard.data.type = 0;
|
copy_path.size = sizeof(copy_path);
|
||||||
clipboard.data.encoding = 1;
|
clipboard.SetSlotData(sizeof(copy_path), #copy_path);
|
||||||
strcpy(#clipboard.data.buffer_data, pcth);
|
|
||||||
clipboard.SetSlotData(sizeof(buffer_data), #clipboard.data);
|
|
||||||
cut_active = cut;
|
cut_active = cut;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,9 +57,12 @@ void Paste()
|
|||||||
{
|
{
|
||||||
char copy_rezult;
|
char copy_rezult;
|
||||||
byte copy_from[4096];
|
byte copy_from[4096];
|
||||||
|
int tst;
|
||||||
|
|
||||||
strcpy(#copy_from, clipboard.GetSlotData(clipboard.GetSlotCount()-1)+12);
|
for (j = 0; j < MAX_HISTORY_NUM; j++) {
|
||||||
|
tst = j*4096;
|
||||||
|
strlcpy(#copy_from, clipboard.GetSlotData(clipboard.GetSlotCount()-1)+8+tst, 4096);
|
||||||
|
debug(#copy_from);
|
||||||
if (!copy_from) ExitProcess();
|
if (!copy_from) ExitProcess();
|
||||||
strcpy(#copy_to, #path);
|
strcpy(#copy_to, #path);
|
||||||
strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
|
strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
|
||||||
@ -57,13 +81,21 @@ void Paste()
|
|||||||
{
|
{
|
||||||
Write_Error(copy_rezult);
|
Write_Error(copy_rezult);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (copy_rezult = copyf(#copy_from,#copy_to))
|
||||||
|
{
|
||||||
|
Write_Error(copy_rezult);
|
||||||
|
}
|
||||||
else if (cut_active)
|
else if (cut_active)
|
||||||
{
|
{
|
||||||
strcpy(#file_path, #copy_from);
|
strcpy(#file_path, #copy_from);
|
||||||
Del_File(true);
|
Del_File(true);
|
||||||
cut_active=false;
|
cut_active=false;
|
||||||
}
|
}
|
||||||
|
for (j = 0; j < MAX_HISTORY_NUM; j++) strcpy(#copy_path.copy_list[j].Item, 0);
|
||||||
action_buf = COPY_PASTE_END;
|
action_buf = COPY_PASTE_END;
|
||||||
|
add_to_copy_active=0;
|
||||||
|
id_add_to_copy=0;
|
||||||
ActivateWindow(GetProcessSlot(Form.ID));
|
ActivateWindow(GetProcessSlot(Form.ID));
|
||||||
ExitProcess();
|
ExitProcess();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user