View Issue Details

IDProjectCategoryView StatusLast Update
0002357Double CommanderGraphical user interfacepublic2021-10-29 23:21
Reporterliquidvacuum Assigned ToAlexx2000  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
ProjectionnoneETAnone 
Target Version1.0.0Fixed in Version1.0.0 
Summary0002357: Add delete actions is Syncronize directories dialog
DescriptionНеобходимо добавить действия "Удалить слева" и "Удалить с обоих сторон" в диалоге "Синхронизировать каталоги" в режиме неассиметричного сравнения.
Патч приложен.

There is need to add the actions "Delete left" and "Delete both" in the "Synchronize directories" dialog in the non-asymmetric comparison mode.
Patch attached.
TagsNo tags attached.
Attached Files
01-sync-delete.diff (20,574 bytes)   
diff --git a/doublecmd-0.9.6.orig/language/doublecmd.be.po b/doublecmd-0.9.6/language/doublecmd.be.po
index 82e6c52..47035da 100644
--- a/doublecmd-0.9.6.orig/language/doublecmd.be.po
+++ b/doublecmd-0.9.6/language/doublecmd.be.po
@@ -15,6 +15,10 @@ msgstr ""
 msgid "Comparing... %d%% (ESC to cancel)"
 msgstr "���������... �d%% (ESC ��� �������)"

+#: fsyncdirsdlg.rsdeleteleft
+msgid "Right: Delete %d file(s)"
+msgstr "����: ����� %d ����(�)"
+
 #: fsyncdirsdlg.rsdeleteright
 msgid "Right: Delete %d file(s)"
 msgstr "�����: ����� %d ����(�)"
@@ -8401,9 +8405,17 @@ msgstr ""
 msgid "Select for copying <- (right to left)"
 msgstr ""

+#: tfrmsyncdirsdlg.actselectdeleteleft.caption
+msgid "Select for deleting <- (left)"
+msgstr "���� �� ������� <- (�����)"
+
 #: tfrmsyncdirsdlg.actselectdeleteright.caption
 msgid "Select for deleting -> (right)"
-msgstr ""
+msgstr "���� �� ������� -> (������)"
+
+#: tfrmsyncdirsdlg.actselectdeleteboth.caption
+msgid "Select for deleting <-> (both)"
+msgstr "���� �� ������� <-> (a������)"

 #: tfrmsyncdirsdlg.btnclose.caption
 msgctxt "TFRMSYNCDIRSDLG.BTNCLOSE.CAPTION"
diff --git a/doublecmd-0.9.6.orig/language/doublecmd.ru.po b/doublecmd-0.9.6/language/doublecmd.ru.po
index f16bd2c..3692b26 100644
--- a/doublecmd-0.9.6.orig/language/doublecmd.ru.po
+++ b/doublecmd-0.9.6/language/doublecmd.ru.po
@@ -15,6 +15,10 @@ msgstr ""
 msgid "Comparing... %d%% (ESC to cancel)"
 msgstr "���������... %d%% (ESC �� �����)"

+#: fsyncdirsdlg.rsdeleteleft
+msgid "Left: Delete %d file(s)"
+msgstr "�����: ������ ���� (%d ��.)"
+
 #: fsyncdirsdlg.rsdeleteright
 msgid "Right: Delete %d file(s)"
 msgstr "������: ������ ���� (%d ��.)"
@@ -8633,10 +8637,18 @@ msgstr "������ ����������� ����������"
 msgid "Select for copying <- (right to left)"
 msgstr "������� �� ���������� <- (������ ������)"

+#: tfrmsyncdirsdlg.actselectdeleterleft.caption
+msgid "Select for deleting <- (left)"
+msgstr "������� �� ������� <- (�����)"
+
 #: tfrmsyncdirsdlg.actselectdeleteright.caption
 msgid "Select for deleting -> (right)"
 msgstr "������� �� ������� -> (������)"

+#: tfrmsyncdirsdlg.actselectdeleteboth.caption
+msgid "Select for deleting <-> (both)"
+msgstr "������� �� ������� <-> (���)"
+
 #: tfrmsyncdirsdlg.btnclose.caption
 msgctxt "tfrmsyncdirsdlg.btnclose.caption"
 msgid "Close"
diff --git a/doublecmd-0.9.6.orig/src/fsyncdirsdlg.lfm b/doublecmd-0.9.6/src/fsyncdirsdlg.lfm
index 71cab03..e30c607 100644
--- a/doublecmd-0.9.6.orig/src/fsyncdirsdlg.lfm
+++ b/doublecmd-0.9.6/src/fsyncdirsdlg.lfm
@@ -538,7 +538,7 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
     left = 56
     top = 152
     Bitmap = {
-      4C69070000001000000010000000C3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      4C69090000001000000010000000C3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
       C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
       C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FF000000FF000000FF000000FF0000
       00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
@@ -706,6 +706,70 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
       FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
       FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
       FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF3D8D
+      1BFF3D8D1BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3D8D1BFF3D8D1BFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF3D8D
+      1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFFFFFF3D8D1BFF3D8D1BFF3D8D1BFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF3D8D
+      1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFFFFFF3D8D1BFF3D8D1BFF3D8D1BFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF3D8D
+      1BFF3D8D1BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3D8D1BFF3D8D1BFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FF000000FF000000FF000000FF0000
+      00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+      00FF000000FF000000FFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      3FFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFCC48
+      FFFFCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FFFCC483FFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFCC48
+      3FFFCC483FFFCC483FFFFFFFFFFFFFFFFFFFCC483FFFCC483FFFCC483FFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFCC483FFFCC483FFFCC483FFFCC483FFFCC483FFFCC483FFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFCC483FFFCC483FFFCC483FFFCC483FFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFCC483FFFCC483FFFCC483FFFCC483FFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFCC483FFFCC483FFFCC483FFFCC483FFFCC483FFFCC483FFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFCC48
+      3FFFCC483FFFCC483FFFFFFFFFFFFFFFFFFFCC483FFFCC483FFFCC483FFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFCC48
+      3FFFCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FFFCC483FFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FF000000FF000000FF000000FF0000
+      00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+      00FF000000FF000000FFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
       FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF0000
       FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFFFFFF
       FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF0000
@@ -805,9 +869,15 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
     object miSeparator2: TMenuItem
       Caption = '-'
     end
+    object miSelectDeleteLeft: TMenuItem
+      Action = actSelectDeleteLeft
+    end
     object miSelectDeleteRight: TMenuItem
       Action = actSelectDeleteRight
     end
+    object miSelectDeleteBoth: TMenuItem
+      Action = actSelectDeleteBoth
+    end
   end
   object ActionList: TActionList
     left = 376
@@ -832,9 +902,17 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
       Caption = 'Reverse copy direction'
       OnExecute = actExecute
     end
+    object actSelectDeleteLeft: TAction
+      Caption = 'Select for deleting <- (left)'
+      OnExecute = actExecute
+    end
     object actSelectDeleteRight: TAction
       Caption = 'Select for deleting -> (right)'
       OnExecute = actExecute
     end
+    object actSelectDeleteBoth: TAction
+      Caption = 'Select for deleting <-> (both)'
+      OnExecute = actExecute
+    end
   end
 end
diff --git a/doublecmd-0.9.6.orig/src/fsyncdirsdlg.pas b/doublecmd-0.9.6/src/fsyncdirsdlg.pas
index c9fbe38..346b2f5 100644
--- a/doublecmd-0.9.6.orig/src/fsyncdirsdlg.pas
+++ b/doublecmd-0.9.6/src/fsyncdirsdlg.pas
@@ -37,8 +37,8 @@ const

 type

-  TSyncRecState = (srsUnknown, srsEqual, srsNotEq, srsCopyLeft, srsCopyRight, srsDeleteRight,
-    srsDoNothing);
+  TSyncRecState = (srsUnknown, srsEqual, srsNotEq, srsCopyLeft, srsCopyRight, srsDeleteLeft,
+    srsDeleteRight, srsDeleteBoth, srsDoNothing);

   { TDrawGrid }

@@ -50,7 +50,9 @@ type
   { TfrmSyncDirsDlg }

   TfrmSyncDirsDlg = class(TForm, IFormCommands)
+    actSelectDeleteLeft: TAction;
     actSelectDeleteRight: TAction;
+    actSelectDeleteBoth: TAction;
     actSelectCopyReverse: TAction;
     actSelectClear: TAction;
     actSelectCopyLeftToRight: TAction;
@@ -79,7 +81,9 @@ type
     Label1: TLabel;
     LeftPanel1: TPanel;
     LeftPanel2: TPanel;
+    miSelectDeleteLeft: TMenuItem;
     miSelectDeleteRight: TMenuItem;
+    miSelectDeleteBoth: TMenuItem;
     miSeparator2: TMenuItem;
     miSelectCopyReverse: TMenuItem;
     miSeparator1: TMenuItem;
@@ -173,7 +177,9 @@ type
     destructor Destroy; override;
   published
     procedure cm_SelectClear(const {%H-}Params:array of string);
+    procedure cm_SelectDeleteLeft(const {%H-}Params:array of string);
     procedure cm_SelectDeleteRight(const {%H-}Params:array of string);
+    procedure cm_SelectDeleteBoth(const {%H-}Params:array of string);
     procedure cm_SelectCopyDefault(const {%H-}Params:array of string);
     procedure cm_SelectCopyReverse(const {%H-}Params:array of string);
     procedure cm_SelectCopyLeftToRight(const {%H-}Params:array of string);
@@ -184,6 +190,7 @@ resourcestring
   rsComparingPercent = 'Comparing... %d%% (ESC to cancel)';
   rsLeftToRightCopy = 'Left to Right: Copy %d files, total size: %d bytes';
   rsRightToLeftCopy = 'Right to Left: Copy %d files, total size: %d bytes';
+  rsDeleteLeft = 'Left: Delete %d file(s)';
   rsDeleteRight = 'Right: Delete %d file(s)';
   rsFilesFound = 'Files found: %d  (Identical: %d, Different: %d, '
     + 'Unique left: %d, Unique right: %d)';
@@ -543,17 +550,17 @@ var

 var
   i,
-  DeleteRightCount,
+  DeleteLeftCount, DeleteRightCount,
   CopyLeftCount, CopyRightCount: Integer;
   CopyLeftSize, CopyRightSize: Int64;
   fsr: TFileSyncRec;
-  DeleteRight,
+  DeleteLeft, DeleteRight,
   CopyLeft, CopyRight: Boolean;
-  DeleteRightFiles,
+  DeleteLeftFiles, DeleteRightFiles,
   CopyLeftFiles, CopyRightFiles: TFiles;
   Dest: string;
 begin
-  DeleteRightCount := 0;
+  DeleteLeftCount := 0; DeleteRightCount := 0;
   CopyLeftCount := 0; CopyRightCount := 0;
   CopyLeftSize := 0;  CopyRightSize := 0;
   for i := 0 to FVisibleItems.Count - 1 do
@@ -571,10 +578,19 @@ begin
           Inc(CopyRightCount);
           Inc(CopyRightSize, fsr.FFileL.Size);
         end;
+      srsDeleteLeft:
+        begin
+          Inc(DeleteLeftCount);
+        end;
       srsDeleteRight:
         begin
           Inc(DeleteRightCount);
         end;
+      srsDeleteBoth:
+        begin
+          Inc(DeleteLeftCount);
+          Inc(DeleteRightCount);
+        end;
       end;
     end;
   with TfrmSyncDirsPerformDlg.Create(Self) do
@@ -595,8 +611,11 @@ begin
       chkLeftToRight.Checked := True;
       edRightPath.Enabled := True;
     end;
+    chkDeleteLeft.Enabled := DeleteLeftCount > 0;
+    chkDeleteLeft.Checked := chkDeleteLeft.Enabled;
     chkDeleteRight.Enabled := DeleteRightCount > 0;
     chkDeleteRight.Checked := chkDeleteRight.Enabled;
+    chkDeleteLeft.Caption := Format(rsDeleteLeft, [DeleteLeftCount]);
     chkDeleteRight.Caption := Format(rsDeleteRight, [DeleteRightCount]);
     chkLeftToRight.Caption :=
       Format(rsLeftToRightCopy, [CopyRightCount, CopyRightSize]);
@@ -612,12 +631,14 @@ begin
       end;
       CopyLeft := chkRightToLeft.Checked;
       CopyRight := chkLeftToRight.Checked;
+      DeleteLeft := chkDeleteLeft.Checked;
       DeleteRight := chkDeleteRight.Checked;
       i := 0;
       while i < FVisibleItems.Count do
       begin
         CopyLeftFiles := TFiles.Create('');
         CopyRightFiles := TFiles.Create('');
+        DeleteLeftFiles := TFiles.Create('');
         DeleteRightFiles := TFiles.Create('');
         if FVisibleItems.Objects[i] <> nil then
           repeat
@@ -630,6 +651,13 @@ begin
               if CopyLeft then CopyLeftFiles.Add(fsr.FFileR.Clone);
             srsDeleteRight:
               if DeleteRight then DeleteRightFiles.Add(fsr.FFileR.Clone);
+            srsDeleteLeft:
+              if DeleteLeft then DeleteLeftFiles.Add(fsr.FFileL.Clone);
+            srsDeleteBoth:
+              begin
+                if DeleteRight then DeleteRightFiles.Add(fsr.FFileR.Clone);
+                if DeleteLeft then DeleteLeftFiles.Add(fsr.FFileL.Clone);
+              end;
             end;
             i := i + 1;
           until (i = FVisibleItems.Count) or (FVisibleItems.Objects[i] = nil);
@@ -644,6 +672,11 @@ begin
           if not CopyFiles(FCmpFileSourceL, FCmpFileSourceR, CopyRightFiles,
             FCmpFilePathR + Dest) then Break;
         end else CopyRightFiles.Free;
+        if DeleteLeftFiles.Count > 0 then
+        begin
+          if not DeleteFiles(FCmpFileSourceL, DeleteLeftFiles) then Break;
+        end
+        else DeleteLeftFiles.Free;
         if DeleteRightFiles.Count > 0 then
         begin
           if not DeleteFiles(FCmpFileSourceR, DeleteRightFiles) then Break;
@@ -792,6 +825,7 @@ begin
       srsNotEq:       Font.Color := clRed;
       srsCopyLeft:    Font.Color := clBlue;
       srsCopyRight:   Font.Color := clGreen;
+      srsDeleteLeft:  Font.Color := clGreen;
       srsDeleteRight: Font.Color := clBlue;
       else Font.Color := clWindowText;
       end;
@@ -914,8 +948,8 @@ end;

 procedure TfrmSyncDirsDlg.pmGridMenuPopup(Sender: TObject);
 begin
-  miSeparator2.Visible := chkAsymmetric.Checked;
-  miSelectDeleteRight.Visible := chkAsymmetric.Checked;
+  miSelectDeleteLeft.Visible := not chkAsymmetric.Checked;
+  miSelectDeleteBoth.Visible := not chkAsymmetric.Checked;
 end;

 procedure TfrmSyncDirsDlg.SetSortIndex(AValue: Integer);
@@ -1060,6 +1094,7 @@ begin
            and
            ((r.FState = srsCopyLeft) and filter.copyLeft or
             (r.FState = srsCopyRight) and filter.copyRight or
+            (r.FState = srsDeleteLeft) and filter.copyRight or
             (r.FState = srsDeleteRight) and filter.copyLeft or
             (r.FState = srsEqual) and filter.eq or
             (r.FState = srsNotEq) and filter.neq or
@@ -1417,7 +1452,14 @@ begin
     else
       ca := srsDoNothing;
   srsDeleteRight:
-    ca := srsDoNothing;
+    if not chkAsymmetric.Checked then
+      ca := sr.FState
+    else
+      ca := srsDoNothing;
+  srsDeleteLeft:
+    ca := sr.FState;
+  srsDeleteBoth:
+    ca := sr.FState;
   srsDoNothing:
     if Assigned(sr.FFileL) then
       ca := srsCopyRight
@@ -1453,10 +1495,16 @@ var
         NewAction:= SyncRec.FState;
       srsNotEq:
         begin
-          if (SyncRec.FAction = srsCopyLeft) and Assigned(SyncRec.FFileL) then
-            NewAction:= srsCopyRight
-          else if (SyncRec.FAction = srsCopyRight) and Assigned(SyncRec.FFileR) then
-            NewAction:= srsCopyLeft
+          if SyncRec.FAction = srsCopyLeft then
+            if not Assigned(SyncRec.FFileL) then
+              NewAction:= srsDoNothing
+            else
+              NewAction:= srsCopyRight
+          else if SyncRec.FAction = srsCopyRight then
+            if not Assigned(SyncRec.FFileR) then
+              NewAction:= srsDoNothing
+            else
+              NewAction:= srsCopyLeft
           else
             NewAction:= SyncRec.FAction
         end;
@@ -1470,11 +1518,23 @@ var
           if not Assigned(SyncRec.FFileL) then
             NewAction:= srsDoNothing;
         end;
+      srsDeleteLeft:
+        begin
+          if not Assigned(SyncRec.FFileL) then
+            NewAction:= srsDoNothing;
+        end;
       srsDeleteRight:
         begin
           if not Assigned(SyncRec.FFileR) then
             NewAction:= srsDoNothing;
         end;
+      srsDeleteBoth:
+        begin
+          if not Assigned(SyncRec.FFileL) then
+            NewAction:= srsDeleteRight;
+          if not Assigned(SyncRec.FFileR) then
+            NewAction:= srsDeleteLeft;
+        end;
     end;
     SyncRec.FAction:= NewAction;
     MainDrawGrid.InvalidateRow(R);
@@ -1594,11 +1654,21 @@ begin
   SetSyncRecState(srsDoNothing);
 end;

+procedure TfrmSyncDirsDlg.cm_SelectDeleteLeft(const Params: array of string);
+begin
+  SetSyncRecState(srsDeleteLeft);
+end;
+
 procedure TfrmSyncDirsDlg.cm_SelectDeleteRight(const Params: array of string);
 begin
   SetSyncRecState(srsDeleteRight);
 end;

+procedure TfrmSyncDirsDlg.cm_SelectDeleteBoth(const Params: array of string);
+begin
+  SetSyncRecState(srsDeleteBoth);
+end;
+
 procedure TfrmSyncDirsDlg.cm_SelectCopyDefault(const Params: array of string);
 begin
   SetSyncRecState(srsUnknown);
diff --git a/doublecmd-0.9.6.orig/src/fsyncdirsperformdlg.lfm b/doublecmd-0.9.6/src/fsyncdirsperformdlg.lfm
index d43f2b5..20485df 100644
--- a/doublecmd-0.9.6.orig/src/fsyncdirsperformdlg.lfm
+++ b/doublecmd-0.9.6/src/fsyncdirsperformdlg.lfm
@@ -1,6 +1,6 @@
 object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
   Left = 234
-  Height = 200
+  Height = 219
   Top = 137
   Width = 326
   AutoSize = True
@@ -73,7 +73,7 @@ object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
     AnchorSideRight.Side = asrBottom
     Left = 0
     Height = 6
-    Top = 121
+    Top = 140
     Width = 326
     Anchors = [akTop, akLeft, akRight]
     BorderSpacing.Top = 3
@@ -85,7 +85,7 @@ object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
     AnchorSideTop.Side = asrBottom
     Left = 6
     Height = 19
-    Top = 133
+    Top = 152
     Width = 121
     BorderSpacing.Left = 6
     BorderSpacing.Top = 6
@@ -99,7 +99,7 @@ object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
     AnchorSideTop.Side = asrBottom
     Left = 6
     Height = 26
-    Top = 158
+    Top = 177
     Width = 314
     Align = alNone
     Anchors = [akTop, akLeft, akRight]
@@ -115,7 +115,7 @@ object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
     ShowButtons = [pbOK, pbCancel]
     ShowBevel = False
   end
-  object chkDeleteRight: TCheckBox
+  object chkDeleteLeft: TCheckBox
     AnchorSideLeft.Control = chkLeftToRight
     AnchorSideTop.Control = edLeftPath
     AnchorSideTop.Side = asrBottom
@@ -126,4 +126,15 @@ object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
     BorderSpacing.Top = 6
     TabOrder = 4
   end
+  object chkDeleteRight: TCheckBox
+    AnchorSideLeft.Control = chkLeftToRight
+    AnchorSideTop.Control = chkDeleteLeft
+    AnchorSideTop.Side = asrBottom
+    Left = 6
+    Height = 19
+    Top = 118
+    Width = 20
+    BorderSpacing.Top = 6
+    TabOrder = 4
+  end
 end
diff --git a/doublecmd-0.9.6.orig/src/fsyncdirsperformdlg.pas b/doublecmd-0.9.6/src/fsyncdirsperformdlg.pas
index a1828f2..127e86a 100644
--- a/doublecmd-0.9.6.orig/src/fsyncdirsperformdlg.pas
+++ b/doublecmd-0.9.6/src/fsyncdirsperformdlg.pas
@@ -15,6 +15,7 @@ type
   TfrmSyncDirsPerformDlg = class(TForm)
     Bevel1: TBevel;
     ButtonPanel1: TButtonPanel;
+    chkDeleteLeft: TCheckBox;
     chkDeleteRight: TCheckBox;
     chkConfirmOverwrites: TCheckBox;
     chkLeftToRight: TCheckBox;
01-sync-delete.diff (20,574 bytes)   
01-sync-delete-1.0.0.diff (21,151 bytes)   
diff --git a/doublecmd-1.0.0.orig/language/doublecmd.be.po b/doublecmd-1.0.0/language/doublecmd.be.po
index fde43f0..22bcf20 100644
--- a/doublecmd-1.0.0.orig/language/doublecmd.be.po
+++ b/doublecmd-1.0.0/language/doublecmd.be.po
@@ -16,6 +16,10 @@ msgstr ""
 msgid "Comparing... %d%% (ESC to cancel)"
 msgstr "Параўнанне... ‰d%% (ESC каб скасаваць)"
 
+#: fsyncdirsdlg.rsdeleteleft
+msgid "Left: Delete %d file(s)"
+msgstr "Лева: выдаліць %d файл(аў)"
+
 #: fsyncdirsdlg.rsdeleteright
 msgid "Right: Delete %d file(s)"
 msgstr "Права: выдаліць %d файл(аў)"
@@ -8517,9 +8521,17 @@ msgstr ""
 msgid "Select for copying <- (right to left)"
 msgstr ""
 
+#: tfrmsyncdirsdlg.actselectdeleteleft.caption
+msgid "Select for deleting <- (left)"
+msgstr "Абраць для выдалення <- (злева)"
+
 #: tfrmsyncdirsdlg.actselectdeleteright.caption
 msgid "Select for deleting -> (right)"
-msgstr ""
+msgstr "Абраць для выдалення -> (зправа)"
+
+#: tfrmsyncdirsdlg.actselectdeleteboth.caption
+msgid "Select for deleting <-> (both)"
+msgstr "Абраць для выдалення <-> (абодва)"
 
 #: tfrmsyncdirsdlg.btnclose.caption
 msgctxt "TFRMSYNCDIRSDLG.BTNCLOSE.CAPTION"
diff --git a/doublecmd-1.0.0.orig/language/doublecmd.ru.po b/doublecmd-1.0.0/language/doublecmd.ru.po
index cbe4be6..fecc39f 100644
--- a/doublecmd-1.0.0.orig/language/doublecmd.ru.po
+++ b/doublecmd-1.0.0/language/doublecmd.ru.po
@@ -15,6 +15,10 @@ msgstr ""
 msgid "Comparing... %d%% (ESC to cancel)"
 msgstr "Сравнение... %d%% (ESC для отмены)"
 
+#: fsyncdirsdlg.rsdeleteleft
+msgid "Left: Delete %d file(s)"
+msgstr "Слева: Удалить файлы (%d шт.)"
+
 #: fsyncdirsdlg.rsdeleteright
 msgid "Right: Delete %d file(s)"
 msgstr "Справа: Удалить файлы (%d шт.)"
@@ -8716,10 +8720,18 @@ msgstr "Поменять направление копирования"
 msgid "Select for copying <- (right to left)"
 msgstr "Отметить для копирования <- (справа налево)"
 
+#: tfrmsyncdirsdlg.actselectdeleterleft.caption
+msgid "Select for deleting <- (left)"
+msgstr "Отметить для удаления <- (слева)"
+
 #: tfrmsyncdirsdlg.actselectdeleteright.caption
 msgid "Select for deleting -> (right)"
 msgstr "Отметить для удаления -> (справа)"
 
+#: tfrmsyncdirsdlg.actselectdeleteboth.caption
+msgid "Select for deleting <-> (both)"
+msgstr "Отметить для удаления <-> (оба)"
+
 #: tfrmsyncdirsdlg.btnclose.caption
 msgctxt "tfrmsyncdirsdlg.btnclose.caption"
 msgid "Close"
diff --git a/doublecmd-1.0.0.orig/src/fsyncdirsdlg.lfm b/doublecmd-1.0.0/src/fsyncdirsdlg.lfm
index 5cd022e..a373238 100644
--- a/doublecmd-1.0.0.orig/src/fsyncdirsdlg.lfm
+++ b/doublecmd-1.0.0/src/fsyncdirsdlg.lfm
@@ -538,7 +538,7 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
     left = 56
     top = 152
     Bitmap = {
-      4C69070000001000000010000000C3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      4C69090000001000000010000000C3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
       C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
       C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FF000000FF000000FF000000FF0000
       00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
@@ -706,6 +706,70 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
       FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
       FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
       FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF3D8D
+      1BFF3D8D1BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3D8D1BFF3D8D1BFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF3D8D
+      1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFFFFFF3D8D1BFF3D8D1BFF3D8D1BFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF3D8D
+      1BFF3D8D1BFF3D8D1BFFFFFFFFFFFFFFFFFF3D8D1BFF3D8D1BFF3D8D1BFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF3D8D
+      1BFF3D8D1BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3D8D1BFF3D8D1BFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FF000000FF000000FF000000FF0000
+      00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+      00FF000000FF000000FFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      3FFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFCC48
+      FFFFCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FFFCC483FFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFCC48
+      3FFFCC483FFFCC483FFFFFFFFFFFFFFFFFFFCC483FFFCC483FFFCC483FFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFCC483FFFCC483FFFCC483FFFCC483FFFCC483FFFCC483FFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFCC483FFFCC483FFFCC483FFFCC483FFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFCC483FFFCC483FFFCC483FFFCC483FFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFCC483FFFCC483FFFCC483FFFCC483FFFCC483FFFCC483FFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFCC48
+      3FFFCC483FFFCC483FFFFFFFFFFFFFFFFFFFCC483FFFCC483FFFCC483FFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFCC48
+      3FFFCC483FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC483FFFCC483FFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3
+      C3FFC3C3C3FFC3C3C3FFC3C3C3FFC3C3C3FF000000FF000000FF000000FF0000
+      00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000
+      00FF000000FF000000FFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFFFFFF
+      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
       FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF0000
       FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFFFFFF
       FFFFFFFFFFFFFFFFFFFFC3C3C3FFC3C3C3FF000000FFFFFFFFFFFFFFFFFF0000
@@ -805,9 +869,15 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
     object miSeparator2: TMenuItem
       Caption = '-'
     end
+    object miSelectDeleteLeft: TMenuItem
+      Action = actSelectDeleteLeft
+    end
     object miSelectDeleteRight: TMenuItem
       Action = actSelectDeleteRight
     end
+    object miSelectDeleteBoth: TMenuItem
+      Action = actSelectDeleteBoth
+    end
     object miSeparator3: TMenuItem
       Caption = '-'
     end
@@ -844,10 +914,18 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
       Caption = 'Reverse copy direction'
       OnExecute = actExecute
     end
+    object actSelectDeleteLeft: TAction
+      Caption = 'Select for deleting <- (left)'
+      OnExecute = actExecute
+    end
     object actSelectDeleteRight: TAction
       Caption = 'Select for deleting -> (right)'
       OnExecute = actExecute
     end
+    object actSelectDeleteBoth: TAction
+      Caption = 'Select for deleting <-> (both)'
+      OnExecute = actExecute
+    end
     object actDeleteLeft: TAction
       Caption = '<- Delete left'
       OnExecute = actExecute
diff --git a/doublecmd-1.0.0.orig/src/fsyncdirsdlg.pas b/doublecmd-1.0.0/src/fsyncdirsdlg.pas
index d4e09dd..eccb9b9 100644
--- a/doublecmd-1.0.0.orig/src/fsyncdirsdlg.pas
+++ b/doublecmd-1.0.0/src/fsyncdirsdlg.pas
@@ -37,8 +37,8 @@ const
 
 type
 
-  TSyncRecState = (srsUnknown, srsEqual, srsNotEq, srsCopyLeft, srsCopyRight, srsDeleteRight,
-    srsDoNothing);
+  TSyncRecState = (srsUnknown, srsEqual, srsNotEq, srsCopyLeft, srsCopyRight, srsDeleteLeft,
+    srsDeleteRight, srsDeleteBoth, srsDoNothing);
 
   { TDrawGrid }
 
@@ -53,7 +53,9 @@ type
     actDeleteLeft: TAction;
     actDeleteRight: TAction;
     actDeleteBoth: TAction;
+    actSelectDeleteLeft: TAction;
     actSelectDeleteRight: TAction;
+    actSelectDeleteBoth: TAction;
     actSelectCopyReverse: TAction;
     actSelectClear: TAction;
     actSelectCopyLeftToRight: TAction;
@@ -86,7 +88,9 @@ type
     miDeleteRight: TMenuItem;
     miDeleteLeft: TMenuItem;
     miSeparator3: TMenuItem;
+    miSelectDeleteLeft: TMenuItem;
     miSelectDeleteRight: TMenuItem;
+    miSelectDeleteBoth: TMenuItem;
     miSeparator2: TMenuItem;
     miSelectCopyReverse: TMenuItem;
     miSeparator1: TMenuItem;
@@ -186,7 +190,9 @@ type
     procedure CopyToClipboard;
   published
     procedure cm_SelectClear(const {%H-}Params:array of string);
+    procedure cm_SelectDeleteLeft(const {%H-}Params:array of string);
     procedure cm_SelectDeleteRight(const {%H-}Params:array of string);
+    procedure cm_SelectDeleteBoth(const {%H-}Params:array of string);
     procedure cm_SelectCopyDefault(const {%H-}Params:array of string);
     procedure cm_SelectCopyReverse(const {%H-}Params:array of string);
     procedure cm_SelectCopyLeftToRight(const {%H-}Params:array of string);
@@ -202,6 +208,7 @@ resourcestring
   rsComparingPercent = 'Comparing... %d%% (ESC to cancel)';
   rsLeftToRightCopy = 'Left to Right: Copy %d files, total size: %d bytes';
   rsRightToLeftCopy = 'Right to Left: Copy %d files, total size: %d bytes';
+  rsDeleteLeft = 'Left: Delete %d file(s)';
   rsDeleteRight = 'Right: Delete %d file(s)';
   rsFilesFound = 'Files found: %d  (Identical: %d, Different: %d, '
     + 'Unique left: %d, Unique right: %d)';
@@ -543,17 +550,17 @@ var
 
 var
   i,
-  DeleteRightCount,
+  DeleteLeftCount, DeleteRightCount,
   CopyLeftCount, CopyRightCount: Integer;
   CopyLeftSize, CopyRightSize: Int64;
   fsr: TFileSyncRec;
-  DeleteRight,
+  DeleteLeft, DeleteRight,
   CopyLeft, CopyRight: Boolean;
-  DeleteRightFiles,
+  DeleteLeftFiles, DeleteRightFiles,
   CopyLeftFiles, CopyRightFiles: TFiles;
   Dest: string;
 begin
-  DeleteRightCount := 0;
+  DeleteLeftCount := 0; DeleteRightCount := 0;
   CopyLeftCount := 0; CopyRightCount := 0;
   CopyLeftSize := 0;  CopyRightSize := 0;
   for i := 0 to FVisibleItems.Count - 1 do
@@ -571,10 +578,19 @@ begin
           Inc(CopyRightCount);
           Inc(CopyRightSize, fsr.FFileL.Size);
         end;
+      srsDeleteLeft:
+        begin
+          Inc(DeleteLeftCount);
+        end;
       srsDeleteRight:
         begin
           Inc(DeleteRightCount);
         end;
+      srsDeleteBoth:
+        begin
+          Inc(DeleteLeftCount);
+          Inc(DeleteRightCount);
+        end;
       end;
     end;
   with TfrmSyncDirsPerformDlg.Create(Self) do
@@ -595,8 +611,11 @@ begin
       chkLeftToRight.Checked := True;
       edRightPath.Enabled := True;
     end;
+    chkDeleteLeft.Enabled := DeleteLeftCount > 0;
+    chkDeleteLeft.Checked := chkDeleteLeft.Enabled;
     chkDeleteRight.Enabled := DeleteRightCount > 0;
     chkDeleteRight.Checked := chkDeleteRight.Enabled;
+    chkDeleteLeft.Caption := Format(rsDeleteLeft, [DeleteLeftCount]);
     chkDeleteRight.Caption := Format(rsDeleteRight, [DeleteRightCount]);
     chkLeftToRight.Caption :=
       Format(rsLeftToRightCopy, [CopyRightCount, CopyRightSize]);
@@ -612,12 +631,14 @@ begin
       end;
       CopyLeft := chkRightToLeft.Checked;
       CopyRight := chkLeftToRight.Checked;
+      DeleteLeft := chkDeleteLeft.Checked;
       DeleteRight := chkDeleteRight.Checked;
       i := 0;
       while i < FVisibleItems.Count do
       begin
         CopyLeftFiles := TFiles.Create('');
         CopyRightFiles := TFiles.Create('');
+        DeleteLeftFiles := TFiles.Create('');
         DeleteRightFiles := TFiles.Create('');
         if FVisibleItems.Objects[i] <> nil then
           repeat
@@ -630,6 +651,13 @@ begin
               if CopyLeft then CopyLeftFiles.Add(fsr.FFileR.Clone);
             srsDeleteRight:
               if DeleteRight then DeleteRightFiles.Add(fsr.FFileR.Clone);
+            srsDeleteLeft:
+              if DeleteLeft then DeleteLeftFiles.Add(fsr.FFileL.Clone);
+            srsDeleteBoth:
+              begin
+                if DeleteRight then DeleteRightFiles.Add(fsr.FFileR.Clone);
+                if DeleteLeft then DeleteLeftFiles.Add(fsr.FFileL.Clone);
+              end;
             end;
             i := i + 1;
           until (i = FVisibleItems.Count) or (FVisibleItems.Objects[i] = nil);
@@ -644,6 +672,11 @@ begin
           if not CopyFiles(FCmpFileSourceL, FCmpFileSourceR, CopyRightFiles,
             FCmpFilePathR + Dest) then Break;
         end else CopyRightFiles.Free;
+        if DeleteLeftFiles.Count > 0 then
+        begin
+          if not DeleteFiles(FCmpFileSourceL, DeleteLeftFiles) then Break;
+        end
+        else DeleteLeftFiles.Free;
         if DeleteRightFiles.Count > 0 then
         begin
           if not DeleteFiles(FCmpFileSourceR, DeleteRightFiles) then Break;
@@ -792,6 +825,7 @@ begin
       srsNotEq:       Font.Color := clRed;
       srsCopyLeft:    Font.Color := clBlue;
       srsCopyRight:   Font.Color := clGreen;
+      srsDeleteLeft:  Font.Color := clGreen;
       srsDeleteRight: Font.Color := clBlue;
       else Font.Color := clWindowText;
       end;
@@ -924,8 +958,8 @@ end;
 
 procedure TfrmSyncDirsDlg.pmGridMenuPopup(Sender: TObject);
 begin
-  miSeparator2.Visible := chkAsymmetric.Checked;
-  miSelectDeleteRight.Visible := chkAsymmetric.Checked;
+  miSelectDeleteLeft.Visible := not chkAsymmetric.Checked;
+  miSelectDeleteBoth.Visible := not chkAsymmetric.Checked;
 end;
 
 procedure TfrmSyncDirsDlg.SetSortIndex(AValue: Integer);
@@ -1070,6 +1104,7 @@ begin
            and
            ((r.FState = srsCopyLeft) and filter.copyLeft or
             (r.FState = srsCopyRight) and filter.copyRight or
+            (r.FState = srsDeleteLeft) and filter.copyRight or
             (r.FState = srsDeleteRight) and filter.copyLeft or
             (r.FState = srsEqual) and filter.eq or
             (r.FState = srsNotEq) and filter.neq or
@@ -1427,7 +1462,14 @@ begin
     else
       ca := srsDoNothing;
   srsDeleteRight:
-    ca := srsDoNothing;
+    if not chkAsymmetric.Checked then
+      ca := sr.FState
+    else
+      ca := srsDoNothing;
+  srsDeleteLeft:
+    ca := sr.FState;
+  srsDeleteBoth:
+    ca := sr.FState;
   srsDoNothing:
     if Assigned(sr.FFileL) then
       ca := srsCopyRight
@@ -1463,10 +1505,16 @@ var
         NewAction:= SyncRec.FState;
       srsNotEq:
         begin
-          if (SyncRec.FAction = srsCopyLeft) and Assigned(SyncRec.FFileL) then
-            NewAction:= srsCopyRight
-          else if (SyncRec.FAction = srsCopyRight) and Assigned(SyncRec.FFileR) then
-            NewAction:= srsCopyLeft
+          if SyncRec.FAction = srsCopyLeft then
+            if not Assigned(SyncRec.FFileL) then
+              NewAction:= srsDoNothing
+            else
+              NewAction:= srsCopyRight
+          else if SyncRec.FAction = srsCopyRight then
+            if not Assigned(SyncRec.FFileR) then
+              NewAction:= srsDoNothing
+            else
+              NewAction:= srsCopyLeft
           else
             NewAction:= SyncRec.FAction
         end;
@@ -1480,11 +1528,23 @@ var
           if not Assigned(SyncRec.FFileL) then
             NewAction:= srsDoNothing;
         end;
+      srsDeleteLeft:
+        begin
+          if not Assigned(SyncRec.FFileL) then
+            NewAction:= srsDoNothing;
+        end;
       srsDeleteRight:
         begin
           if not Assigned(SyncRec.FFileR) then
             NewAction:= srsDoNothing;
         end;
+      srsDeleteBoth:
+        begin
+          if not Assigned(SyncRec.FFileL) then
+            NewAction:= srsDeleteRight;
+          if not Assigned(SyncRec.FFileR) then
+            NewAction:= srsDeleteLeft;
+        end;
     end;
     SyncRec.FAction:= NewAction;
     MainDrawGrid.InvalidateRow(R);
@@ -1852,11 +1912,21 @@ begin
   SetSyncRecState(srsDoNothing);
 end;
 
+procedure TfrmSyncDirsDlg.cm_SelectDeleteLeft(const Params: array of string);
+begin
+  SetSyncRecState(srsDeleteLeft);
+end;
+
 procedure TfrmSyncDirsDlg.cm_SelectDeleteRight(const Params: array of string);
 begin
   SetSyncRecState(srsDeleteRight);
 end;
 
+procedure TfrmSyncDirsDlg.cm_SelectDeleteBoth(const Params: array of string);
+begin
+  SetSyncRecState(srsDeleteBoth);
+end;
+
 procedure TfrmSyncDirsDlg.cm_SelectCopyDefault(const Params: array of string);
 begin
   SetSyncRecState(srsUnknown);
diff --git a/doublecmd-1.0.0.orig/src/fsyncdirsperformdlg.lfm b/doublecmd-1.0.0/src/fsyncdirsperformdlg.lfm
old mode 100644
new mode 100755
index 04e9322..2a62566
--- a/doublecmd-1.0.0.orig/src/fsyncdirsperformdlg.lfm
+++ b/doublecmd-1.0.0/src/fsyncdirsperformdlg.lfm
@@ -1,6 +1,6 @@
 object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
   Left = 234
-  Height = 200
+  Height = 219
   Top = 137
   Width = 326
   AutoSize = True
@@ -73,7 +73,7 @@ object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
     AnchorSideRight.Side = asrBottom
     Left = 0
     Height = 6
-    Top = 121
+    Top = 140
     Width = 326
     Anchors = [akTop, akLeft, akRight]
     BorderSpacing.Top = 3
@@ -85,7 +85,7 @@ object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
     AnchorSideTop.Side = asrBottom
     Left = 6
     Height = 19
-    Top = 133
+    Top = 152
     Width = 121
     BorderSpacing.Left = 6
     BorderSpacing.Top = 6
@@ -99,7 +99,7 @@ object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
     AnchorSideTop.Side = asrBottom
     Left = 6
     Height = 26
-    Top = 158
+    Top = 177
     Width = 314
     Align = alNone
     Anchors = [akTop, akLeft, akRight]
@@ -115,7 +115,7 @@ object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
     ShowButtons = [pbOK, pbCancel]
     ShowBevel = False
   end
-  object chkDeleteRight: TCheckBox
+  object chkDeleteLeft: TCheckBox
     AnchorSideLeft.Control = chkLeftToRight
     AnchorSideTop.Control = edLeftPath
     AnchorSideTop.Side = asrBottom
@@ -126,4 +126,15 @@ object frmSyncDirsPerformDlg: TfrmSyncDirsPerformDlg
     BorderSpacing.Top = 6
     TabOrder = 4
   end
+  object chkDeleteRight: TCheckBox
+    AnchorSideLeft.Control = chkLeftToRight
+    AnchorSideTop.Control = chkDeleteLeft
+    AnchorSideTop.Side = asrBottom
+    Left = 6
+    Height = 19
+    Top = 118
+    Width = 20
+    BorderSpacing.Top = 6
+    TabOrder = 4
+  end
 end
diff --git a/doublecmd-1.0.0.orig/src/fsyncdirsperformdlg.pas b/doublecmd-1.0.0/src/fsyncdirsperformdlg.pas
old mode 100644
new mode 100755
index 31e2ce3..fac3f19
--- a/doublecmd-1.0.0.orig/src/fsyncdirsperformdlg.pas
+++ b/doublecmd-1.0.0/src/fsyncdirsperformdlg.pas
@@ -15,6 +15,7 @@ type
   TfrmSyncDirsPerformDlg = class(TForm)
     Bevel1: TBevel;
     ButtonPanel1: TButtonPanel;
+    chkDeleteLeft: TCheckBox;
     chkDeleteRight: TCheckBox;
     chkConfirmOverwrites: TCheckBox;
     chkLeftToRight: TCheckBox;
01-sync-delete-1.0.0.diff (21,151 bytes)   
Fixed in Revision9068
Operating system
Widgetset
Architecture

Activities

Alexx2000

2019-09-18 13:41

administrator   ~0003268

В версии 1.0 аналогичная возможность уже давно есть. Делать патчи имеет смысл только для текущей разрабатываемой версии (сейчас 1.0).

liquidvacuum

2019-09-18 23:14

reporter   ~0003269

Не посмотрел, прошу прощения.
Реализация получилась разная: в версии 1.0 при выборе команды удаления выбранные файлы удаляются немедленно, в предлагаемом мною варианте - помечаются для удаления, а удаляются при нажатии на кнопку "Синхронизировать" (как в режиме асимметричного сравнения). Возможно, принцип "выбрать, подумать, выполнить" как для копирования, так и для удаления для кого-то будет более удобным.
Если будет предложен патч для версии 1.0 с возможностью выбора поведения команд удаления по настройке в параметрах настройки, он будет принят?

Skif_off

2019-09-19 14:44

reporter   ~0003270

liquidvacuum, у вас там неточность:

+#: fsyncdirsdlg.rsdeleteleft
+msgid "Right: Delete %d file(s)"
+msgstr "Лева: выдаліць %d файл(аў)"

по идее должно быть "Left".

Alexx2000

2019-09-19 23:51

administrator   ~0003271

Первоначально я тоже так пробовал.

>>>Если будет предложен патч для версии 1.0 с возможностью выбора поведения команд удаления по настройке в параметрах настройки, он будет принят?

Можно просто дополнительно добавить и эти две команды. Будет два варианта: пометить для удаления и удалить сразу.

liquidvacuum

2019-09-21 00:12

reporter   ~0003276

Добавил патч для версии 1.0 (01-sync-delete-1.0.0.diff). Исправлены ошибки в doublecmd.be.po (спасибо Skif_off)

Issue History

Date Modified Username Field Change
2019-09-18 13:26 liquidvacuum New Issue
2019-09-18 13:26 liquidvacuum File Added: 01-sync-delete.diff
2019-09-18 13:41 Alexx2000 Note Added: 0003268
2019-09-18 13:41 Alexx2000 Status new => feedback
2019-09-18 23:14 liquidvacuum Note Added: 0003269
2019-09-18 23:14 liquidvacuum Status feedback => new
2019-09-19 14:44 Skif_off Note Added: 0003270
2019-09-19 23:51 Alexx2000 Note Added: 0003271
2019-09-21 00:09 liquidvacuum File Added: 01-sync-delete-1.0.0.diff
2019-09-21 00:12 liquidvacuum Note Added: 0003276
2019-09-26 14:15 Alexx2000 Fixed in Revision => 9068
2019-09-26 14:15 Alexx2000 Assigned To => Alexx2000
2019-09-26 14:15 Alexx2000 Status new => resolved
2019-09-26 14:15 Alexx2000 Resolution open => fixed
2019-09-26 14:15 Alexx2000 Fixed in Version => 1.0.0
2019-09-26 14:15 Alexx2000 Target Version => 1.0.0
2021-10-29 23:21 Alexx2000 Status resolved => closed