View Issue Details

IDProjectCategoryView StatusLast Update
0000989Double CommanderGraphical user interfacepublic2019-06-08 15:26
Reporterholger Assigned ToAlexx2000  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
ProjectionnoneETAnone 
Product Version0.6.0 (trunk) 
Target Version0.6.0Fixed in Version0.6.0 
Summary0000989: View files in syncdirs
DescriptionHello Alex,
I absolutely like your new command syncdirs.
When I compare directories, I often want to see the file on the left or on the right side. I added a popup menu which contains these functions. In addition I wanted to use a user defined compare-tool, same as the compare in general DC. This is also added.

A patch for these functions is included.
TagsNo tags attached.
Attached Files
fsyncdirsdlg.patch (15,738 bytes)   
Index: fsyncdirsdlg.lfm
===================================================================
--- fsyncdirsdlg.lfm	(revision 5790)
+++ fsyncdirsdlg.lfm	(working copy)
@@ -13,15 +13,15 @@
   Position = poScreenCenter
   SessionProperties = 'Height;Left;Top;Width;WindowState'
   ShowInTaskBar = stAlways
-  LCLVersion = '1.3'
+  LCLVersion = '1.2.6.0'
   object edPath1: TEdit
     AnchorSideLeft.Control = Owner
     AnchorSideTop.Control = Owner
     AnchorSideRight.Control = btnSelDir1
     Left = 3
-    Height = 21
+    Height = 28
     Top = 3
-    Width = 236
+    Width = 232
     Anchors = [akTop, akLeft, akRight]
     BorderSpacing.Around = 3
     TabOrder = 1
@@ -32,9 +32,9 @@
     AnchorSideTop.Control = Owner
     AnchorSideRight.Control = btnSelDir2
     Left = 407
-    Height = 21
+    Height = 28
     Top = 3
-    Width = 233
+    Width = 229
     Anchors = [akTop, akLeft, akRight]
     BorderSpacing.Left = 3
     BorderSpacing.Around = 3
@@ -45,11 +45,11 @@
     AnchorSideLeft.Side = asrCenter
     AnchorSideTop.Control = Owner
     Left = 290
-    Height = 21
+    Height = 28
     Top = 3
     Width = 111
     BorderSpacing.Top = 3
-    ItemHeight = 13
+    ItemHeight = 20
     ItemIndex = 0
     Items.Strings = (
       '*.*'
@@ -61,10 +61,10 @@
     AnchorSideTop.Control = edPath1
     AnchorSideTop.Side = asrCenter
     AnchorSideRight.Control = cbExtFilter
-    Left = 242
-    Height = 23
+    Left = 238
+    Height = 30
     Top = 2
-    Width = 42
+    Width = 46
     Anchors = [akTop, akRight]
     AutoSize = True
     BorderSpacing.Right = 3
@@ -79,10 +79,10 @@
     AnchorSideTop.Side = asrCenter
     AnchorSideRight.Control = Owner
     AnchorSideRight.Side = asrBottom
-    Left = 643
-    Height = 23
+    Left = 639
+    Height = 30
     Top = 2
-    Width = 42
+    Width = 46
     Anchors = [akTop, akRight]
     AutoSize = True
     BorderSpacing.Right = 3
@@ -98,12 +98,12 @@
     AnchorSideRight.Control = Owner
     AnchorSideRight.Side = asrBottom
     Left = 0
-    Height = 70
-    Top = 28
+    Height = 98
+    Top = 35
     Width = 691
     Anchors = [akTop, akLeft, akRight]
     AutoSize = True
-    ClientHeight = 70
+    ClientHeight = 98
     ClientWidth = 691
     TabOrder = 5
     object LeftPanel1: TPanel
@@ -110,21 +110,21 @@
       AnchorSideLeft.Control = TopPanel
       AnchorSideTop.Control = TopPanel
       Left = 1
-      Height = 62
+      Height = 83
       Top = 1
-      Width = 89
+      Width = 117
       AutoSize = True
       BevelOuter = bvNone
-      ClientHeight = 62
-      ClientWidth = 89
+      ClientHeight = 83
+      ClientWidth = 117
       TabOrder = 0
       object btnCompare: TButton
         AnchorSideLeft.Control = LeftPanel1
         AnchorSideTop.Control = LeftPanel1
         Left = 3
-        Height = 23
+        Height = 30
         Top = 3
-        Width = 69
+        Width = 87
         AutoSize = True
         BorderSpacing.Around = 3
         Caption = 'Compare'
@@ -137,9 +137,9 @@
         AnchorSideTop.Control = btnCompare
         AnchorSideTop.Side = asrBottom
         Left = 3
-        Height = 17
-        Top = 29
-        Width = 83
+        Height = 24
+        Top = 36
+        Width = 111
         BorderSpacing.Around = 3
         Caption = 'only selected'
         Enabled = False
@@ -150,10 +150,10 @@
         AnchorSideLeft.Side = asrCenter
         AnchorSideTop.Control = chkOnlySelected
         AnchorSideTop.Side = asrBottom
-        Left = 4
-        Height = 13
-        Top = 49
-        Width = 80
+        Left = 1
+        Height = 20
+        Top = 63
+        Width = 115
         Caption = '(in main window)'
         Enabled = False
         ParentColor = False
@@ -163,23 +163,23 @@
       AnchorSideLeft.Control = LeftPanel1
       AnchorSideLeft.Side = asrBottom
       AnchorSideTop.Control = TopPanel
-      Left = 95
-      Height = 68
+      Left = 123
+      Height = 96
       Top = 1
-      Width = 75
+      Width = 101
       AutoSize = True
       BorderSpacing.Left = 5
       BevelOuter = bvNone
-      ClientHeight = 68
-      ClientWidth = 75
+      ClientHeight = 96
+      ClientWidth = 101
       TabOrder = 1
       object chkAsymmetric: TCheckBox
         AnchorSideLeft.Control = LeftPanel2
         AnchorSideTop.Control = LeftPanel2
         Left = 0
-        Height = 17
+        Height = 24
         Top = 0
-        Width = 74
+        Width = 100
         Caption = 'asymmetric'
         Enabled = False
         TabOrder = 0
@@ -189,9 +189,9 @@
         AnchorSideTop.Control = chkAsymmetric
         AnchorSideTop.Side = asrBottom
         Left = 0
-        Height = 17
-        Top = 17
-        Width = 55
+        Height = 24
+        Top = 24
+        Width = 73
         Caption = 'Subdirs'
         TabOrder = 1
       end
@@ -200,9 +200,9 @@
         AnchorSideTop.Control = chkSubDirs
         AnchorSideTop.Side = asrBottom
         Left = 0
-        Height = 17
-        Top = 34
-        Width = 72
+        Height = 24
+        Top = 48
+        Width = 94
         Caption = 'by content'
         TabOrder = 2
       end
@@ -211,9 +211,9 @@
         AnchorSideTop.Control = chkByContent
         AnchorSideTop.Side = asrBottom
         Left = 0
-        Height = 17
-        Top = 51
-        Width = 75
+        Height = 24
+        Top = 72
+        Width = 101
         Caption = 'ignore date'
         TabOrder = 3
       end
@@ -222,8 +222,8 @@
       AnchorSideLeft.Control = LeftPanel2
       AnchorSideLeft.Side = asrBottom
       AnchorSideTop.Control = TopPanel
-      Left = 175
-      Height = 63
+      Left = 229
+      Height = 67
       Top = 1
       Width = 202
       AutoSize = True
@@ -331,10 +331,10 @@
       AnchorSideTop.Control = TopPanel
       AnchorSideRight.Control = TopPanel
       AnchorSideRight.Side = asrBottom
-      Left = 600
-      Height = 23
+      Left = 579
+      Height = 30
       Top = 7
-      Width = 84
+      Width = 105
       Anchors = [akTop, akRight]
       AutoSize = True
       BorderSpacing.Around = 6
@@ -349,10 +349,10 @@
       AnchorSideTop.Side = asrBottom
       AnchorSideRight.Control = btnSynchronize
       AnchorSideRight.Side = asrBottom
-      Left = 600
-      Height = 23
-      Top = 36
-      Width = 84
+      Left = 579
+      Height = 30
+      Top = 43
+      Width = 105
       Anchors = [akTop, akLeft, akRight]
       AutoSize = True
       Cancel = True
@@ -363,8 +363,8 @@
   end
   object StatusBar1: TStatusBar
     Left = 0
-    Height = 20
-    Top = 418
+    Height = 28
+    Top = 410
     Width = 691
     Panels = <    
       item
@@ -381,7 +381,7 @@
     AnchorSideRight.Side = asrBottom
     Left = 0
     Height = 20
-    Top = 98
+    Top = 133
     Width = 691
     Anchors = [akTop, akLeft, akRight]
     AutoFillColumns = True
@@ -391,17 +391,17 @@
       item
         SizePriority = 0
         Title.Caption = 'Name'
-        Width = 100
+        Width = 250
       end    
       item
         SizePriority = 0
         Title.Caption = 'Size'
-        Width = 60
+        Width = 150
       end    
       item
         SizePriority = 0
         Title.Caption = 'Date'
-        Width = 130
+        Width = 170
       end    
       item
         SizePriority = 0
@@ -411,16 +411,16 @@
       item
         SizePriority = 0
         Title.Caption = 'Date'
-        Width = 130
+        Width = 170
       end    
       item
         SizePriority = 0
         Title.Caption = 'Size'
-        Width = 60
+        Width = 120
       end    
       item
         Title.Caption = 'Name'
-        Width = 181
+        Width = 0
       end>
     ExtendedSelect = False
     FixedCols = 0
@@ -431,13 +431,13 @@
     OnHeaderClick = HeaderDGHeaderClick
     OnHeaderSizing = HeaderDGHeaderSizing
     ColWidths = (
-      100
-      60
-      130
+      250
+      150
+      170
       30
-      130
-      60
-      181
+      170
+      120
+      0
     )
   end
   object MainDrawGrid: TDrawGrid
@@ -448,8 +448,8 @@
     AnchorSideRight.Side = asrBottom
     AnchorSideBottom.Control = StatusBar1
     Left = 0
-    Height = 300
-    Top = 118
+    Height = 257
+    Top = 153
     Width = 691
     Anchors = [akTop, akLeft, akRight, akBottom]
     AutoFillColumns = True
@@ -459,6 +459,7 @@
     FixedRows = 0
     MouseWheelOption = mwGrid
     Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goSmoothScroll, goHeaderPushedLook, goDontScrollPartCell]
+    PopupMenu = PopupMenu1
     RowCount = 0
     ScrollBars = ssAutoVertical
     TabOrder = 8
@@ -665,4 +666,23 @@
       C3FFC3C3C3FFC3C3C3FFC3C3C3FF
     }
   end
+  object PopupMenu1: TPopupMenu
+    left = 121
+    top = 217
+    object MenuItemViewLeft: TMenuItem
+      Caption = 'View left'
+      ShortCut = 114
+      OnClick = MenuItemViewLeftClick
+    end
+    object MenuItemViewRight: TMenuItem
+      Caption = 'View right'
+      ShortCut = 8306
+      OnClick = MenuItemViewRightClick
+    end
+    object MenuItemCompare: TMenuItem
+      Caption = 'Compare'
+      ShortCut = 16498
+      OnClick = MainDrawGridDblClick
+    end
+  end
 end
Index: fsyncdirsdlg.lrt
===================================================================
--- fsyncdirsdlg.lrt	(revision 5790)
+++ fsyncdirsdlg.lrt	(working copy)
@@ -26,3 +26,6 @@
 TFRMSYNCDIRSDLG.HEADERDG.COLUMNS[4].TITLE.CAPTION=Date
 TFRMSYNCDIRSDLG.HEADERDG.COLUMNS[5].TITLE.CAPTION=Size
 TFRMSYNCDIRSDLG.HEADERDG.COLUMNS[6].TITLE.CAPTION=Name
+TFRMSYNCDIRSDLG.MENUITEMVIEWLEFT.CAPTION=View left
+TFRMSYNCDIRSDLG.MENUITEMVIEWRIGHT.CAPTION=View right
+TFRMSYNCDIRSDLG.MENUITEMCOMPARE.CAPTION=Compare
Index: fsyncdirsdlg.pas
===================================================================
--- fsyncdirsdlg.pas	(revision 5790)
+++ fsyncdirsdlg.pas	(working copy)
@@ -30,7 +30,7 @@
 
 uses
   Classes, SysUtils, FileUtil, Masks, Forms, Controls, Graphics, Dialogs,
-  StdCtrls, ExtCtrls, Buttons, ComCtrls, Grids, uFileView, uFileSource,
+  StdCtrls, ExtCtrls, Buttons, ComCtrls, Grids, Menus, uFileView, uFileSource,
   uFileSourceCopyOperation, uFile, uFileSourceOperationMessageBoxesUI;
 
 type
@@ -58,6 +58,10 @@
     Label1: TLabel;
     LeftPanel1: TPanel;
     LeftPanel2: TPanel;
+    MenuItemCompare: TMenuItem;
+    MenuItemViewRight: TMenuItem;
+    MenuItemViewLeft: TMenuItem;
+    PopupMenu1: TPopupMenu;
     sbCopyRight: TSpeedButton;
     sbEqual: TSpeedButton;
     sbNotEqual: TSpeedButton;
@@ -83,6 +87,8 @@
     procedure HeaderDGHeaderSizing(sender: TObject; const IsColumn: boolean;
       const aIndex, aSize: Integer);
     procedure FilterSpeedButtonClick(Sender: TObject);
+    procedure MenuItemViewLeftClick(Sender: TObject);
+    procedure MenuItemViewRightClick(Sender: TObject);
   private
     { private declarations }
     FCancel: Boolean;
@@ -130,7 +136,8 @@
 uses
   fMain, uDebug, fDiffer, fSyncDirsPerformDlg, uGlobs, LCLType, LazUTF8,
   DCClassesUtf8, uFileSystemFileSource, uFileSourceOperationOptions, DCDateTimeUtils,
-  uFileSourceOperation, uDCUtils, uFileSourceUtil, uFileSourceOperationTypes;
+  uFileSourceOperation, uDCUtils, uFileSourceUtil, uFileSourceOperationTypes,
+  fViewer, uMainCommands;
 
 {$R *.lfm}
 
@@ -558,6 +565,7 @@
 var
   r: Integer;
   sr: TFileSyncRec;
+  sl:TStringList;
 begin
   r := MainDrawGrid.Row;
   if (r < 0) or (r >= FVisibleItems.Count) then Exit;
@@ -566,7 +574,19 @@
   or not Assigned(sr.FFileR) or not Assigned(sr.FFileL) or (sr.FState = srsEqual)
   then
     Exit;
-  ShowDiffer(sr.FFileL.FullPath, sr.FFileR.FullPath);
+  if gExternalTools[etDiffer].Enabled then
+    begin
+      sl:=TStringList.Create;
+      try
+        sl.add(sr.FFileL.FullPath);
+        sl.add(sr.FFileR.FullPath);
+        RunExtDiffer(sl);
+      finally
+        sl.free;
+      end;
+    end
+  else
+    ShowDiffer(sr.FFileL.FullPath, sr.FFileR.FullPath);
 end;
 
 procedure TfrmSyncDirsDlg.MainDrawGridDrawCell(Sender: TObject; aCol,
@@ -694,6 +714,49 @@
   FillFoundItemsDG
 end;
 
+
+procedure TfrmSyncDirsDlg.MenuItemViewLeftClick(Sender: TObject);
+var
+  r: Integer;
+  sr: TFileSyncRec;
+  sl:TStringList;
+begin
+  r := MainDrawGrid.Row;
+  if (r < 0) or (r >= FVisibleItems.Count) then Exit;
+  sr := TFileSyncRec(FVisibleItems.Objects[r]);
+  if not Assigned(sr) or not Assigned(sr.FFileL) then
+    Exit;
+
+  sl:=TStringList.Create;
+  try
+    sl.add(sr.FFileL.FullPath);
+    ShowViewer(sl);
+  finally
+    sl.free;
+  end;
+end;
+
+procedure TfrmSyncDirsDlg.MenuItemViewRightClick(Sender: TObject);
+var
+  r: Integer;
+  sr: TFileSyncRec;
+  sl:TStringList;
+begin
+  r := MainDrawGrid.Row;
+  if (r < 0) or (r >= FVisibleItems.Count) then Exit;
+  sr := TFileSyncRec(FVisibleItems.Objects[r]);
+  if not Assigned(sr) or not Assigned(sr.FFileR) then
+    Exit;
+
+  sl:=TStringList.Create;
+  try
+    sl.add(sr.FFileR.FullPath);
+    ShowViewer(sl);
+  finally
+    sl.free;
+  end;
+end;
+
 procedure TfrmSyncDirsDlg.SetSortIndex(AValue: Integer);
 var
   s: string;
Index: umaincommands.pas
===================================================================
--- umaincommands.pas	(revision 5790)
+++ umaincommands.pas	(working copy)
@@ -236,6 +236,8 @@
    procedure cm_ExecuteToolbarItem(const Params: array of string);
   end;
 
+  procedure RunExtDiffer(CompareList: TStringList);
+
 implementation
 
 uses Forms, Controls, Dialogs, Clipbrd, strutils, LCLProc, HelpIntfs, StringHashList,
@@ -2027,6 +2029,29 @@
   ShowOptions(GetDefaultParam(Params));
 end;
 
+procedure RunExtDiffer(CompareList: TStringList);
+var
+  i : Integer;
+  sCommand: String;
+begin
+  with gExternalTools[etDiffer] do
+  begin
+    sCommand := QuoteStr(ReplaceEnvVars(Path));
+    if Parameters <> EmptyStr then
+      sCommand := sCommand + ' ' + Parameters;
+    for i := 0 to CompareList.Count - 1 do
+      sCommand := sCommand + ' ' + QuoteStr(CompareList.Strings[i]);
+    try
+      ExecCmdFork(sCommand, RunInTerminal, '', KeepTerminalOpen);
+    except
+      on e: EInvalidCommandLine do
+        MessageDlg(rsToolErrorOpeningDiffer,
+          rsMsgInvalidCommandLine + ' (' + rsToolDiffer + '):' + LineEnding + e.Message,
+          mtError, [mbOK], 0);
+    end;
+  end;
+end;
+
 procedure TMainCommands.cm_CompareContents(const Params: array of string);
 var
   FilesToCompare: TStringList = nil;
@@ -2040,29 +2065,6 @@
       DirsToCompare.Add(aFile.FullPath);
   end;
 
-  procedure RunExtDiffer(CompareList: TStringList);
-  var
-    i : Integer;
-    sCommand: String;
-  begin
-    with gExternalTools[etDiffer] do
-    begin
-      sCommand := QuoteStr(ReplaceEnvVars(Path));
-      if Parameters <> EmptyStr then
-        sCommand := sCommand + ' ' + Parameters;
-      for i := 0 to CompareList.Count - 1 do
-        sCommand := sCommand + ' ' + QuoteStr(CompareList.Strings[i]);
-      try
-        ExecCmdFork(sCommand, RunInTerminal, '', KeepTerminalOpen);
-      except
-        on e: EInvalidCommandLine do
-          MessageDlg(rsToolErrorOpeningDiffer,
-            rsMsgInvalidCommandLine + ' (' + rsToolDiffer + '):' + LineEnding + e.Message,
-            mtError, [mbOK], 0);
-      end;
-    end;
-  end;
-
 var
   i : Integer;
   ActiveSelectedFiles: TFiles = nil;
fsyncdirsdlg.patch (15,738 bytes)   
Fixed in Revision5810, 5820
Operating system
Widgetset
Architecture

Activities

Issue History

Date Modified Username Field Change
2015-01-16 15:59 holger New Issue
2015-01-16 15:59 holger File Added: fsyncdirsdlg.patch
2015-01-22 07:20 Alexx2000 Assigned To => Alexx2000
2015-01-22 07:20 Alexx2000 Status new => assigned
2015-01-22 18:39 Alexx2000 Fixed in Revision => 5810
2015-01-22 18:39 Alexx2000 Status assigned => resolved
2015-01-22 18:39 Alexx2000 Resolution open => fixed
2015-01-24 22:59 Alexx2000 Fixed in Revision 5810 => 5810, 5820
2015-01-24 22:59 Alexx2000 Fixed in Version => 0.6.0
2015-01-24 22:59 Alexx2000 Target Version => 0.6.0
2019-06-08 15:26 Alexx2000 Status resolved => closed