Rev 5962 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4042 | leency | 1 | |
4428 | leency | 2 | byte copy_from[4096]; |
5514 | leency | 3 | byte cut_active=0; |
4428 | leency | 4 | |
4896 | punk_joker | 5 | |
5804 | punk_joker | 6 | |
5691 | punk_joker | 7 | |
4427 | punk_joker | 8 | |
9 | |||
4896 | punk_joker | 10 | { |
4698 | punk_joker | 11 | dword selected_offset2; |
5513 | punk_joker | 12 | byte copy_t[4096]; |
13 | dword buff_data; |
||
14 | dword path_len = 0; |
||
6597 | punk_joker | 15 | dword buffer_len = 0; |
16 | dword size_buf = 0; |
||
17 | int ind = 0; |
||
5691 | punk_joker | 18 | if (selected_count) |
5513 | punk_joker | 19 | { |
20 | for (i=0; i |
||
6597 | punk_joker | 21 | { |
22 | selected_offset2 = file_mas[i]*304 + buf+32 + 7; |
||
23 | if (ESBYTE[selected_offset2]) { |
||
24 | strcpy(#copy_t, #path); |
||
25 | strcat(#copy_t, file_mas[i]*304+buf+72); |
||
26 | path_len = strlen(#copy_t); |
||
27 | size_buf = size_buf + path_len; |
||
28 | } |
||
29 | } |
||
30 | |||
31 | |||
32 | ESDWORD[buff_data] = size_buf; |
||
33 | ESDWORD[buff_data+4] = 3; |
||
5513 | punk_joker | 34 | ESINT[buff_data+8] = selected_count; |
6597 | punk_joker | 35 | |
36 | |||
5174 | punk_joker | 37 | { |
38 | selected_offset2 = file_mas[i]*304 + buf+32 + 7; |
||
5513 | punk_joker | 39 | if (ESBYTE[selected_offset2]) { |
40 | strcpy(#copy_t, #path); |
||
41 | strcat(#copy_t, file_mas[i]*304+buf+72); |
||
6597 | punk_joker | 42 | path_len = strlen(#copy_t); |
43 | strlcpy(buff_data+10+buffer_len+1, #copy_t, path_len); |
||
44 | buffer_len = buffer_len + path_len; |
||
45 | ind++; |
||
5513 | punk_joker | 46 | } |
47 | } |
||
5174 | punk_joker | 48 | clipboard.SetSlotData(size_buf+10, buff_data); |
6597 | punk_joker | 49 | } |
5513 | punk_joker | 50 | else |
51 | { |
||
52 | buff_data = malloc(4106); |
||
53 | ESDWORD[buff_data] = 4106; |
||
54 | ESDWORD[buff_data+4] = 3; |
||
55 | ESINT[buff_data+8] = 1; |
||
56 | strlcpy(buff_data+10, #file_path, 4096);; |
||
57 | clipboard.SetSlotData(4106, buff_data); |
||
58 | } |
||
59 | cut_active = cut; |
||
4042 | leency | 60 | free(buff_data); |
5209 | punk_joker | 61 | } |
4042 | leency | 62 | |
63 | |||
64 | |||
5609 | leency | 65 | copy_stak = malloc(64000); |
5962 | leency | 66 | CreateThread(#PasteThread,copy_stak+64000-4); |
67 | } |
||
5609 | leency | 68 | |
69 | |||
5608 | leency | 70 | { |
4042 | leency | 71 | char copy_rezult; |
72 | int j; |
||
5174 | punk_joker | 73 | int cnt = 0; |
5514 | leency | 74 | dword buf; |
4864 | punk_joker | 75 | dword path_len = 0; |
6597 | punk_joker | 76 | dword buffer_len = 0; |
77 | file_count_copy = 0; |
||
78 | copy_bar.value = 0; |
||
5691 | punk_joker | 79 | |
6597 | punk_joker | 80 | |
81 | if (DSDWORD[buf+4] != 3) return; |
||
82 | cnt = ESINT[buf+8]; |
||
83 | for (j = 0; j < cnt; j++) { |
||
84 | if (j==0) strlcpy(#copy_from, buf+10+buffer_len); |
||
85 | else strlcpy(#copy_from, buf+10+buffer_len+1); |
||
86 | buffer_len = buffer_len + path_len; |
||
87 | GetFileInfo(#copy_from, #file_info_count); |
||
88 | if ( file_info_count.isfolder ) DirFileCount(#copy_from); |
||
89 | else file_count_copy++; |
||
90 | } |
||
91 | copy_bar.max = file_count_copy; |
||
92 | |||
5931 | punk_joker | 93 | |
6597 | punk_joker | 94 | else operation_flag = COPY_FLAG; |
95 | |||
96 | |||
97 | buffer_len = 0; |
||
98 | DisplayOperationForm(); |
||
99 | for (j = 0; j < cnt; j++) { |
||
100 | if (j==0) strlcpy(#copy_from, buf+10+buffer_len); |
||
101 | else strlcpy(#copy_from, buf+10+buffer_len+1); |
||
102 | path_len = strlen(#copy_from); |
||
103 | buffer_len = buffer_len + path_len; |
||
104 | if (!copy_from) DialogExit(); |
||
105 | strcpy(#copy_to, #path); |
||
106 | strcat(#copy_to, #copy_from+strrchr(#copy_from,'/')); |
||
107 | if (!strcmp(#copy_from,#copy_to)) |
||
108 | { |
||
109 | strcpy(#copy_to, #path); |
||
110 | strcat(#copy_to, "new_"); |
||
111 | strcat(#copy_to, #copy_from+strrchr(#copy_from,'/')); |
||
112 | } |
||
113 | if (strstr(#copy_to, #copy_from)) |
||
114 | { |
||
115 | notify("Copy directory into itself is a bad idea..."); |
||
116 | DialogExit(); |
||
117 | } |
||
118 | |||
119 | |||
120 | { |
||
121 | Write_Error(copy_rezult); |
||
122 | } |
||
123 | else if (cut_active) |
||
124 | { |
||
125 | strcpy(#file_path, #copy_from); |
||
126 | Del_File2(#copy_from, 0); |
||
127 | |||
128 | |||
129 | } |
||
130 | if (cut_active) |
||
131 | { |
||
132 | cut_active=false; |
||
133 | } |
||
134 | if (info_after_copy) notify(INFO_AFTER_COPY); |
||
135 | DialogExit(); |
||
136 | } |
||
137 | |||
138 | |||
139 | |||
140 | |||
141 | void Copy(dword pcth, char cut) |
||
142 | { |
||
143 | dword selected_offset2; |
||
144 | byte copy_t[4096]; |
||
145 | dword buff_data; |
||
146 | dword path_len = 0; |
||
147 | dword buffer_len = 0; |
||
148 | dword size_buf = 0; |
||
149 | int ind = 0; |
||
150 | if (selected_count) |
||
151 | { |
||
152 | for (i=0; i |
||
153 | { |
||
154 | selected_offset2 = file_mas[i]*304 + buf+32 + 7; |
||
155 | if (ESBYTE[selected_offset2]) { |
||
156 | strcpy(#copy_t, #path); |
||
157 | strcat(#copy_t, file_mas[i]*304+buf+72); |
||
158 | path_len = strlen(#copy_t); |
||
159 | size_buf = size_buf + path_len + 4; |
||
160 | } |
||
161 | } |
||
162 | |||
163 | |||
164 | ESDWORD[buff_data] = size_buf; |
||
165 | ESDWORD[buff_data+4] = 3; |
||
166 | ESINT[buff_data+8] = selected_count; |
||
167 | |||
168 | |||
169 | { |
||
170 | selected_offset2 = file_mas[i]*304 + buf+32 + 7; |
||
171 | if (ESBYTE[selected_offset2]) { |
||
172 | strcpy(#copy_t, #path); |
||
173 | strcat(#copy_t, file_mas[i]*304+buf+72); |
||
174 | path_len = strlen(#copy_t); |
||
175 | ESDWORD[buff_data+10+buffer_len] = path_len; |
||
176 | strlcpy(buff_data+10+4+buffer_len, #copy_t, path_len); |
||
177 | buffer_len = buffer_len + 4 + path_len; |
||
178 | ind++; |
||
179 | } |
||
180 | } |
||
181 | clipboard.SetSlotData(size_buf+10, buff_data); |
||
182 | } |
||
183 | else |
||
184 | { |
||
185 | buff_data = malloc(4106); |
||
186 | ESDWORD[buff_data] = 4106; |
||
187 | ESDWORD[buff_data+4] = 3; |
||
188 | ESINT[buff_data+8] = 1; |
||
189 | strlcpy(buff_data+10, #file_path, 4096);; |
||
190 | clipboard.SetSlotData(4106, buff_data); |
||
191 | } |
||
192 | cut_active = cut; |
||
193 | free(buff_data); |
||
194 | } |
||
195 | |||
196 | |||
197 | |||
198 | { |
||
199 | char copy_rezult; |
||
200 | int j; |
||
201 | int cnt = 0; |
||
202 | dword buf; |
||
203 | dword path_len = 0; |
||
204 | dword buffer_len = 0; |
||
205 | file_count_copy = 0; |
||
206 | copy_bar.value = 0; |
||
207 | |||
208 | |||
209 | if (DSDWORD[buf+4] != 3) return; |
||
5514 | leency | 210 | cnt = ESINT[buf+8]; |
5174 | punk_joker | 211 | for (j = 0; j < cnt; j++) { |
5957 | punk_joker | 212 | path_len = ESDWORD[buf+10+buffer_len]; |
6597 | punk_joker | 213 | strlcpy(#copy_from, buf+10+buffer_len+4, path_len); |
214 | buffer_len = buffer_len + 4 + path_len; |
||
215 | GetFileInfo(#copy_from, #file_info_count); |
||
5957 | punk_joker | 216 | if ( file_info_count.isfolder ) DirFileCount(#copy_from); |
217 | else file_count_copy++; |
||
218 | } |
||
219 | copy_bar.max = file_count_copy; |
||
220 | |||
5804 | punk_joker | 221 | |
5957 | punk_joker | 222 | else operation_flag = COPY_FLAG; |
223 | |||
224 | |||
6597 | punk_joker | 225 | buffer_len = 0; |
226 | DisplayOperationForm(); |
||
227 | for (j = 0; j < cnt; j++) { |
||
5691 | punk_joker | 228 | path_len = ESDWORD[buf+10+buffer_len]; |
6597 | punk_joker | 229 | strlcpy(#copy_from, buf+10+buffer_len+4, path_len); |
230 | buffer_len = buffer_len + 4 + path_len; |
||
231 | if (!copy_from) DialogExit(); |
||
5804 | punk_joker | 232 | strcpy(#copy_to, #path); |
4042 | leency | 233 | strcat(#copy_to, #copy_from+strrchr(#copy_from,'/')); |
234 | if (!strcmp(#copy_from,#copy_to)) |
||
5957 | punk_joker | 235 | { |
236 | strcpy(#copy_to, #path); |
||
237 | strcat(#copy_to, "new_"); |
||
238 | strcat(#copy_to, #copy_from+strrchr(#copy_from,'/')); |
||
239 | } |
||
240 | if (strstr(#copy_to, #copy_from)) |
||
4698 | punk_joker | 241 | { |
242 | notify("Copy directory into itself is a bad idea..."); |
||
243 | DialogExit(); |
||
5804 | punk_joker | 244 | } |
4698 | punk_joker | 245 | |
5957 | punk_joker | 246 | |
247 | { |
||
248 | Write_Error(copy_rezult); |
||
249 | } |
||
250 | else if (cut_active) |
||
251 | { |
||
252 | strcpy(#file_path, #copy_from); |
||
6597 | punk_joker | 253 | Del_File2(#copy_from, 0); |
5957 | punk_joker | 254 | |
255 | |||
256 | } |
||
5931 | punk_joker | 257 | if (cut_active) |
5957 | punk_joker | 258 | { |
259 | cut_active=false; |
||
260 | } |
||
261 | if (info_after_copy) notify(INFO_AFTER_COPY); |
||
5459 | punk_joker | 262 | DialogExit(); |
5931 | punk_joker | 263 | } |
6597 | punk_joker | 264 | */>>>> |
265 |