mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Put all selected files to command line on drag&drop files on toolbar button
This commit is contained in:
parent
9b0a78006e
commit
c09eee753b
1 changed files with 16 additions and 7 deletions
|
|
@ -662,7 +662,7 @@ implementation
|
|||
uses
|
||||
LCLIntf, LCLVersion, Dialogs, uGlobs, uLng, fConfigToolBar, uMasks, fCopyMoveDlg, uQuickViewPanel,
|
||||
uShowMsg, fHotDir, uDCUtils, uLog, uGlobsPaths, LCLProc, uOSUtils, uOSForms, uPixMapManager,
|
||||
uDragDropEx, uKeyboard, uFileSystemFileSource, fViewOperations,
|
||||
uDragDropEx, uKeyboard, uFileSystemFileSource, fViewOperations, uMultiListFileSource,
|
||||
uFileSourceOperationTypes, uFileSourceCopyOperation, uFileSourceMoveOperation,
|
||||
fFileOpDlg, uFileSourceProperty, uFileSourceExecuteOperation, uArchiveFileSource,
|
||||
uShellExecute, fSymLink, fHardLink, uExceptions, uUniqueInstance, Clipbrd,
|
||||
|
|
@ -946,7 +946,8 @@ end;
|
|||
procedure TfrmMain.MainToolBarToolButtonDragDrop(Sender, Source: TObject; X,
|
||||
Y: Integer; NumberOfButton: Integer);
|
||||
var
|
||||
aFile: TFile;
|
||||
I: LongWord;
|
||||
SelectedFiles: TFiles = nil;
|
||||
Cmd, Param, Path: string;
|
||||
begin
|
||||
if (ssShift in GetKeyShiftState) then
|
||||
|
|
@ -954,17 +955,25 @@ begin
|
|||
else
|
||||
if Sender is TSpeedButton and not Draging then
|
||||
begin
|
||||
aFile := ActiveFrame.CloneActiveFile;
|
||||
SelectedFiles := ActiveFrame.CloneSelectedFiles;
|
||||
try
|
||||
if Assigned(aFile) and aFile.IsNameValid then
|
||||
if SelectedFiles.Count > 0 then
|
||||
begin
|
||||
Param:= EmptyStr;
|
||||
for I := 0 to SelectedFiles.Count - 1 do
|
||||
begin
|
||||
// Workaround for not fully implemented TMultiListFileSource.
|
||||
if ActiveFrame.FileSource.IsClass(TMultiListFileSource) then
|
||||
Param := Param + QuoteStr(SelectedFiles[I].FullPath) + ' '
|
||||
else
|
||||
Param := Param + QuoteStr(ActiveFrame.CurrentAddress + SelectedFiles[I].FullPath) + ' ';
|
||||
end;
|
||||
Cmd:= MainToolBar.GetButtonX(NumberOfButton, CmdX);
|
||||
Path:= MainToolBar.GetButtonX(NumberOfButton, PathX);
|
||||
Param:= QuoteStr(aFile.FullPath);
|
||||
ExecCmd(Cmd, Param, Path);
|
||||
end;
|
||||
finally
|
||||
FreeAndNil(aFile);
|
||||
FreeAndNil(SelectedFiles);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -4896,4 +4905,4 @@ initialization
|
|||
TFormCommands.RegisterCommandsForm(TfrmMain, HotkeysCategory, @rsHotkeyCategoryMain);
|
||||
|
||||
end.
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue