Eolite: remember of choice for all files during COPY->REPLACE

git-svn-id: svn://kolibrios.org@9534 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Serhii Sakhno 2021-12-31 00:03:12 +00:00
parent c876e40dbc
commit ac5506b6cc
4 changed files with 30 additions and 8 deletions

View File

@ -11,9 +11,9 @@ TODO:
http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334
*/
#define ABOUT_TITLE "EOLITE 5.17"
#define TITLE_EOLITE "Eolite File Manager 5.17"
#define TITLE_KFM "Kolibri File Manager 2.17";
#define ABOUT_TITLE "EOLITE 5.18"
#define TITLE_EOLITE "Eolite File Manager 5.18"
#define TITLE_KFM "Kolibri File Manager 2.18";
#define MEMSIZE 1024 * 250
#include "../lib/clipboard.h"

View File

@ -124,6 +124,7 @@ void PasteThread()
int paste_elements_count = 0;
dword clipbuf;
dword path_offset;
dword copy_state_ex = 0;
clipbuf = Clipboard__GetSlotData(Clipboard__GetSlotCount()-1);
if (DSDWORD[clipbuf+4] != 3) return;
@ -160,6 +161,8 @@ _DIFFERENT_DRIVES:
}
path_offset = clipbuf + 10;
copy_state = FILE_DEFAULT;
saved_state = FILE_DEFAULT;
for (j = 0; j < paste_elements_count; j++) {
strcpy(#copy_from, path_offset);
if (!copy_from) DialogExit();

View File

@ -46,8 +46,9 @@ void DisplayOperationForm(int operation_flag)
copy_bar.max = 0;
}
copy_bar.frame_color = sc.work_graph;
if (copy_state == FILE_DEFAULT) event_mode = #CheckEvent;
if (copy_state == FILE_EXISTS) event_mode = #WaitEvent;
else event_mode = #CheckEvent;
event_mode();
switch(EAX)
{
@ -59,15 +60,22 @@ void DisplayOperationForm(int operation_flag)
DialogExit();
break;
case BTN_REPLACE:
if (is_remember == true) {
saved_state = FILE_REPLACE;
}
copy_state = FILE_REPLACE;
break;
case BTN_SKIP:
if (is_remember == true) {
saved_state = FILE_SKIP;
}
copy_state = FILE_SKIP;
break;
default:
if (remember_choice.click(EAX+1)) {
notify(itoa(remember_choice.checked));
is_remember = remember_choice.checked;
}
break;
}
break;
case evReDraw:

View File

@ -14,17 +14,23 @@ enum {
FILE_SKIP,
};
enum {
MODE_NORMAL,
MODE_FORCE
};
#define WRITE_ERROR_DEBUG 0
#define WRITE_ERROR_NOTIFY 1
:int writing_error_channel = WRITE_ERROR_DEBUG;
int copy_state = FILE_DEFAULT;
int saved_state = FILE_DEFAULT;
bool is_remember = false;
:int copyf(dword from1, in1)
{
dword error;
BDVK CopyFile_atr1;
copy_state = FILE_DEFAULT;
if (!from1) || (!in1)
{
@ -53,6 +59,7 @@ int copy_state = FILE_DEFAULT;
}
if (copy_state == FILE_SKIP)
{
error = 0;
return 0;
}
}
@ -72,7 +79,11 @@ int copy_state = FILE_DEFAULT;
{
if (file_exists(copy_in3)) && (copy_state != FILE_REPLACE)
{
if (saved_state == FILE_DEFAULT) {
copy_state = FILE_EXISTS;
} else {
copy_state = saved_state;
}
return 222;
}
if (GetFreeRAM()-1024*1024 < CopyFile_atr.sizelo) //GetFreeRam-1Mb and convert to bytes
@ -142,7 +153,7 @@ int copy_state = FILE_DEFAULT;
}
if (copy_state == FILE_SKIP)
{
copy_state = FILE_DEFAULT;
error = 0;
break;
}
}