mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Feature [0001470] Add an option to copy the working directory name to the clipboard where the cursor is at the first row in the file view panel
This commit is contained in:
parent
7fd07e716c
commit
b912efa2a4
1 changed files with 25 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ interface
|
|||
|
||||
uses
|
||||
Classes, SysUtils, ActnList, uFileView, uFileViewNotebook, uFileSourceOperation,
|
||||
uGlobs, uFileFunctions, uFormCommands, uFileSorting, uShellContextMenu, Menus, ufavoritetabs;
|
||||
uGlobs, uFileFunctions, uFormCommands, uFileSorting, uShellContextMenu, Menus, ufavoritetabs,ufile;
|
||||
|
||||
type
|
||||
|
||||
|
|
@ -45,6 +45,9 @@ type
|
|||
FCommands: TFormCommands;
|
||||
FOriginalNumberOfTabs: integer;
|
||||
|
||||
// Helper routines
|
||||
procedure TryGetParentDir(FileView: TFileView; var SelectedFiles: TFiles);
|
||||
|
||||
// Filters out commands.
|
||||
function CommandsFilter(Command: String): Boolean;
|
||||
procedure OnCopyOutStateChanged(Operation: TFileSourceOperation;
|
||||
|
|
@ -346,7 +349,7 @@ uses Forms, Controls, Dialogs, Clipbrd, strutils, LCLProc, HelpIntfs, StringHash
|
|||
fLinker, fSplitter, fDescrEdit, fCheckSumVerify, fCheckSumCalc, fSetFileProperties,
|
||||
uLng, uLog, uShowMsg, uOSForms, uOSUtils, uDCUtils, uBriefFileView,
|
||||
uShowForm, uShellExecute, uClipboard, uHash, uDisplayFile,
|
||||
uFilePanelSelect, uFile, uFileSystemFileSource, uQuickViewPanel,
|
||||
uFilePanelSelect, uFileSystemFileSource, uQuickViewPanel,
|
||||
uOperationsManager, uFileSourceOperationTypes, uWfxPluginFileSource,
|
||||
uFileSystemDeleteOperation, uFileSourceExecuteOperation, uSearchResultFileSource,
|
||||
uFileSourceOperationMessageBoxesUI, uFileSourceCalcChecksumOperation,
|
||||
|
|
@ -404,6 +407,24 @@ begin
|
|||
end;
|
||||
|
||||
//------------------------------------------------------
|
||||
procedure TMainCommands.TryGetParentDir(FileView: TFileView; var SelectedFiles: TFiles);
|
||||
var
|
||||
activeFile : TFile;
|
||||
tempPath : String;
|
||||
begin
|
||||
activeFile := FileView.CloneActiveFile;
|
||||
if assigned(activeFile) then begin
|
||||
if activeFile.Name = '..' then
|
||||
begin
|
||||
tempPath := activeFile.FullPath;
|
||||
activeFile.Name := ExtractFileName(ExcludeTrailingPathDelimiter(activeFile.Path));
|
||||
activeFile.Path := ExpandFileName(tempPath);
|
||||
SelectedFiles.Add(activeFile);
|
||||
end
|
||||
else
|
||||
FreeAndNil(activeFile);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainCommands.OnCopyOutStateChanged(Operation: TFileSourceOperation;
|
||||
State: TFileSourceOperationState);
|
||||
|
|
@ -597,6 +618,8 @@ var
|
|||
PathToAdd, FileNameToAdd: String;
|
||||
begin
|
||||
SelectedFiles := FileView.CloneSelectedOrActiveFiles;
|
||||
if (SelectedFiles.Count = 0) then
|
||||
TryGetParentDir(FileView, SelectedFiles);
|
||||
try
|
||||
if SelectedFiles.Count > 0 then
|
||||
begin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue