mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Bug [0001772] Error: Pack to file ... - Function aborted by user
This commit is contained in:
parent
7209548ab8
commit
a0b071b4ba
3 changed files with 44 additions and 37 deletions
|
|
@ -36,8 +36,8 @@ type
|
|||
}
|
||||
function GetFileList(const theFiles: TFiles): String;
|
||||
procedure SetTarBefore(const AValue: Boolean);
|
||||
procedure ShowError(sMessage: String; logOptions: TLogOptions = []);
|
||||
procedure LogMessage(sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
procedure ShowError(const sMessage: String; iError: Integer; logOptions: TLogOptions = []);
|
||||
procedure LogMessage(const sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
procedure DeleteFiles(const aFiles: TFiles);
|
||||
|
||||
protected
|
||||
|
|
@ -257,9 +257,12 @@ begin
|
|||
// Check for errors.
|
||||
if iResult <> E_SUCCESS then
|
||||
begin
|
||||
// User aborted operation.
|
||||
if iResult = E_EABORTED then Exit;
|
||||
|
||||
ShowError(Format(rsMsgLogError + rsMsgLogPack,
|
||||
[FWcxArchiveFileSource.ArchiveFileName +
|
||||
' - ' + GetErrorMsg(iResult)]), [log_arc_op]);
|
||||
' : ' + GetErrorMsg(iResult)]), iResult, [log_arc_op]);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
|
@ -347,23 +350,23 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TWcxArchiveCopyInOperation.ShowError(sMessage: String; logOptions: TLogOptions);
|
||||
procedure TWcxArchiveCopyInOperation.ShowError(const sMessage: String;
|
||||
iError: Integer; logOptions: TLogOptions);
|
||||
begin
|
||||
if not gSkipFileOpError then
|
||||
LogMessage(sMessage, logOptions, lmtError);
|
||||
|
||||
if (gSkipFileOpError = False) and (iError > E_SUCCESS) then
|
||||
begin
|
||||
if AskQuestion(sMessage, '', [fsourSkip, fsourAbort],
|
||||
fsourSkip, fsourAbort) = fsourAbort then
|
||||
begin
|
||||
RaiseAbortOperation;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
LogMessage(sMessage, logOptions, lmtError);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWcxArchiveCopyInOperation.LogMessage(sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
procedure TWcxArchiveCopyInOperation.LogMessage(const sMessage: String;
|
||||
logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
begin
|
||||
case logMsgType of
|
||||
lmtError:
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ type
|
|||
|
||||
function DoFileExists(Header: TWcxHeader; var AbsoluteTargetFileName: String): TFileSourceOperationOptionFileExists;
|
||||
|
||||
procedure ShowError(sMessage: String; logOptions: TLogOptions = []);
|
||||
procedure LogMessage(sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
procedure ShowError(const sMessage: String; iError: Integer; logOptions: TLogOptions = []);
|
||||
procedure LogMessage(const sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
|
||||
protected
|
||||
procedure SetProcessDataProc(hArcData: TArcHandle);
|
||||
|
|
@ -300,14 +300,13 @@ begin
|
|||
|
||||
if iResult <> E_SUCCESS then
|
||||
begin
|
||||
// User aborted operation.
|
||||
if iResult = E_EABORTED then Break;
|
||||
|
||||
ShowError(Format(rsMsgLogError + rsMsgLogExtract,
|
||||
[FWcxArchiveFileSource.ArchiveFileName + PathDelim +
|
||||
Header.FileName + ' -> ' + TargetFileName +
|
||||
' - ' + GetErrorMsg(iResult)]), [log_arc_op]);
|
||||
|
||||
// User aborted operation.
|
||||
if iResult = E_EABORTED then
|
||||
Break;
|
||||
' : ' + GetErrorMsg(iResult)]), iResult, [log_arc_op]);
|
||||
end // Error
|
||||
else
|
||||
begin
|
||||
|
|
@ -326,7 +325,7 @@ begin
|
|||
ShowError(Format(rsMsgLogError + rsMsgLogExtract,
|
||||
[FWcxArchiveFileSource.ArchiveFileName + PathDelim +
|
||||
Header.FileName + ' -> ' + TargetFileName +
|
||||
' - ' + GetErrorMsg(iResult)]), [log_arc_op]);
|
||||
' : ' + GetErrorMsg(iResult)]), iResult, [log_arc_op]);
|
||||
end;
|
||||
end; // Skip
|
||||
|
||||
|
|
@ -344,7 +343,7 @@ begin
|
|||
begin
|
||||
ShowError(Format(rsMsgLogError + rsMsgLogExtract,
|
||||
[FWcxArchiveFileSource.ArchiveFileName +
|
||||
' - ' + GetErrorMsg(iResult)]), [log_arc_op]);
|
||||
' : ' + GetErrorMsg(iResult)]), iResult, [log_arc_op]);
|
||||
end;
|
||||
// Free memory
|
||||
FreeAndNil(Files);
|
||||
|
|
@ -659,23 +658,23 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TWcxArchiveCopyOutOperation.ShowError(sMessage: String; logOptions: TLogOptions);
|
||||
procedure TWcxArchiveCopyOutOperation.ShowError(const sMessage: String;
|
||||
iError: Integer; logOptions: TLogOptions);
|
||||
begin
|
||||
if not gSkipFileOpError then
|
||||
LogMessage(sMessage, logOptions, lmtError);
|
||||
|
||||
if (gSkipFileOpError = False) and (iError > E_SUCCESS) then
|
||||
begin
|
||||
if AskQuestion(sMessage, '', [fsourSkip, fsourAbort],
|
||||
fsourSkip, fsourAbort) = fsourAbort then
|
||||
begin
|
||||
RaiseAbortOperation;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
LogMessage(sMessage, logOptions, lmtError);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWcxArchiveCopyOutOperation.LogMessage(sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
procedure TWcxArchiveCopyOutOperation.LogMessage(const sMessage: String;
|
||||
logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
begin
|
||||
case logMsgType of
|
||||
lmtError:
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ uses
|
|||
|
||||
type
|
||||
|
||||
{ TWcxArchiveDeleteOperation }
|
||||
|
||||
TWcxArchiveDeleteOperation = class(TFileSourceDeleteOperation)
|
||||
|
||||
private
|
||||
|
|
@ -31,8 +33,8 @@ type
|
|||
function GetFileList(const theFiles: TFiles): String;
|
||||
|
||||
protected
|
||||
procedure ShowError(sMessage: String; logOptions: TLogOptions);
|
||||
procedure LogMessage(sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
procedure ShowError(const sMessage: String; iError: Integer; logOptions: TLogOptions);
|
||||
procedure LogMessage(const sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
|
||||
public
|
||||
constructor Create(aTargetFileSource: IFileSource;
|
||||
|
|
@ -156,9 +158,12 @@ begin
|
|||
// Check for errors.
|
||||
if iResult <> E_SUCCESS then
|
||||
begin
|
||||
// User aborted operation.
|
||||
if iResult = E_EABORTED then Exit;
|
||||
|
||||
ShowError(Format(rsMsgLogError + rsMsgLogDelete,
|
||||
[FWcxArchiveFileSource.ArchiveFileName +
|
||||
' - ' + GetErrorMsg(iResult)]), [log_arc_op]);
|
||||
' - ' + GetErrorMsg(iResult)]), iResult, [log_arc_op]);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
|
@ -172,23 +177,23 @@ begin
|
|||
ClearCurrentOperation;
|
||||
end;
|
||||
|
||||
procedure TWcxArchiveDeleteOperation.ShowError(sMessage: String; logOptions: TLogOptions);
|
||||
procedure TWcxArchiveDeleteOperation.ShowError(const sMessage: String;
|
||||
iError: Integer; logOptions: TLogOptions);
|
||||
begin
|
||||
if not gSkipFileOpError then
|
||||
LogMessage(sMessage, logOptions, lmtError);
|
||||
|
||||
if (gSkipFileOpError = False) and (iError > E_SUCCESS) then
|
||||
begin
|
||||
if AskQuestion(sMessage, '', [fsourSkip, fsourCancel],
|
||||
if AskQuestion(sMessage, '', [fsourSkip, fsourAbort],
|
||||
fsourSkip, fsourAbort) = fsourAbort then
|
||||
begin
|
||||
RaiseAbortOperation;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
LogMessage(sMessage, logOptions, lmtError);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWcxArchiveDeleteOperation.LogMessage(sMessage: String; logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
procedure TWcxArchiveDeleteOperation.LogMessage(const sMessage: String;
|
||||
logOptions: TLogOptions; logMsgType: TLogMsgType);
|
||||
begin
|
||||
case logMsgType of
|
||||
lmtError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue