mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Feature [0002306] Notification about the end of a long running operation (step 2)
(cherry picked from commit fefa77a1b0)
This commit is contained in:
parent
112631e160
commit
56e640281c
2 changed files with 16 additions and 6 deletions
|
|
@ -38,7 +38,7 @@ procedure ShowOperationModal(OpManItem: TOperationsManagerItem);
|
|||
implementation
|
||||
|
||||
uses
|
||||
fFileOpDlg, uFileSourceOperationTypes, uGlobs, uPlaySound;
|
||||
DateUtils, fFileOpDlg, uFileSourceOperationTypes, uGlobs, uPlaySound;
|
||||
|
||||
function GetOperationStateString(OperationState: TFileSourceOperationState): String;
|
||||
begin
|
||||
|
|
@ -57,12 +57,15 @@ procedure PlaySound(OpManItem: TOperationsManagerItem);
|
|||
var
|
||||
FileName: String;
|
||||
begin
|
||||
if OpManItem.Operation.ID in [fsoCopy, fsoCopyIn, fsoCopyOut] then
|
||||
FileName:= gFileOperationsSounds[fsoCopy]
|
||||
else begin
|
||||
FileName:= gFileOperationsSounds[OpManItem.Operation.ID];
|
||||
if (gFileOperationDuration <= 0) or (SecondsBetween(Now, OpManItem.Operation.StartTime) >= gFileOperationDuration) then
|
||||
begin
|
||||
if OpManItem.Operation.ID in [fsoCopy, fsoCopyIn, fsoCopyOut] then
|
||||
FileName:= gFileOperationsSounds[fsoCopy]
|
||||
else begin
|
||||
FileName:= gFileOperationsSounds[OpManItem.Operation.ID];
|
||||
end;
|
||||
if (Length(FileName) > 0) then uPlaySound.PlaySound(FileName);
|
||||
end;
|
||||
if (Length(FileName) > 0) then uPlaySound.PlaySound(FileName);
|
||||
end;
|
||||
|
||||
procedure ShowOperation(OpManItem: TOperationsManagerItem);
|
||||
|
|
|
|||
|
|
@ -493,6 +493,7 @@ var
|
|||
gFileOperationsProgressKind: TFileOperationsProgressKind;
|
||||
gFileOperationsConfirmations: TFileOperationsConfirmations;
|
||||
gFileOperationsSounds: array[TFileSourceOperationType] of String;
|
||||
gFileOperationDuration: Integer;
|
||||
|
||||
{ Multi-Rename}
|
||||
gMulRenShowMenuBarOnTop : boolean;
|
||||
|
|
@ -1932,6 +1933,7 @@ begin
|
|||
gAutoExtractOpenMask := EmptyStr;
|
||||
gFileOperationsProgressKind := fopkSeparateWindow;
|
||||
gFileOperationsConfirmations := [focCopy, focMove, focDelete, focDeleteToTrash];
|
||||
gFileOperationDuration := 10;
|
||||
|
||||
{ Multi-Rename }
|
||||
gMulRenShowMenuBarOnTop := True;
|
||||
|
|
@ -2895,8 +2897,13 @@ begin
|
|||
SubNode := Node.FindNode('Sounds');
|
||||
if Assigned(SubNode) then
|
||||
begin
|
||||
gFileOperationDuration:= GetAttr(SubNode, 'Duration', gFileOperationDuration);
|
||||
gFileOperationsSounds[fsoCopy]:= GetValue(SubNode, 'Copy', EmptyStr);
|
||||
gFileOperationsSounds[fsoMove]:= GetValue(SubNode, 'Move', EmptyStr);
|
||||
gFileOperationsSounds[fsoWipe]:= GetValue(SubNode, 'Wipe', EmptyStr);
|
||||
gFileOperationsSounds[fsoDelete]:= GetValue(SubNode, 'Delete', EmptyStr);
|
||||
gFileOperationsSounds[fsoSplit]:= GetValue(SubNode, 'Split', EmptyStr);
|
||||
gFileOperationsSounds[fsoCombine]:= GetValue(SubNode, 'Combine', EmptyStr);
|
||||
end;
|
||||
// Operations options
|
||||
SubNode := Node.FindNode('Options');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue