FIX: the issue of incorrect path Auto Complete in the Copy/Move Dialog

This commit is contained in:
rich2014 2026-05-30 22:21:48 +08:00
commit a588ff1c95
2 changed files with 16 additions and 6 deletions

View file

@ -77,6 +77,7 @@ type
FDialogType: TCopyMoveDlgType;
noteb: TFileViewNotebook;
FFileSource: IFileSource;
FDestFileSource: IFileSource;
FOperationOptionsUIClass: TFileSourceOperationOptionsUIClass;
FOperationOptionsUI: TFileSourceOperationOptionsUI;
FCurrentCopyDlgNameSelectionStep: TCurrentCopyDlgNameSelectionStep;
@ -94,7 +95,7 @@ type
public
constructor Create(TheOwner: TComponent; DialogType: TCopyMoveDlgType;
AFileSource: IFileSource;
AFileSource: IFileSource; ADestFileSource: IFileSource;
AOperationOptionsUIClass: TFileSourceOperationOptionsUIClass); reintroduce;
constructor Create(TheOwner: TComponent); override;
procedure SetOperationOptions(Operation: TFileSourceOperation);
@ -112,7 +113,8 @@ implementation
{$R *.lfm}
uses
LazUTF8, fMain, LCLType, LCLVersion, uGlobs, uLng, uHotkeyManager, DCStrUtils;
LazUTF8, fMain, LCLType, LCLVersion, uGlobs, uLng, uHotkeyManager,
DCOSUtils, DCStrUtils;
const
HotkeysCategory = 'Copy/Move Dialog';
@ -121,11 +123,12 @@ var
FQueueIdentifier: TOperationsManagerQueueIdentifier = SingleQueueId;
constructor TfrmCopyDlg.Create(TheOwner: TComponent; DialogType: TCopyMoveDlgType;
AFileSource: IFileSource;
AFileSource: IFileSource; ADestFileSource: IFileSource;
AOperationOptionsUIClass: TFileSourceOperationOptionsUIClass);
begin
FDialogType := DialogType;
FFileSource := AFileSource;
FDestFileSource := ADestFileSource;
FOperationOptionsUIClass := AOperationOptionsUIClass;
FCommands := TFormCommands.Create(Self);
inherited Create(TheOwner);
@ -133,7 +136,7 @@ end;
constructor TfrmCopyDlg.Create(TheOwner: TComponent);
begin
Create(TheOwner, cmdtCopy, nil, nil);
Create(TheOwner, cmdtCopy, nil, nil, nil);
end;
procedure TfrmCopyDlg.SetOperationOptions(Operation: TFileSourceOperation);
@ -458,6 +461,11 @@ begin
if Assigned(Hotkey) then
btnAddToQueue.Caption := btnAddToQueue.Caption + ' (' + ShortcutsToText(Hotkey.Shortcuts) + ')';
if FDestFileSource.ClassName = 'TFileSystemFileSource' then
edtDst.GetFilesFunc:= @GetFilesInDir
else
edtDst.GetFilesFunc:= nil;
end;
procedure TfrmCopyDlg.FormDestroy(Sender: TObject);

View file

@ -3723,7 +3723,8 @@ begin
if Assigned(OperationClass) then
OperationOptionsUIClass := OperationClass.GetOptionsUIClass;
CopyDialog := TfrmCopyDlg.Create(Self, cmdtCopy, params.resultFS, OperationOptionsUIClass);
CopyDialog := TfrmCopyDlg.Create(
Self, cmdtCopy, params.resultFS, params.targetFS, OperationOptionsUIClass);
CopyDialog.edtDst.Text := params.targetPath;
CopyDialog.edtDst.ReadOnly := params.operationTemp;
CopyDialog.lblCopySrc.Caption := GetFileDlgStr(rsMsgCpSel, rsMsgCpFlDr, SourceFiles);
@ -3920,7 +3921,8 @@ begin
if bShowDialog then
begin
MoveDialog := TfrmCopyDlg.Create(Self, cmdtMove, SourceFileSource,
MoveDialog := TfrmCopyDlg.Create(
Self, cmdtMove, SourceFileSource, TargetFileSource,
SourceFileSource.GetOperationClass(fsoMove).GetOptionsUIClass);
MoveDialog.edtDst.Text := params.targetPath;
MoveDialog.lblCopySrc.Caption := GetFileDlgStr(rsMsgRenSel, rsMsgRenFlDr, SourceFiles);