1
static bool uiSoundEnabled;
3
void uiInit(bool Sound)
5
uiSoundEnabled = Sound;
9
// Additionally to handling user input, it analyzes and sets command options.
10
// Returns only 'replace', 'skip' and 'cancel' codes.
11
UIASKREP_RESULT uiAskReplaceEx(RAROptions *Cmd,wchar *Name,size_t MaxNameSize,int64 FileSize,RarTime *FileTime,uint Flags)
13
if (Cmd->Overwrite==OVERWRITE_NONE)
14
return UIASKREP_R_SKIP;
16
#if !defined(SFX_MODULE) && !defined(SILENT)
17
// Must be before Cmd->AllYes check or -y switch would override -or.
18
if (Cmd->Overwrite==OVERWRITE_AUTORENAME && GetAutoRenamedName(Name,MaxNameSize))
19
return UIASKREP_R_REPLACE;
22
// This check must be after OVERWRITE_AUTORENAME processing or -y switch
23
// would override -or.
24
if (Cmd->AllYes || Cmd->Overwrite==OVERWRITE_ALL)
26
PrepareToDelete(Name);
27
return UIASKREP_R_REPLACE;
31
wcsncpyz(NewName,Name,ASIZE(NewName));
32
UIASKREP_RESULT Choice=uiAskReplace(NewName,ASIZE(NewName),FileSize,FileTime,Flags);
34
if (Choice==UIASKREP_R_REPLACE || Choice==UIASKREP_R_REPLACEALL)
35
PrepareToDelete(Name);
37
if (Choice==UIASKREP_R_REPLACEALL)
39
Cmd->Overwrite=OVERWRITE_ALL;
40
return UIASKREP_R_REPLACE;
42
if (Choice==UIASKREP_R_SKIPALL)
44
Cmd->Overwrite=OVERWRITE_NONE;
45
return UIASKREP_R_SKIP;
47
if (Choice==UIASKREP_R_RENAME)
49
if (PointToName(NewName)==NewName)
50
SetName(Name,NewName,MaxNameSize);
52
wcsncpyz(Name,NewName,MaxNameSize);
54
return uiAskReplaceEx(Cmd,Name,MaxNameSize,FileSize,FileTime,Flags);
55
return UIASKREP_R_REPLACE;
57
#if !defined(SFX_MODULE) && !defined(SILENT)
58
if (Choice==UIASKREP_R_RENAMEAUTO && GetAutoRenamedName(Name,MaxNameSize))
60
Cmd->Overwrite=OVERWRITE_AUTORENAME;
61
return UIASKREP_R_REPLACE;