ADD: Feature [0001009] Deleting feature in the synchronize directories window (experimental)

This commit is contained in:
Alexander Koblov 2019-05-25 09:09:47 +00:00
commit 42f63c38f4
3 changed files with 242 additions and 60 deletions

View file

@ -15,7 +15,7 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
Position = poScreenCenter
SessionProperties = 'Height;Left;Top;Width;WindowState'
ShowInTaskBar = stAlways
LCLVersion = '1.8.2.0'
LCLVersion = '2.0.2.0'
object edPath1: TEdit
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
@ -808,6 +808,18 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
object miSelectDeleteRight: TMenuItem
Action = actSelectDeleteRight
end
object miSeparator3: TMenuItem
Caption = '-'
end
object miDeleteLeft: TMenuItem
Action = actDeleteLeft
end
object miDeleteRight: TMenuItem
Action = actDeleteRight
end
object miDeleteBoth: TMenuItem
Action = actDeleteBoth
end
end
object ActionList: TActionList
left = 376
@ -836,5 +848,17 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
Caption = 'Select for deleting -> (right)'
OnExecute = actExecute
end
object actDeleteLeft: TAction
Caption = '<- Delete left'
OnExecute = actExecute
end
object actDeleteRight: TAction
Caption = '-> Delete right'
OnExecute = actExecute
end
object actDeleteBoth: TAction
Caption = 'Delete on both sides'
OnExecute = actExecute
end
end
end

View file

@ -1,39 +1,42 @@
{"version":1,"strings":[
{"hash":36754147,"name":"tfrmsyncdirsdlg.caption","sourcebytes":[83,121,110,99,104,114,111,110,105,122,101,32,100,105,114,101,99,116,111,114,105,101,115],"value":"Synchronize directories"},
{"hash":11530,"name":"tfrmsyncdirsdlg.cbextfilter.text","sourcebytes":[42,46,42],"value":"*.*"},
{"hash":1054,"name":"tfrmsyncdirsdlg.btnseldir1.caption","sourcebytes":[62,62],"value":">>"},
{"hash":1054,"name":"tfrmsyncdirsdlg.btnseldir2.caption","sourcebytes":[62,62],"value":">>"},
{"hash":174352581,"name":"tfrmsyncdirsdlg.btncompare.caption","sourcebytes":[67,111,109,112,97,114,101],"value":"Compare"},
{"hash":242752852,"name":"tfrmsyncdirsdlg.chkonlyselected.caption","sourcebytes":[111,110,108,121,32,115,101,108,101,99,116,101,100],"value":"only selected"},
{"hash":181520105,"name":"tfrmsyncdirsdlg.label1.caption","sourcebytes":[40,105,110,32,109,97,105,110,32,119,105,110,100,111,119,41],"value":"(in main window)"},
{"hash":70923251,"name":"tfrmsyncdirsdlg.chkasymmetric.caption","sourcebytes":[97,115,121,109,109,101,116,114,105,99],"value":"asymmetric"},
{"hash":179876035,"name":"tfrmsyncdirsdlg.chksubdirs.caption","sourcebytes":[83,117,98,100,105,114,115],"value":"Subdirs"},
{"hash":174272820,"name":"tfrmsyncdirsdlg.chkbycontent.caption","sourcebytes":[98,121,32,99,111,110,116,101,110,116],"value":"by content"},
{"hash":135876037,"name":"tfrmsyncdirsdlg.chkignoredate.caption","sourcebytes":[105,103,110,111,114,101,32,100,97,116,101],"value":"ignore date"},
{"hash":5895850,"name":"tfrmsyncdirsdlg.groupbox1.caption","sourcebytes":[83,104,111,119,58],"value":"Show:"},
{"hash":62,"name":"tfrmsyncdirsdlg.sbcopyright.caption","sourcebytes":[62],"value":">"},
{"hash":61,"name":"tfrmsyncdirsdlg.sbequal.caption","sourcebytes":[61],"value":"="},
{"hash":589,"name":"tfrmsyncdirsdlg.sbnotequal.caption","sourcebytes":[33,61],"value":"!="},
{"hash":60,"name":"tfrmsyncdirsdlg.sbcopyleft.caption","sourcebytes":[60],"value":"<"},
{"hash":50280115,"name":"tfrmsyncdirsdlg.sbduplicates.caption","sourcebytes":[100,117,112,108,105,99,97,116,101,115],"value":"duplicates"},
{"hash":168092339,"name":"tfrmsyncdirsdlg.sbsingles.caption","sourcebytes":[115,105,110,103,108,101,115],"value":"singles"},
{"hash":267343253,"name":"tfrmsyncdirsdlg.btnsynchronize.caption","sourcebytes":[83,121,110,99,104,114,111,110,105,122,101],"value":"Synchronize"},
{"hash":4863637,"name":"tfrmsyncdirsdlg.btnclose.caption","sourcebytes":[67,108,111,115,101],"value":"Close"},
{"hash":197576788,"name":"tfrmsyncdirsdlg.statusbar1.panels[0].text","sourcebytes":[80,108,101,97,115,101,32,112,114,101,115,115,32,34,67,111,109,112,97,114,101,34,32,116,111,32,115,116,97,114,116],"value":"Please press \"Compare\" to start"},
{"hash":346165,"name":"tfrmsyncdirsdlg.headerdg.columns[0].title.caption","sourcebytes":[78,97,109,101],"value":"Name"},
{"hash":368901,"name":"tfrmsyncdirsdlg.headerdg.columns[1].title.caption","sourcebytes":[83,105,122,101],"value":"Size"},
{"hash":305317,"name":"tfrmsyncdirsdlg.headerdg.columns[2].title.caption","sourcebytes":[68,97,116,101],"value":"Date"},
{"hash":16398,"name":"tfrmsyncdirsdlg.headerdg.columns[3].title.caption","sourcebytes":[60,61,62],"value":"<=>"},
{"hash":305317,"name":"tfrmsyncdirsdlg.headerdg.columns[4].title.caption","sourcebytes":[68,97,116,101],"value":"Date"},
{"hash":368901,"name":"tfrmsyncdirsdlg.headerdg.columns[5].title.caption","sourcebytes":[83,105,122,101],"value":"Size"},
{"hash":346165,"name":"tfrmsyncdirsdlg.headerdg.columns[6].title.caption","sourcebytes":[78,97,109,101],"value":"Name"},
{"hash":211253028,"name":"tfrmsyncdirsdlg.menuitemviewleft.caption","sourcebytes":[86,105,101,119,32,108,101,102,116],"value":"View left"},
{"hash":159199796,"name":"tfrmsyncdirsdlg.menuitemviewright.caption","sourcebytes":[86,105,101,119,32,114,105,103,104,116],"value":"View right"},
{"hash":174352581,"name":"tfrmsyncdirsdlg.menuitemcompare.caption","sourcebytes":[67,111,109,112,97,114,101],"value":"Compare"},
{"hash":2265465,"name":"tfrmsyncdirsdlg.actselectcopylefttoright.caption","sourcebytes":[83,101,108,101,99,116,32,102,111,114,32,99,111,112,121,105,110,103,32,45,62,32,40,108,101,102,116,32,116,111,32,114,105,103,104,116,41],"value":"Select for copying -> (left to right)"},
{"hash":71953785,"name":"tfrmsyncdirsdlg.actselectcopyrighttoleft.caption","sourcebytes":[83,101,108,101,99,116,32,102,111,114,32,99,111,112,121,105,110,103,32,60,45,32,40,114,105,103,104,116,32,116,111,32,108,101,102,116,41],"value":"Select for copying <- (right to left)"},
{"hash":14033049,"name":"tfrmsyncdirsdlg.actselectcopydefault.caption","sourcebytes":[83,101,108,101,99,116,32,102,111,114,32,99,111,112,121,105,110,103,32,40,100,101,102,97,117,108,116,32,100,105,114,101,99,116,105,111,110,41],"value":"Select for copying (default direction)"},
{"hash":74996318,"name":"tfrmsyncdirsdlg.actselectclear.caption","sourcebytes":[82,101,109,111,118,101,32,115,101,108,101,99,116,105,111,110],"value":"Remove selection"},
{"hash":39665470,"name":"tfrmsyncdirsdlg.actselectcopyreverse.caption","sourcebytes":[82,101,118,101,114,115,101,32,99,111,112,121,32,100,105,114,101,99,116,105,111,110],"value":"Reverse copy direction"},
{"hash":38619657,"name":"tfrmsyncdirsdlg.actselectdeleteright.caption","sourcebytes":[83,101,108,101,99,116,32,102,111,114,32,100,101,108,101,116,105,110,103,32,45,62,32,40,114,105,103,104,116,41],"value":"Select for deleting -> (right)"}
]}
{"version":1,"strings":[
{"hash":36754147,"name":"tfrmsyncdirsdlg.caption","sourcebytes":[83,121,110,99,104,114,111,110,105,122,101,32,100,105,114,101,99,116,111,114,105,101,115],"value":"Synchronize directories"},
{"hash":11530,"name":"tfrmsyncdirsdlg.cbextfilter.text","sourcebytes":[42,46,42],"value":"*.*"},
{"hash":1054,"name":"tfrmsyncdirsdlg.btnseldir1.caption","sourcebytes":[62,62],"value":">>"},
{"hash":1054,"name":"tfrmsyncdirsdlg.btnseldir2.caption","sourcebytes":[62,62],"value":">>"},
{"hash":174352581,"name":"tfrmsyncdirsdlg.btncompare.caption","sourcebytes":[67,111,109,112,97,114,101],"value":"Compare"},
{"hash":242752852,"name":"tfrmsyncdirsdlg.chkonlyselected.caption","sourcebytes":[111,110,108,121,32,115,101,108,101,99,116,101,100],"value":"only selected"},
{"hash":181520105,"name":"tfrmsyncdirsdlg.label1.caption","sourcebytes":[40,105,110,32,109,97,105,110,32,119,105,110,100,111,119,41],"value":"(in main window)"},
{"hash":70923251,"name":"tfrmsyncdirsdlg.chkasymmetric.caption","sourcebytes":[97,115,121,109,109,101,116,114,105,99],"value":"asymmetric"},
{"hash":179876035,"name":"tfrmsyncdirsdlg.chksubdirs.caption","sourcebytes":[83,117,98,100,105,114,115],"value":"Subdirs"},
{"hash":174272820,"name":"tfrmsyncdirsdlg.chkbycontent.caption","sourcebytes":[98,121,32,99,111,110,116,101,110,116],"value":"by content"},
{"hash":135876037,"name":"tfrmsyncdirsdlg.chkignoredate.caption","sourcebytes":[105,103,110,111,114,101,32,100,97,116,101],"value":"ignore date"},
{"hash":5895850,"name":"tfrmsyncdirsdlg.groupbox1.caption","sourcebytes":[83,104,111,119,58],"value":"Show:"},
{"hash":62,"name":"tfrmsyncdirsdlg.sbcopyright.caption","sourcebytes":[62],"value":">"},
{"hash":61,"name":"tfrmsyncdirsdlg.sbequal.caption","sourcebytes":[61],"value":"="},
{"hash":589,"name":"tfrmsyncdirsdlg.sbnotequal.caption","sourcebytes":[33,61],"value":"!="},
{"hash":60,"name":"tfrmsyncdirsdlg.sbcopyleft.caption","sourcebytes":[60],"value":"<"},
{"hash":50280115,"name":"tfrmsyncdirsdlg.sbduplicates.caption","sourcebytes":[100,117,112,108,105,99,97,116,101,115],"value":"duplicates"},
{"hash":168092339,"name":"tfrmsyncdirsdlg.sbsingles.caption","sourcebytes":[115,105,110,103,108,101,115],"value":"singles"},
{"hash":267343253,"name":"tfrmsyncdirsdlg.btnsynchronize.caption","sourcebytes":[83,121,110,99,104,114,111,110,105,122,101],"value":"Synchronize"},
{"hash":4863637,"name":"tfrmsyncdirsdlg.btnclose.caption","sourcebytes":[67,108,111,115,101],"value":"Close"},
{"hash":197576788,"name":"tfrmsyncdirsdlg.statusbar1.panels[0].text","sourcebytes":[80,108,101,97,115,101,32,112,114,101,115,115,32,34,67,111,109,112,97,114,101,34,32,116,111,32,115,116,97,114,116],"value":"Please press \"Compare\" to start"},
{"hash":346165,"name":"tfrmsyncdirsdlg.headerdg.columns[0].title.caption","sourcebytes":[78,97,109,101],"value":"Name"},
{"hash":368901,"name":"tfrmsyncdirsdlg.headerdg.columns[1].title.caption","sourcebytes":[83,105,122,101],"value":"Size"},
{"hash":305317,"name":"tfrmsyncdirsdlg.headerdg.columns[2].title.caption","sourcebytes":[68,97,116,101],"value":"Date"},
{"hash":16398,"name":"tfrmsyncdirsdlg.headerdg.columns[3].title.caption","sourcebytes":[60,61,62],"value":"<=>"},
{"hash":305317,"name":"tfrmsyncdirsdlg.headerdg.columns[4].title.caption","sourcebytes":[68,97,116,101],"value":"Date"},
{"hash":368901,"name":"tfrmsyncdirsdlg.headerdg.columns[5].title.caption","sourcebytes":[83,105,122,101],"value":"Size"},
{"hash":346165,"name":"tfrmsyncdirsdlg.headerdg.columns[6].title.caption","sourcebytes":[78,97,109,101],"value":"Name"},
{"hash":211253028,"name":"tfrmsyncdirsdlg.menuitemviewleft.caption","sourcebytes":[86,105,101,119,32,108,101,102,116],"value":"View left"},
{"hash":159199796,"name":"tfrmsyncdirsdlg.menuitemviewright.caption","sourcebytes":[86,105,101,119,32,114,105,103,104,116],"value":"View right"},
{"hash":174352581,"name":"tfrmsyncdirsdlg.menuitemcompare.caption","sourcebytes":[67,111,109,112,97,114,101],"value":"Compare"},
{"hash":2265465,"name":"tfrmsyncdirsdlg.actselectcopylefttoright.caption","sourcebytes":[83,101,108,101,99,116,32,102,111,114,32,99,111,112,121,105,110,103,32,45,62,32,40,108,101,102,116,32,116,111,32,114,105,103,104,116,41],"value":"Select for copying -> (left to right)"},
{"hash":71953785,"name":"tfrmsyncdirsdlg.actselectcopyrighttoleft.caption","sourcebytes":[83,101,108,101,99,116,32,102,111,114,32,99,111,112,121,105,110,103,32,60,45,32,40,114,105,103,104,116,32,116,111,32,108,101,102,116,41],"value":"Select for copying <- (right to left)"},
{"hash":14033049,"name":"tfrmsyncdirsdlg.actselectcopydefault.caption","sourcebytes":[83,101,108,101,99,116,32,102,111,114,32,99,111,112,121,105,110,103,32,40,100,101,102,97,117,108,116,32,100,105,114,101,99,116,105,111,110,41],"value":"Select for copying (default direction)"},
{"hash":74996318,"name":"tfrmsyncdirsdlg.actselectclear.caption","sourcebytes":[82,101,109,111,118,101,32,115,101,108,101,99,116,105,111,110],"value":"Remove selection"},
{"hash":39665470,"name":"tfrmsyncdirsdlg.actselectcopyreverse.caption","sourcebytes":[82,101,118,101,114,115,101,32,99,111,112,121,32,100,105,114,101,99,116,105,111,110],"value":"Reverse copy direction"},
{"hash":38619657,"name":"tfrmsyncdirsdlg.actselectdeleteright.caption","sourcebytes":[83,101,108,101,99,116,32,102,111,114,32,100,101,108,101,116,105,110,103,32,45,62,32,40,114,105,103,104,116,41],"value":"Select for deleting -> (right)"},
{"hash":87943924,"name":"tfrmsyncdirsdlg.actdeleteleft.caption","sourcebytes":[60,45,32,68,101,108,101,116,101,32,108,101,102,116],"value":"<- Delete left"},
{"hash":64282708,"name":"tfrmsyncdirsdlg.actdeleteright.caption","sourcebytes":[45,62,32,68,101,108,101,116,101,32,114,105,103,104,116],"value":"-> Delete right"},
{"hash":5492659,"name":"tfrmsyncdirsdlg.actdeleteboth.caption","sourcebytes":[68,101,108,101,116,101,32,111,110,32,98,111,116,104,32,115,105,100,101,115],"value":"Delete on both sides"}
]}

View file

@ -4,7 +4,7 @@
Directories synchronization utility (specially for DC)
Copyright (C) 2013 Anton Panferov (ast.a_s@mail.ru)
Copyright (C) 2014-2018 Alexander Koblov (alexx2000@mail.ru)
Copyright (C) 2014-2019 Alexander Koblov (alexx2000@mail.ru)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -50,6 +50,9 @@ type
{ TfrmSyncDirsDlg }
TfrmSyncDirsDlg = class(TForm, IFormCommands)
actDeleteLeft: TAction;
actDeleteRight: TAction;
actDeleteBoth: TAction;
actSelectDeleteRight: TAction;
actSelectCopyReverse: TAction;
actSelectClear: TAction;
@ -79,6 +82,10 @@ type
Label1: TLabel;
LeftPanel1: TPanel;
LeftPanel2: TPanel;
miDeleteBoth: TMenuItem;
miDeleteRight: TMenuItem;
miDeleteLeft: TMenuItem;
miSeparator3: TMenuItem;
miSelectDeleteRight: TMenuItem;
miSeparator2: TMenuItem;
miSelectCopyReverse: TMenuItem;
@ -162,6 +169,10 @@ type
procedure UpdateSelection(R: Integer);
procedure EnableControls(AEnabled: Boolean);
procedure SetSyncRecState(AState: TSyncRecState);
procedure DeleteFiles(ALeft, ARight: Boolean);
function DeleteFiles(FileSource: IFileSource; var Files: TFiles): Boolean;
procedure UpdateList(ALeft, ARight: TFiles; ARemoveLeft, ARemoveRight: Boolean);
private
property SortIndex: Integer read FSortIndex write SetSortIndex;
property Commands: TFormCommands read FCommands implements IFormCommands;
public
@ -176,6 +187,11 @@ type
procedure cm_SelectCopyReverse(const {%H-}Params:array of string);
procedure cm_SelectCopyLeftToRight(const {%H-}Params:array of string);
procedure cm_SelectCopyRightToLeft(const {%H-}Params:array of string);
procedure cm_DeleteLeft(const {%H-}Params:array of string);
procedure cm_DeleteRight(const {%H-}Params:array of string);
procedure cm_DeleteBoth(const {%H-}Params:array of string);
end;
resourcestring
@ -194,7 +210,7 @@ uses
fMain, uDebug, fDiffer, fSyncDirsPerformDlg, uGlobs, LCLType, LazUTF8, LazFileUtils,
DCClassesUtf8, uFileSystemFileSource, uFileSourceOperationOptions, DCDateTimeUtils,
uDCUtils, uFileSourceUtil, uFileSourceOperationTypes, uShowForm,
uFileSourceDeleteOperation, uOSUtils, uLng, uMasks;
uFileSourceDeleteOperation, uOSUtils, uLng, uMasks, Math;
{$R *.lfm}
@ -514,24 +530,6 @@ var
end;
end;
function DeleteFiles(FileSource: IFileSource; Files: TFiles): Boolean;
begin
Files.Path := Files[0].Path;
FOperation:= FileSource.CreateDeleteOperation(Files);
if not Assigned(FOperation) then
begin
MessageDlg(rsMsgErrNotSupported, mtError, [mbOK], 0);
Exit(False);
end;
FOperation.AddUserInterface(FFileSourceOperationMessageBoxesUI);
try
FOperation.Execute;
Result := FOperation.Result = fsorFinished;
finally
FreeAndNil(FOperation);
end;
end;
var
i,
DeleteRightCount,
@ -1465,6 +1463,143 @@ begin
end;
end;
procedure TfrmSyncDirsDlg.DeleteFiles(ALeft, ARight: Boolean);
var
Message: String;
ALeftList: TFiles;
ARightList: TFiles;
begin
if not ALeft then
ALeftList:= nil
else begin
ALeftList:= TFiles.Create(EmptyStr);
end;
if not ARight then
ARightList:= nil
else begin
ARightList:= TFiles.Create(EmptyStr);
end;
try
Message:= EmptyStr;
UpdateList(ALeftList, ARightList, False, False);
if ALeft and (ALeftList.Count > 0) then
Message:= Format(rsVarLeftPanel + ': ' + rsMsgDelFlDr, [ALeftList.Count]) + LineEnding;
if ARight and (ARightList.Count > 0) then
Message+= Format(rsVarRightPanel + ': ' + rsMsgDelFlDr, [ARightList.Count]) + LineEnding;
if MessageDlg(Message, mtWarning, [mbYes, mbNo], 0, mbYes) = mrYes then
begin
ALeft:= ALeft and (ALeftList.Count > 0);
ARight:= ARight and (ARightList.Count > 0);
if ALeft then DeleteFiles(FCmpFileSourceL, ALeftList);
if ARight then DeleteFiles(FCmpFileSourceR, ARightList);
UpdateList(nil, nil, ALeft, ARight);
end;
finally
ALeftList.Free;
ARightList.Free;
end;
end;
function TfrmSyncDirsDlg.DeleteFiles(FileSource: IFileSource; var Files: TFiles): Boolean;
begin
Files.Path := Files[0].Path;
FOperation:= FileSource.CreateDeleteOperation(Files);
if not Assigned(FOperation) then
begin
MessageDlg(rsMsgErrNotSupported, mtError, [mbOK], 0);
Exit(False);
end;
FOperation.AddUserInterface(FFileSourceOperationMessageBoxesUI);
try
FOperation.Execute;
Result := FOperation.Result = fsorFinished;
finally
FreeAndNil(FOperation);
end;
end;
procedure TfrmSyncDirsDlg.UpdateList(ALeft, ARight: TFiles; ARemoveLeft,
ARemoveRight: Boolean);
var
R, Y: Integer;
ARemove: Boolean;
Selection: TGridRect;
SyncRec: TFileSyncRec;
procedure AddRemoveItem;
begin
if Assigned(ALeft) and Assigned(SyncRec.FFileL) then
ALeft.Add(SyncRec.FFileL.Clone);
if Assigned(ARight) and Assigned(SyncRec.FFileR) then
ARight.Add(SyncRec.FFileR.Clone);
if ARemove then
begin
if ARemoveLeft and Assigned(SyncRec.FFileL) then
FreeAndNil(SyncRec.FFileL);
if ARemoveRight and Assigned(SyncRec.FFileR) then
FreeAndNil(SyncRec.FFileR);
if Assigned(SyncRec.FFileL) or Assigned(SyncRec.FFileR) then
SyncRec.UpdateState(chkIgnoreDate.Checked)
else begin
MainDrawGrid.DeleteRow(R);
FVisibleItems.Delete(R);
end;
end;
end;
begin
Selection:= MainDrawGrid.Selection;
ARemove:= ARemoveLeft or ARemoveRight;
if (MainDrawGrid.HasMultiSelection) or (Selection.Bottom <> Selection.Top) then
begin
if ARemove then MainDrawGrid.BeginUpdate;
for Y:= 0 to MainDrawGrid.SelectedRangeCount - 1 do
begin
Selection:= MainDrawGrid.SelectedRange[Y];
for R := Selection.Bottom downto Selection.Top do
begin
SyncRec := TFileSyncRec(FVisibleItems.Objects[R]);
if Assigned(SyncRec) then AddRemoveItem;
end;
end;
if ARemove then MainDrawGrid.EndUpdate;
Exit;
end;
R := MainDrawGrid.Row;
if (R < 0) or (R >= FVisibleItems.Count) then Exit;
SyncRec := TFileSyncRec(FVisibleItems.Objects[r]);
if ARemove then MainDrawGrid.BeginUpdate;
if Assigned(SyncRec) then
begin
AddRemoveItem;
end
else begin
Y:= R;
Inc(R);
while R < FVisibleItems.Count do
begin
if (FVisibleItems.Objects[R] = nil) then Break;
Inc(R);
end;
Dec(R);
while R > Y do
begin
SyncRec := TFileSyncRec(FVisibleItems.Objects[R]);
AddRemoveItem;
Dec(R);
end;
end;
if ARemove then MainDrawGrid.EndUpdate;
end;
constructor TfrmSyncDirsDlg.Create(AOwner: TComponent; FileView1,
FileView2: TFileView);
var
@ -1519,6 +1654,11 @@ begin
chkByContent.Enabled := FFileSourceL.IsClass(TFileSystemFileSource) and
FFileSourceR.IsClass(TFileSystemFileSource);
chkAsymmetric.Enabled := fsoDelete in FileView2.FileSource.GetOperationsTypes;
// ---------------------------------------------------------------------------
actDeleteLeft.Enabled := fsoDelete in FileView1.FileSource.GetOperationsTypes;
actDeleteRight.Enabled := fsoDelete in FileView2.FileSource.GetOperationsTypes;
actDeleteBoth.Enabled := actDeleteLeft.Enabled and actDeleteRight.Enabled;
// ---------------------------------------------------------------------------
FFileSourceOperationMessageBoxesUI := TFileSourceOperationMessageBoxesUI.Create;
if (FFileSourceL.IsClass(TFileSystemFileSource)) and (FFileSourceR.IsClass(TFileSystemFileSource)) then
begin
@ -1570,6 +1710,21 @@ begin
SetSyncRecState(srsCopyLeft);
end;
procedure TfrmSyncDirsDlg.cm_DeleteLeft(const Params: array of string);
begin
DeleteFiles(True, False);
end;
procedure TfrmSyncDirsDlg.cm_DeleteRight(const Params: array of string);
begin
DeleteFiles(False, True);
end;
procedure TfrmSyncDirsDlg.cm_DeleteBoth(const Params: array of string);
begin
DeleteFiles(True, True);
end;
initialization
TFormCommands.RegisterCommandsForm(TfrmSyncDirsDlg, HotkeysCategory, @rsHotkeyCategorySyncDirs);