FIX: Files not unselected after copy via drag&drop, bug [0000403].

This commit is contained in:
cobines 2012-04-05 07:07:28 +00:00
commit c4961304d9
2 changed files with 27 additions and 21 deletions

View file

@ -1277,10 +1277,13 @@ begin
ddoMove:
if GetDragDropType = ddtInternal then
begin
Self.MoveFiles(SourcePanel.FileSource,
TargetPanel.FileSource,
Files, TargetPath,
gShowDialogOnDragDrop);
if Self.MoveFiles(SourcePanel.FileSource,
TargetPanel.FileSource,
Files, TargetPath,
gShowDialogOnDragDrop) then
begin
SourcePanel.UnselectAllFiles;
end;
end
else
begin
@ -1293,10 +1296,13 @@ begin
ddoCopy:
if GetDragDropType = ddtInternal then
begin
Self.CopyFiles(SourcePanel.FileSource,
TargetPanel.FileSource,
Files, TargetPath,
gShowDialogOnDragDrop);
if Self.CopyFiles(SourcePanel.FileSource,
TargetPanel.FileSource,
Files, TargetPath,
gShowDialogOnDragDrop) then
begin
SourcePanel.UnselectAllFiles;
end;
end
else
begin
@ -2668,6 +2674,9 @@ begin
try
Result := CopyFiles(ActiveFrame.FileSource, NotActiveFrame.FileSource,
SourceFiles, sDestPath, bShowDialog, QueueIdentifier);
if Result then
ActiveFrame.UnselectAllFiles;
finally
if Assigned(SourceFiles) then
FreeAndNil(SourceFiles);
@ -2688,6 +2697,9 @@ begin
try
Result := MoveFiles(ActiveFrame.FileSource, NotActiveFrame.FileSource,
SourceFiles, sDestPath, bShowDialog, QueueIdentifier);
if Result then
ActiveFrame.UnselectAllFiles;
finally
if Assigned(SourceFiles) then
FreeAndNil(SourceFiles);
@ -4788,4 +4800,4 @@ initialization
TFormCommands.RegisterCommandsForm(TfrmMain, HotkeysCategory, @rsHotkeyCategoryMain);
end.

View file

@ -1304,18 +1304,15 @@ end;
// <queue_identifier>
procedure TMainCommands.cm_Copy(const Params: array of string);
var
bConfirmation, HasQueueId, CopyResult: Boolean;
bConfirmation, HasQueueId: Boolean;
QueueIdentifier: TOperationsManagerQueueIdentifier;
begin
ReadCopyRenameParams(Params, bConfirmation, HasQueueId, QueueIdentifier);
if HasQueueId then
CopyResult := frmMain.CopyFiles(frmMain.NotActiveFrame.CurrentPath, bConfirmation, QueueIdentifier)
frmMain.CopyFiles(frmMain.NotActiveFrame.CurrentPath, bConfirmation, QueueIdentifier)
else
CopyResult := frmMain.CopyFiles(frmMain.NotActiveFrame.CurrentPath, bConfirmation);
if CopyResult then
frmMain.ActiveFrame.UnselectAllFiles;
frmMain.CopyFiles(frmMain.NotActiveFrame.CurrentPath, bConfirmation);
end;
procedure TMainCommands.cm_CopyNoAsk(const Params: array of string);
@ -1332,18 +1329,15 @@ end;
// <queue_identifier>
procedure TMainCommands.cm_Rename(const Params: array of string);
var
bConfirmation, HasQueueId, MoveResult: Boolean;
bConfirmation, HasQueueId: Boolean;
QueueIdentifier: TOperationsManagerQueueIdentifier;
begin
ReadCopyRenameParams(Params, bConfirmation, HasQueueId, QueueIdentifier);
if HasQueueId then
MoveResult := frmMain.MoveFiles(frmMain.NotActiveFrame.CurrentPath, bConfirmation, QueueIdentifier)
frmMain.MoveFiles(frmMain.NotActiveFrame.CurrentPath, bConfirmation, QueueIdentifier)
else
MoveResult := frmMain.MoveFiles(frmMain.NotActiveFrame.CurrentPath, bConfirmation);
if MoveResult then
frmMain.ActiveFrame.UnselectAllFiles;
frmMain.MoveFiles(frmMain.NotActiveFrame.CurrentPath, bConfirmation);
end;
procedure TMainCommands.cm_RenameNoAsk(const Params: array of string);