View Issue Details

IDProjectCategoryView StatusLast Update
0000627Double CommanderLogicpublic2014-10-26 18:16
Reportervitaliyg Assigned ToAlexx2000  
PrioritynormalSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
ProjectionnoneETAnone 
Product Version0.6.0 (trunk) 
Fixed in Version0.5.5 
Summary0000627: [PATCH] Open current dir in new tab if unable to open focused dir
DescriptionI like to use Ctrl+Up key when I need to open new tab.
But when currently focused file is not a dir this command is ignored in DC

(in TC it will always work and open focused dir, or current if there is no focused directory)

Attached patch will update to TC like logic
TagsNo tags attached.
Attached Files
umaincommands.pas.patch (1,579 bytes)   
Index: src/umaincommands.pas
===================================================================
--- src/umaincommands.pas	(revision 5094)
+++ src/umaincommands.pas	(working copy)
@@ -733,27 +733,31 @@
 end;
 
 procedure TMainCommands.cm_OpenDirInNewTab(const Params: array of string);
+  procedure OpenTab(const aFullPath: string);
+  var
+    NewPage: TFileViewPage;
+  begin
+    NewPage := FrmMain.ActiveNotebook.NewPage(FrmMain.ActiveFrame);
+    NewPage.FileView.CurrentPath := aFullPath;
+    if tb_open_new_in_foreground in gDirTabOptions then
+      NewPage.MakeActive;
+  end;
+
 var
-  NewPage: TFileViewPage;
   aFile: TFile;
 begin
-  with FrmMain do
-  begin
-    aFile := ActiveFrame.CloneActiveFile;
-    if Assigned(aFile) then
-    try
-      if aFile.IsNameValid and
-         (aFile.IsDirectory or aFile.IsLinkToDirectory) then
-      begin
-        NewPage := ActiveNotebook.NewPage(ActiveFrame);
-        NewPage.FileView.CurrentPath := aFile.FullPath;
-        if tb_open_new_in_foreground in gDirTabOptions then
-          NewPage.MakeActive;
-      end;
-    finally
-      FreeAndNil(aFile);
-    end;
-  end;
+  aFile := FrmMain.ActiveFrame.CloneActiveFile;
+  if Assigned(aFile) then
+  try
+    if aFile.IsNameValid and (aFile.IsDirectory or aFile.IsLinkToDirectory) then
+      OpenTab(aFile.FullPath)
+    else
+      OpenTab(FrmMain.ActiveFrame.CurrentPath);
+  finally
+    FreeAndNil(aFile);
+  end
+  else
+    OpenTab(FrmMain.ActiveFrame.CurrentPath);
 end;
 
 procedure TMainCommands.cm_TargetEqualSource(const Params: array of string);
umaincommands.pas.patch (1,579 bytes)   
Fixed in Revision
Operating system
Widgetset
Architecture

Activities

Alexx2000

2013-02-10 12:00

administrator   ~0000999

Thanks, added to SVN.

Issue History

Date Modified Username Field Change
2013-02-04 19:34 vitaliyg New Issue
2013-02-04 19:34 vitaliyg File Added: umaincommands.pas.patch
2013-02-10 11:51 Alexx2000 Assigned To => Alexx2000
2013-02-10 11:51 Alexx2000 Status new => assigned
2013-02-10 12:00 Alexx2000 Note Added: 0000999
2013-02-10 12:00 Alexx2000 Status assigned => resolved
2013-02-10 12:00 Alexx2000 Fixed in Version => 0.5.5
2013-02-10 12:00 Alexx2000 Resolution open => fixed
2014-10-26 18:16 Alexx2000 Status resolved => closed