mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
ADD: Feature [0001731] Counter of files while moving/copying them #3
This commit is contained in:
parent
c275f9cf61
commit
4637d2e288
5 changed files with 49 additions and 12 deletions
|
|
@ -102,6 +102,7 @@ type
|
|||
procedure UpdateOperation(OpManItem: TOperationsManagerItem);
|
||||
procedure UpdatePauseStartButton(OpManItem: TOperationsManagerItem);
|
||||
procedure SetProgressBarStyle(const AValue: TProgressBarStyle);
|
||||
procedure SetProgressCount(Operation: TFileSourceOperation; DoneFiles: Int64; TotalFiles: Int64);
|
||||
procedure SetProgressBytes(Operation: TFileSourceOperation; ProgressBar: TKASProgressBar; CurrentBytes: Int64; TotalBytes: Int64);
|
||||
procedure SetProgressFiles(Operation: TFileSourceOperation; ProgressBar: TKASProgressBar; CurrentFiles: Int64; TotalFiles: Int64);
|
||||
procedure SetSpeedAndTime(Operation: TFileSourceOperation; RemainingTime: TDateTime; Speed: String);
|
||||
|
|
@ -892,10 +893,10 @@ begin
|
|||
|
||||
with CopyStatistics do
|
||||
begin
|
||||
lblFileCount.Caption := IntToStr(DoneFiles) + ' / ' + IntToStr(TotalFiles);
|
||||
lblFileNameFrom.Caption := MinimizeFilePath(CurrentFileFrom, lblFileNameFrom.Canvas, lblFileNameFrom.Width);
|
||||
lblFileNameTo.Caption := MinimizeFilePath(CurrentFileTo, lblFileNameTo.Canvas, lblFileNameTo.Width);
|
||||
|
||||
SetProgressCount(Operation, DoneFiles, TotalFiles);
|
||||
SetProgressBytes(Operation, pbCurrent, CurrentFileDoneBytes, CurrentFileTotalBytes);
|
||||
SetProgressBytes(Operation, pbTotal, DoneBytes, TotalBytes);
|
||||
SetSpeedAndTime(Operation, RemainingTime, cnvFormatFileSize(BytesPerSecond, uoscOperation));
|
||||
|
|
@ -912,10 +913,10 @@ begin
|
|||
|
||||
with MoveStatistics do
|
||||
begin
|
||||
lblFileCount.Caption := IntToStr(DoneFiles) + ' / ' + IntToStr(TotalFiles);
|
||||
lblFileNameFrom.Caption := MinimizeFilePath(CurrentFileFrom, lblFileNameFrom.Canvas, lblFileNameFrom.Width);
|
||||
lblFileNameTo.Caption := MinimizeFilePath(CurrentFileTo, lblFileNameTo.Canvas, lblFileNameTo.Width);
|
||||
|
||||
SetProgressCount(Operation, DoneFiles, TotalFiles);
|
||||
SetProgressBytes(Operation, pbCurrent, CurrentFileDoneBytes, CurrentFileTotalBytes);
|
||||
SetProgressBytes(Operation, pbTotal, DoneBytes, TotalBytes);
|
||||
SetSpeedAndTime(Operation, RemainingTime, cnvFormatFileSize(BytesPerSecond, uoscOperation));
|
||||
|
|
@ -1177,6 +1178,16 @@ begin
|
|||
pbTotal.Style:= AValue;
|
||||
end;
|
||||
|
||||
procedure TfrmFileOp.SetProgressCount(Operation: TFileSourceOperation;
|
||||
DoneFiles: Int64; TotalFiles: Int64);
|
||||
begin
|
||||
if (DoneFiles < 0) or (TotalFiles = 0) then
|
||||
lblFileCount.Caption := EmptyStr
|
||||
else begin
|
||||
lblFileCount.Caption := IntToStr(DoneFiles) + ' / ' + IntToStr(TotalFiles);
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
Initialize;
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,15 @@ begin
|
|||
FTarBefore:= False;
|
||||
|
||||
inherited Create(aSourceFileSource, aTargetFileSource, theSourceFiles, aTargetPath);
|
||||
|
||||
// Get initialized statistics; then we change only what is needed.
|
||||
FStatistics := RetrieveStatistics;
|
||||
with FStatistics do
|
||||
begin
|
||||
DoneFiles := -1;
|
||||
CurrentFileDoneBytes := -1;
|
||||
UpdateStatistics(FStatistics);
|
||||
end;
|
||||
end;
|
||||
|
||||
destructor TMultiArchiveCopyInOperation.Destroy;
|
||||
|
|
@ -126,14 +135,13 @@ begin
|
|||
|
||||
AddStateChangedListener([fsosStarting, fsosPausing, fsosStopping], @FileSourceOperationStateChangedNotify);
|
||||
|
||||
// Get initialized statistics; then we change only what is needed.
|
||||
FStatistics := RetrieveStatistics;
|
||||
with FStatistics do
|
||||
begin
|
||||
if SourceFiles.Count = 1 then
|
||||
CurrentFileFrom:= SourceFiles[0].FullPath
|
||||
else
|
||||
else begin
|
||||
CurrentFileFrom:= SourceFiles.Path + AllFilesMask;
|
||||
end;
|
||||
CurrentFileTo:= FMultiArchiveFileSource.ArchiveFileName;
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,15 @@ begin
|
|||
FExtractWithoutPath:= False;
|
||||
|
||||
inherited Create(aSourceFileSource, aTargetFileSource, theSourceFiles, aTargetPath);
|
||||
|
||||
// Get initialized statistics; then we change only what is needed.
|
||||
FStatistics := RetrieveStatistics;
|
||||
with FStatistics do
|
||||
begin
|
||||
DoneFiles := -1;
|
||||
CurrentFileDoneBytes := -1;
|
||||
UpdateStatistics(FStatistics);
|
||||
end;
|
||||
end;
|
||||
|
||||
destructor TMultiArchiveCopyOutOperation.Destroy;
|
||||
|
|
@ -137,9 +146,6 @@ begin
|
|||
|
||||
AddStateChangedListener([fsosStarting, fsosPausing, fsosStopping], @FileSourceOperationStateChangedNotify);
|
||||
|
||||
// Get initialized statistics; then we change only what is needed.
|
||||
FStatistics := RetrieveStatistics;
|
||||
|
||||
FFileMask := ExtractFileName(TargetPath);
|
||||
if FFileMask = '' then FFileMask := '*'; // extract all selected files/folders
|
||||
|
||||
|
|
|
|||
|
|
@ -172,6 +172,15 @@ begin
|
|||
FNeedsConnection:= (FWcxArchiveFileSource.WcxModule.BackgroundFlags and BACKGROUND_PACK = 0);
|
||||
|
||||
FFileList:= TStringHashList.Create(True);
|
||||
|
||||
// Get initialized statistics; then we change only what is needed.
|
||||
FStatistics := RetrieveStatistics;
|
||||
with FStatistics do
|
||||
begin
|
||||
DoneFiles := -1;
|
||||
CurrentFileDoneBytes := -1;
|
||||
UpdateStatistics(FStatistics);
|
||||
end;
|
||||
end;
|
||||
|
||||
destructor TWcxArchiveCopyInOperation.Destroy;
|
||||
|
|
@ -193,10 +202,6 @@ begin
|
|||
else
|
||||
WcxCopyInOperationT := Self;
|
||||
|
||||
// Get initialized statistics; then we change only what is needed.
|
||||
FStatistics := RetrieveStatistics;
|
||||
FStatistics.CurrentFileDoneBytes := -1;
|
||||
|
||||
// Gets full list of files (recursive)
|
||||
FillAndCount(SourceFiles,
|
||||
FFullFilesTree,
|
||||
|
|
|
|||
|
|
@ -318,6 +318,13 @@ begin
|
|||
[FWcxArchiveFileSource.ArchiveFileName + PathDelim +
|
||||
Header.FileName +' -> ' + TargetFileName]), [log_arc_op], lmtSuccess);
|
||||
end; // Success
|
||||
|
||||
with FStatistics do
|
||||
begin
|
||||
DoneFiles := DoneFiles + 1;
|
||||
|
||||
UpdateStatistics(FStatistics);
|
||||
end;
|
||||
end // Extract
|
||||
else // Skip
|
||||
begin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue