From fba34f0ab9f6e94e93a42c4f0c1f9798c2180681 Mon Sep 17 00:00:00 2001 From: Serhii Sakhno Date: Mon, 21 Apr 2014 03:01:45 +0000 Subject: [PATCH] Eolite 2.25: fixes the copy function git-svn-id: svn://kolibrios.org@4864 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 7 ++++--- programs/cmm/eolite/include/copy.h | 29 ++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 783658d52a..1882c336b5 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -82,8 +82,8 @@ enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir -#define TITLE "Eolite File Manager v2.22" -#define ABOUT_TITLE "Eolite v2.22" +#define TITLE "Eolite File Manager v2.25" +#define ABOUT_TITLE "Eolite v2.25" dword col_padding, col_selec, col_lpanel; int toolbar_buttons_x[7]={9,46,85,134,167,203}; @@ -428,8 +428,9 @@ void main() Del_Form(); break; case 185: //ins + add_to_copy_active=1; add_to_copy(#file_path); - notify("'Eolite\nFile was added to copy queue' -tI"); + //notify("'Eolite\nFile was added to copy queue' -tI"); break; case 050...059: //F1-F10 FnProcess(key-49); diff --git a/programs/cmm/eolite/include/copy.h b/programs/cmm/eolite/include/copy.h index 8f946539e8..26acec1d78 100644 --- a/programs/cmm/eolite/include/copy.h +++ b/programs/cmm/eolite/include/copy.h @@ -17,6 +17,7 @@ Clipboard clipboard; struct Copy_Path { dword size; dword type; + int count; path_str copy_list[MAX_HISTORY_NUM]; }; @@ -24,15 +25,19 @@ 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++; + if (add_to_copy_active == 1) + { + id_add_to_copy++; + copy_path.count = id_add_to_copy; + } + else copy_path.count = 1; } void Copy(dword pcth, char cut) { - add_to_copy(pcth); + if (add_to_copy_active == 0) add_to_copy(pcth); copy_path.type = 3; copy_path.size = sizeof(copy_path); clipboard.SetSlotData(sizeof(copy_path), #copy_path); @@ -58,11 +63,19 @@ void Paste() { char copy_rezult; byte copy_from[4096]; - int tst; + int tst, count; + dword buf; - for (j = 0; j < MAX_HISTORY_NUM; j++) { + buf = clipboard.GetSlotData(clipboard.GetSlotCount()-1); + count = DSINT[buf+8]; + debugi(count); + + add_to_copy_active=0; + id_add_to_copy=0; + + for (j = 0; j < count; j++) { tst = j*4096; - strlcpy(#copy_from, clipboard.GetSlotData(clipboard.GetSlotCount()-1)+8+tst, 4096); + strlcpy(#copy_from, buf+12+tst, 4096); debug(#copy_from); if (!copy_from) CopyExit(); strcpy(#copy_to, #path); @@ -93,9 +106,7 @@ void Paste() Del_File(true); cut_active=false; } - for (j = 0; j < MAX_HISTORY_NUM; j++) strcpy(#copy_path.copy_list[j].Item, 0); - add_to_copy_active=0; - id_add_to_copy=0; + for (j = 0; j < MAX_HISTORY_NUM; j++) strcpy(#copy_path.copy_list[j].Item[0], 0); CopyExit(); }