Subversion Repositories Kolibri OS

Rev

Rev 6635 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6635 Rev 6646
Line 5... Line 5...
5
enum {NOCUT, CUT};
5
enum {NOCUT, CUT};
Line 6... Line 6...
6
 
6
 
Line 7... Line 7...
7
Clipboard clipboard;
7
Clipboard clipboard;
8
 
8
 
9
void setElementSelectedFlag(dword n, bool state) {
-
 
10
	dword selected_offset = file_mas[n]*304 + buf+32 + 7;
9
void setElementSelectedFlag(dword n, int state) {
-
 
10
	dword selected_offset = file_mas[n]*304 + buf+32 + 7;
11
	if (!n) if (!strncmp(selected_offset+33, "..", 2)) return; //do not selec ".." directory
11
	ESBYTE[selected_offset] = state;
12
	ESBYTE[selected_offset] = state;
12
	if (n==0) && (strncmp(file_mas[n]*304+buf+72,"..",2)==0) ESBYTE[selected_offset] = false; //do not selec ".." directory
13
	if (state==true) selected_count++;
13
	if (state==true) selected_count++;
Line -... Line 14...
-
 
14
	if (state==false) selected_count--;
-
 
15
}
-
 
16
 
-
 
17
int getElementSelectedFlag(dword n) {
-
 
18
	dword selected_offset = file_mas[n]*304 + buf+32 + 7;
14
	if (state==false) selected_count--;
19
	return ESBYTE[selected_offset];
15
}
20
}
16
 
-
 
17
void Copy(dword pcth, char cut)
21
 
18
{
22
void Copy(dword pcth, char cut)
19
	dword selected_offset2;
23
{
20
	byte copy_t[4096];
24
	byte copy_t[4096];
21
	dword buff_data;
25
	dword buff_data;
Line 27... Line 31...
27
	if (selected_count==0) setElementSelectedFlag(files.cur_y, true); //no element selected by "insert", so we copy current element
31
	if (selected_count==0) setElementSelectedFlag(files.cur_y, true); //no element selected by "insert", so we copy current element
28
	size_buf = 4;
32
	size_buf = 4;
29
	for (i=0; i
33
	for (i=0; i
30
	{
34
	{
31
		selected_offset2 = file_mas[i]*304 + buf+32 + 7;
35
		if (getElementSelectedFlag(i) == true) {
32
		if (ESBYTE[selected_offset2]) {
-
 
33
			sprintf(#copy_t,"%s/%s",#path,file_mas[i]*304+buf+72);
36
			sprintf(#copy_t,"%s/%s",#path,file_mas[i]*304+buf+72);
34
			path_len = strlen(#copy_t);
37
			path_len = strlen(#copy_t);
35
			size_buf += path_len + 1;
38
			size_buf += path_len + 1;
36
		}
39
		}
37
	}
40
	}
38
	size_buf += 20;
41
	size_buf += 20;
Line 42... Line 45...
42
	ESINT[buff_data+8] = selected_count;
45
	ESINT[buff_data+8] = selected_count;
43
	copy_buf_offset = buff_data + 10;
46
	copy_buf_offset = buff_data + 10;
44
	for (i=0; i
47
	for (i=0; i
45
	{
48
	{
46
		selected_offset2 = file_mas[i]*304 + buf+32 + 7;
49
		if (getElementSelectedFlag(i) == true) {
47
		if (ESBYTE[selected_offset2]) {
-
 
48
			sprintf(copy_buf_offset,"%s/%s",#path,file_mas[i]*304+buf+72);
50
			sprintf(copy_buf_offset,"%s/%s",#path,file_mas[i]*304+buf+72);
49
			copy_buf_offset += strlen(copy_buf_offset) + 1;
51
			copy_buf_offset += strlen(copy_buf_offset) + 1;
50
		}
52
		}
51
	}
53
	}
52
	if (selected_count==1) setElementSelectedFlag(files.cur_y, false);
54
	if (selected_count==1) setElementSelectedFlag(files.cur_y, false);
53
	clipboard.SetSlotData(size_buf, buff_data);
55
	clipboard.SetSlotData(size_buf, buff_data);