forked from KolibriOS/kolibrios
Eolite 2.39: copy the selected files
git-svn-id: svn://kolibrios.org@5174 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
4ef97c812c
commit
1b1d267df0
@ -19,6 +19,7 @@
|
||||
#include "..\lib\list_box.h"
|
||||
#include "..\lib\copyf.h"
|
||||
#include "..\lib\random.h"
|
||||
#include "..\lib\lib.obj\libini.h"
|
||||
//images
|
||||
#include "imgs\toolbar.txt"
|
||||
#include "imgs\left_p.txt"
|
||||
@ -82,8 +83,8 @@
|
||||
|
||||
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
|
||||
|
||||
#define TITLE "Eolite File Manager v2.38"
|
||||
#define ABOUT_TITLE "Eolite v2.38"
|
||||
#define TITLE "Eolite File Manager v2.39"
|
||||
#define ABOUT_TITLE "Eolite v2.39"
|
||||
dword col_padding, col_selec, col_lpanel;
|
||||
|
||||
int toolbar_buttons_x[7]={9,46,85,134,167,203};
|
||||
@ -125,7 +126,6 @@ edit_box edit2 = {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_nam
|
||||
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
|
||||
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
|
||||
|
||||
#include "include\mark.h"
|
||||
#include "include\copy.h"
|
||||
#include "include\other.h"
|
||||
#include "include\sorting.h"
|
||||
@ -165,8 +165,8 @@ void main()
|
||||
files.line_h=18;
|
||||
mem_Init();
|
||||
if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1);
|
||||
if (load_dll2(libini, #lib_init,1)!=0) notify("Error: library doesn't exists - libini");
|
||||
SystemDiscsGet();
|
||||
mark_default();
|
||||
GetIni(1);
|
||||
SetAppColors();
|
||||
if (param)
|
||||
@ -872,7 +872,6 @@ void Dir_Up()
|
||||
|
||||
void Open()
|
||||
{
|
||||
mark_default();
|
||||
if (!files.count) return;
|
||||
if (!itdir)
|
||||
{
|
||||
|
@ -9,12 +9,33 @@ Clipboard clipboard;
|
||||
|
||||
void Copy(dword pcth, char cut)
|
||||
{
|
||||
if (mark_active == 0) {
|
||||
strlcpy(#elements_path.element_list[elements_path.count].Item, pcth);
|
||||
elements_path.count++;
|
||||
dword selected_offset2;
|
||||
byte copy_t[4096];
|
||||
int cont = 0;
|
||||
dword buff_data;
|
||||
int ind = 0;
|
||||
|
||||
for (i=0; i<files.count; i++)
|
||||
{
|
||||
selected_offset2 = file_mas[i]*304 + buf+32 + 7;
|
||||
if (ESBYTE[selected_offset2]) cont++;
|
||||
}
|
||||
elements_path.size = sizeof(elements_path);
|
||||
clipboard.SetSlotData(sizeof(elements_path), #elements_path);
|
||||
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);
|
||||
cut_active = cut;
|
||||
}
|
||||
|
||||
@ -36,17 +57,15 @@ void Paste()
|
||||
{
|
||||
char copy_rezult;
|
||||
byte copy_from[4096];
|
||||
int tst, count, j;
|
||||
int j;
|
||||
int cnt = 0;
|
||||
dword buf;
|
||||
|
||||
buf = clipboard.GetSlotData(clipboard.GetSlotCount()-1);
|
||||
count = DSINT[buf+8];
|
||||
if (DSDWORD[buf+4] != 3) return;
|
||||
debugi(count);
|
||||
|
||||
for (j = 0; j < count; j++) {
|
||||
tst = j*4096;
|
||||
strlcpy(#copy_from, buf+12+tst, 4096);
|
||||
cnt = ESINT[buf+8];
|
||||
for (j = 0; j < cnt; j++) {
|
||||
strlcpy(#copy_from, j*4096+buf+10, 4096);
|
||||
if (!copy_from) CopyExit();
|
||||
strcpy(#copy_to, #path);
|
||||
strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
|
||||
@ -77,7 +96,7 @@ void Paste()
|
||||
{
|
||||
cut_active=false;
|
||||
}
|
||||
mark_default();
|
||||
//mark_default();
|
||||
CopyExit();
|
||||
}
|
||||
|
||||
|
@ -1,32 +0,0 @@
|
||||
#define MAX_ELEMENT 10
|
||||
|
||||
byte mark_active = 0;
|
||||
|
||||
struct path_strng {
|
||||
char Item[4096];
|
||||
};
|
||||
|
||||
struct Elements_Path {
|
||||
dword size;
|
||||
dword type;
|
||||
int count;
|
||||
path_strng element_list[MAX_ELEMENT];
|
||||
};
|
||||
|
||||
Elements_Path elements_path;
|
||||
|
||||
void mark_default()
|
||||
{
|
||||
mark_active = 0;
|
||||
elements_path.count = 0;
|
||||
elements_path.type = 3;
|
||||
for (i = 0; i < MAX_ELEMENT; i++) strcpy(#elements_path.element_list[i].Item[0], 0);
|
||||
}
|
||||
|
||||
void add_to_mark(dword pcth)
|
||||
{
|
||||
if (mark_active) mark_active = 1;
|
||||
strlcpy(#elements_path.element_list[elements_path.count].Item, pcth);
|
||||
elements_path.count++;
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user