mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Operations viewer: Display more details about operations.
This commit is contained in:
parent
222b8e0550
commit
82d5657136
20 changed files with 175 additions and 26 deletions
|
|
@ -263,7 +263,7 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
Caption := OpManItem.Operation.GetDescription([fsoddJob]);
|
||||
Caption := OpManItem.Operation.GetDescription(fsoddJob);
|
||||
Hint := Caption;
|
||||
UpdatePauseStartButton(OpManItem.Operation.State);
|
||||
|
||||
|
|
|
|||
|
|
@ -507,7 +507,7 @@ begin
|
|||
if Assigned(OpManItem) then
|
||||
begin
|
||||
FText := IntToStr(OpManItem.Handle) + ': ' +
|
||||
OpManItem.Operation.GetDescription([fsoddJob]);
|
||||
OpManItem.Operation.GetDescription(fsoddJobAndTarget);
|
||||
FProgress := OpManItem.Operation.Progress;
|
||||
if FProgress > 0 then
|
||||
FText := FText + ' - ' + FloatToStrF(FProgress * 100, ffFixed, 1, 1) + ' %';
|
||||
|
|
|
|||
|
|
@ -134,9 +134,29 @@ function TFileSourceCalcChecksumOperation.GetDescription(Details: TFileSourceOpe
|
|||
begin
|
||||
case Mode of
|
||||
checksum_calc:
|
||||
Result := rsOperCalculatingCheckSum;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
begin
|
||||
if Files.Count = 1 then
|
||||
Result := Format(rsOperCalculatingCheckSumOf, [Files[0].FullPath])
|
||||
else
|
||||
Result := Format(rsOperCalculatingCheckSumIn, [Files.Path]);
|
||||
end;
|
||||
else
|
||||
Result := rsOperCalculatingCheckSum;
|
||||
end;
|
||||
checksum_verify:
|
||||
Result := rsOperVerifyingCheckSum;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
begin
|
||||
if Files.Count = 1 then
|
||||
Result := Format(rsOperVerifyingCheckSumOf, [Files[0].FullPath])
|
||||
else
|
||||
Result := Format(rsOperVerifyingCheckSumIn, [Files.Path]);
|
||||
end;
|
||||
else
|
||||
Result := rsOperVerifyingCheckSum;
|
||||
end;
|
||||
else
|
||||
Result := inherited GetDescription(Details);
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -121,7 +121,12 @@ end;
|
|||
|
||||
function TFileSourceCalcStatisticsOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperCalculatingStatictics;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
Result := Format(rsOperCalculatingStatisticsIn, [Files.Path]);
|
||||
else
|
||||
Result := rsOperCalculatingStatictics;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFileSourceCalcStatisticsOperation.GetID: TFileSourceOperationType;
|
||||
|
|
|
|||
|
|
@ -179,7 +179,12 @@ end;
|
|||
|
||||
function TFileSourceCombineOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperCombining;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
Result := Format(rsOperCombiningFromTo, [SourceFiles.Path, TargetFile]);
|
||||
else
|
||||
Result := rsOperCombining;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -191,7 +191,17 @@ end;
|
|||
|
||||
function TFileSourceCopyOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperCopying;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
begin
|
||||
if SourceFiles.Count = 1 then
|
||||
Result := Format(rsOperCopyingSomethingTo, [SourceFiles[0].Name, TargetPath])
|
||||
else
|
||||
Result := Format(rsOperCopyingFromTo, [SourceFiles.Path, TargetPath]);
|
||||
end;
|
||||
else
|
||||
Result := rsOperCopying;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFileSourceCopyOperation.UpdateStatistics(var NewStatistics: TFileSourceCopyOperationStatistics);
|
||||
|
|
|
|||
|
|
@ -103,7 +103,12 @@ end;
|
|||
|
||||
function TFileSourceCreateDirectoryOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperCreatingDirectory;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
Result := Format(rsOperCreatingSomeDirectory, [AbsolutePath]);
|
||||
else
|
||||
Result := rsOperCreatingDirectory;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -110,7 +110,17 @@ end;
|
|||
|
||||
function TFileSourceDeleteOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperDeleting;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
begin
|
||||
if FilesToDelete.Count = 1 then
|
||||
Result := Format(rsOperDeletingSomething, [FilesToDelete[0].FullPath])
|
||||
else
|
||||
Result := Format(rsOperDeletingIn, [FilesToDelete.Path]);
|
||||
end;
|
||||
else
|
||||
Result := rsOperDeleting;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFileSourceDeleteOperation.UpdateStatistics(var NewStatistics: TFileSourceDeleteOperationStatistics);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,12 @@ end;
|
|||
|
||||
function TFileSourceExecuteOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperExecuting;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
Result := Format(rsOperExecutingSomething, [ExecutableFile.Name]);
|
||||
else
|
||||
Result := rsOperExecuting;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -68,7 +68,12 @@ end;
|
|||
|
||||
function TFileSourceListOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperListing;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
Result := Format(rsOperListingIn, [Path]);
|
||||
else
|
||||
Result := rsOperListing;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFileSourceListOperation.GetID: TFileSourceOperationType;
|
||||
|
|
|
|||
|
|
@ -185,7 +185,17 @@ end;
|
|||
|
||||
function TFileSourceMoveOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperMoving;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
begin
|
||||
if SourceFiles.Count = 1 then
|
||||
Result := Format(rsOperMovingSomethingTo, [SourceFiles[0].Name, TargetPath])
|
||||
else
|
||||
Result := Format(rsOperMovingFromTo, [SourceFiles.Path, TargetPath]);
|
||||
end;
|
||||
else
|
||||
Result := rsOperMoving;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -50,10 +50,9 @@ type
|
|||
(fsorFinished, //<en operation has finished successfully
|
||||
fsorAborted); //<en operation has been aborted by user
|
||||
|
||||
TFileSourceOperationDescriptionDetail =
|
||||
(fsoddJob); //<en What the operation is supposed to be doing in general: copying, deleting, etc.
|
||||
|
||||
TFileSourceOperationDescriptionDetails = set of TFileSourceOperationDescriptionDetail;
|
||||
TFileSourceOperationDescriptionDetails =
|
||||
(fsoddJob, //<en What the operation is supposed to be doing in general: copying, deleting, etc.
|
||||
fsoddJobAndTarget); //<en Job + on what the operation works: copying from /path to /path2, deleting from /path, etc.
|
||||
|
||||
const
|
||||
FileSourceOperationStateText: array[TFileSourceOperationState] of string =
|
||||
|
|
|
|||
|
|
@ -184,7 +184,17 @@ end;
|
|||
|
||||
function TFileSourceSetFilePropertyOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperSettingProperty;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
begin
|
||||
if TargetFiles.Count = 1 then
|
||||
Result := Format(rsOperSettingPropertyOf, [TargetFiles[0].FullPath])
|
||||
else
|
||||
Result := Format(rsOperSettingPropertyIn, [TargetFiles.Path]);
|
||||
end;
|
||||
else
|
||||
Result := rsOperSettingProperty;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFileSourceSetFilePropertyOperation.UpdateStatistics(var NewStatistics: TFileSourceSetFilePropertyOperationStatistics);
|
||||
|
|
|
|||
|
|
@ -183,7 +183,12 @@ end;
|
|||
|
||||
function TFileSourceSplitOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperSplitting;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
Result := Format(rsOperSplittingFromTo, [SourceFile.Path, TargetPath]);
|
||||
else
|
||||
Result := rsOperSplitting;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -113,7 +113,17 @@ end;
|
|||
|
||||
function TFileSourceTestArchiveOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperTesting;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
begin
|
||||
if SourceFiles.Count = 1 then
|
||||
Result := Format(rsOperTestingSomething, [SourceFiles[0].Name])
|
||||
else
|
||||
Result := Format(rsOperTestingIn, [SourceFiles.Path]);
|
||||
end;
|
||||
else
|
||||
Result := rsOperTesting;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFileSourceTestArchiveOperation.GetID: TFileSourceOperationType;
|
||||
|
|
|
|||
|
|
@ -113,7 +113,17 @@ end;
|
|||
|
||||
function TFileSourceWipeOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperWiping;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
begin
|
||||
if FilesToWipe.Count = 1 then
|
||||
Result := Format(rsOperWipingSomething, [FilesToWipe[0].FullPath])
|
||||
else
|
||||
Result := Format(rsOperWipingIn, [FilesToWipe.Path]);
|
||||
end;
|
||||
else
|
||||
Result := rsOperWiping;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFileSourceWipeOperation.UpdateStatistics(var NewStatistics: TFileSourceWipeOperationStatistics);
|
||||
|
|
|
|||
|
|
@ -282,7 +282,17 @@ end;
|
|||
|
||||
function TWcxArchiveCopyInOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperPacking;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
begin
|
||||
if SourceFiles.Count = 1 then
|
||||
Result := Format(rsOperPackingSomethingTo, [SourceFiles[0].Name, FWcxArchiveFileSource.ArchiveFileName])
|
||||
else
|
||||
Result := Format(rsOperPackingFromTo, [SourceFiles.Path, FWcxArchiveFileSource.ArchiveFileName]);
|
||||
end;
|
||||
else
|
||||
Result := rsOperPacking;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TWcxArchiveCopyInOperation.GetFileList(const theFiles: TFiles): String;
|
||||
|
|
|
|||
|
|
@ -372,7 +372,12 @@ end;
|
|||
|
||||
function TWcxArchiveCopyOutOperation.GetDescription(Details: TFileSourceOperationDescriptionDetails): String;
|
||||
begin
|
||||
Result := rsOperExtracting;
|
||||
case Details of
|
||||
fsoddJobAndTarget:
|
||||
Result := Format(rsOperExtractingFromTo, [FWcxArchiveFileSource.ArchiveFileName, TargetPath]);
|
||||
else
|
||||
Result := rsOperExtracting;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWcxArchiveCopyOutOperation.CreateDirsAndCountFiles(
|
||||
|
|
|
|||
25
src/ulng.pas
25
src/ulng.pas
|
|
@ -457,21 +457,46 @@ resourcestring
|
|||
|
||||
// Operations descriptions.
|
||||
rsOperCalculatingCheckSum = 'Calculating check sum';
|
||||
rsOperCalculatingCheckSumIn = 'Calculating check sum in "%s"';
|
||||
rsOperCalculatingCheckSumOf = 'Calculating check sum of "%s"';
|
||||
rsOperCalculatingStatictics = 'Calculating';
|
||||
rsOperCalculatingStatisticsIn = 'Calculating "%s"';
|
||||
rsOperCombining = 'Joining';
|
||||
rsOperCombiningFromTo = 'Joining files in "%s" to "%s"';
|
||||
rsOperCopying = 'Copying';
|
||||
rsOperCopyingFromTo = 'Copying from "%s" to "%s"';
|
||||
rsOperCopyingSomethingTo = 'Copying "%s" to "%s"';
|
||||
rsOperCreatingDirectory = 'Creating directory';
|
||||
rsOperCreatingSomeDirectory = 'Creating directory "%s"';
|
||||
rsOperDeleting = 'Deleting';
|
||||
rsOperDeletingIn = 'Deleting in "%s"';
|
||||
rsOperDeletingSomething = 'Deleting "%s"';
|
||||
rsOperExecuting = 'Executing';
|
||||
rsOperExecutingSomething = 'Executing "%s"';
|
||||
rsOperExtracting = 'Extracting';
|
||||
rsOperExtractingFromTo = 'Extracting from "%s" to "%s"';
|
||||
rsOperListing = 'Listing';
|
||||
rsOperListingIn = 'Listing "%s"';
|
||||
rsOperMoving = 'Moving';
|
||||
rsOperMovingFromTo = 'Moving from "%s" to "%s"';
|
||||
rsOperMovingSomethingTo = 'Moving "%s" to "%s"';
|
||||
rsOperPacking = 'Packing';
|
||||
rsOperPackingFromTo = 'Packing from "%s" to "%s"';
|
||||
rsOperPackingSomethingTo = 'Packing "%s" to "%s"';
|
||||
rsOperSettingProperty = 'Setting property';
|
||||
rsOperSettingPropertyIn = 'Setting property in "%s"';
|
||||
rsOperSettingPropertyOf = 'Setting property of "%s"';
|
||||
rsOperSplitting = 'Splitting';
|
||||
rsOperSplittingFromTo = 'Splitting "%s" to "%s"';
|
||||
rsOperTesting = 'Testing';
|
||||
rsOperTestingSomething = 'Testing "%s"';
|
||||
rsOperTestingIn = 'Testing in "%s"';
|
||||
rsOperVerifyingCheckSum = 'Verifying check sum';
|
||||
rsOperVerifyingCheckSumIn = 'Verifying check sum in "%s"';
|
||||
rsOperVerifyingCheckSumOf = 'Verifying check sum of "%s"';
|
||||
rsOperWiping = 'Wiping';
|
||||
rsOperWipingIn = 'Wiping in "%s"';
|
||||
rsOperWipingSomething = 'Wiping "%s"';
|
||||
rsOperWorking = 'Working'; // Generic description for unknown operation
|
||||
|
||||
// Unhandled error.
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ begin
|
|||
OperationItem^.OperationHandle := OpManItem.Handle;
|
||||
|
||||
OutString := IntToStr(OpManItem.Handle) + ': ' +
|
||||
OpManItem.Operation.GetDescription([fsoddJob]) + ' - ' + GetProgressString(100);
|
||||
OpManItem.Operation.GetDescription(fsoddJob) + ' - ' + GetProgressString(100);
|
||||
SetSize;
|
||||
|
||||
if not TfrmFileOp.IsOpenedFor(OpManItem.Handle) and
|
||||
|
|
@ -214,7 +214,7 @@ begin
|
|||
OperationItem^.OperationHandle := InvalidOperationHandle;
|
||||
|
||||
OutString := rsDlgQueue + ' ' + IntToStr(Queue.Identifier) + ' - ' + GetProgressString(100) +
|
||||
LineEnding + Queue.Items[0].Operation.GetDescription([fsoddJob]);
|
||||
LineEnding + Queue.Items[0].Operation.GetDescription(fsoddJob);
|
||||
SetSize;
|
||||
|
||||
if not TfrmFileOp.IsOpenedFor(Queue.Items[0].Handle) and
|
||||
|
|
@ -424,7 +424,7 @@ begin
|
|||
DrawProgress(OpManItem.Operation.State, AProgress);
|
||||
DrawString(rsDlgQueue + ' ' + IntToStr(Queue.Identifier) + ' - ' +
|
||||
GetProgressString(AProgress) +
|
||||
LineEnding + Queue.Items[0].Operation.GetDescription([fsoddJob]));
|
||||
LineEnding + Queue.Items[0].Operation.GetDescription(fsoddJob));
|
||||
Inc(i);
|
||||
end
|
||||
else
|
||||
|
|
@ -459,7 +459,7 @@ begin
|
|||
AProgress := OpManItem.Operation.Progress;
|
||||
DrawProgress(OpManItem.Operation.State, AProgress);
|
||||
DrawString(IntToStr(OpManItem.Handle) + ': ' +
|
||||
OpManItem.Operation.GetDescription([fsoddJob]) + ' - ' +
|
||||
OpManItem.Operation.GetDescription(fsoddJob) + ' - ' +
|
||||
GetProgressString(AProgress));
|
||||
Inc(i);
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue