View Issue Details

IDProjectCategoryView StatusLast Update
0001470Double CommanderDefaultpublic2020-06-19 21:52
Reporternicker Assigned ToAlexx2000  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
ProjectionnoneETAnone 
Product Version1.0.0 (trunk) 
Target Version0.8.0Fixed in Version0.8.0 
Summary0001470: 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
DescriptionWhen the cursor is at the first row in the file view panel, where the symbol '[..]' is highlighted, use the commands 'cm_CopyNamesToClip' and 'cm_CopyNamesToClip' to copy the working directory to the clipboard.
TagsNo tags attached.
Attached Files
umaincommands.pas.patch (2,551 bytes)   
Index: umaincommands.pas
===================================================================
--- umaincommands.pas	(revision 7002)
+++ umaincommands.pas	(working copy)
@@ -29,7 +29,7 @@
 
 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 @@
    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 @@
      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 @@
 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);
@@ -594,6 +615,8 @@
   PathToAdd, FileNameToAdd: String;
 begin
   SelectedFiles := FileView.CloneSelectedOrActiveFiles;
+  if (SelectedFiles.Count = 0) then
+    TryGetParentDir(FileView, SelectedFiles);
   try
     if SelectedFiles.Count > 0 then
     begin
umaincommands.pas.patch (2,551 bytes)   
Fixed in Revision7064
Operating systemWindows
Widgetset
Architecture64-bit

Activities

nicker

2016-07-23 21:27

reporter   ~0001820

I've added a patch for adding the desired functionality in a non-intrusive manner.

nicker

2016-08-09 14:02

reporter   ~0001830

Any new on this ?

Issue History

Date Modified Username Field Change
2016-07-22 01:05 nicker New Issue
2016-07-23 21:25 nicker File Added: umaincommands.pas.patch
2016-07-23 21:27 nicker Note Added: 0001820
2016-08-09 14:02 nicker Note Added: 0001830
2016-08-09 21:59 Alexx2000 Assigned To => Alexx2000
2016-08-09 21:59 Alexx2000 Status new => assigned
2016-08-21 13:57 Alexx2000 Fixed in Revision => 7064
2016-08-21 13:57 Alexx2000 Status assigned => resolved
2016-08-21 13:57 Alexx2000 Fixed in Version => 0.8.0
2016-08-21 13:57 Alexx2000 Resolution open => fixed
2016-08-21 13:57 Alexx2000 Target Version => 0.8.0
2020-06-19 21:52 Alexx2000 Status resolved => closed