mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
ADD: Save synchronize directories options (patch by Anton Panferov)
This commit is contained in:
parent
d49ce6ae03
commit
8e8bc6f8ed
3 changed files with 82 additions and 7 deletions
|
|
@ -7,6 +7,7 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
|
|||
ClientHeight = 438
|
||||
ClientWidth = 691
|
||||
KeyPreview = True
|
||||
OnClose = FormClose
|
||||
OnKeyDown = FormKeyDown
|
||||
Position = poScreenCenter
|
||||
ShowInTaskBar = stAlways
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@
|
|||
|
||||
Copyright (C) 2013 Anton Panferov (ast.a_s@mail.ru)
|
||||
|
||||
TODO:
|
||||
save options
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
|
|
@ -72,6 +69,7 @@ type
|
|||
procedure btnSelDir1Click(Sender: TObject);
|
||||
procedure btnCompareClick(Sender: TObject);
|
||||
procedure btnSynchronizeClick(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
procedure MainDrawGridDblClick(Sender: TObject);
|
||||
procedure MainDrawGridDrawCell(Sender: TObject; aCol, aRow: Integer;
|
||||
aRect: TRect; aState: TGridDrawState);
|
||||
|
|
@ -127,8 +125,8 @@ procedure ShowSyncDirsDlg(FileView1, FileView2: TFileView);
|
|||
implementation
|
||||
|
||||
uses
|
||||
fMain, uDebug, fDiffer, fSyncDirsPerformDlg, LCLType, LazUTF8, DCClassesUtf8,
|
||||
uFileSystemFileSource;
|
||||
fMain, uDebug, fDiffer, fSyncDirsPerformDlg, uGlobs, LCLType, LazUTF8,
|
||||
DCClassesUtf8, uFileSystemFileSource;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
|
|
@ -464,6 +462,21 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSyncDirsDlg.FormClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
begin
|
||||
{ settings }
|
||||
gSyncDirsSubdirs := chkSubDirs.Checked;
|
||||
gSyncDirsByContent := chkByContent.Checked;
|
||||
gSyncDirsIgnoreDate := chkIgnoreDate.Checked;
|
||||
gSyncDirsShowFilterCopyRight := sbCopyRight.Down;
|
||||
gSyncDirsShowFilterEqual := sbEqual.Down;
|
||||
gSyncDirsShowFilterNotEqual := sbNotEqual.Down;
|
||||
gSyncDirsShowFilterCopyLeft := sbCopyLeft.Down;
|
||||
gSyncDirsShowFilterDuplicates := sbDuplicates.Down;
|
||||
gSyncDirsShowFilterSingles := sbSingles.Down;
|
||||
end;
|
||||
|
||||
procedure TfrmSyncDirsDlg.MainDrawGridDblClick(Sender: TObject);
|
||||
var
|
||||
r: Integer;
|
||||
|
|
@ -606,7 +619,7 @@ begin
|
|||
s := HeaderDG.Columns[AValue].Title.Caption;
|
||||
UTF8Delete(s, 1, 1);
|
||||
FSortDesc := not FSortDesc;
|
||||
if FSortDesc then s := '^' + s else s := 'v' + s;
|
||||
if FSortDesc then s := '↑' + s else s := '↓' + s;
|
||||
HeaderDG.Columns[AValue].Title.Caption := s;
|
||||
SortFoundItems;
|
||||
FillFoundItemsDG;
|
||||
|
|
@ -620,7 +633,7 @@ begin
|
|||
FSortIndex := AValue;
|
||||
FSortDesc := False;
|
||||
with HeaderDG.Columns[FSortIndex].Title do
|
||||
Caption := 'v' + Caption;
|
||||
Caption := '↓' + Caption;
|
||||
SortFoundItems;
|
||||
FillFoundItemsDG;
|
||||
end;
|
||||
|
|
@ -1050,6 +1063,17 @@ begin
|
|||
FSortIndex := -1;
|
||||
SortIndex := 0;
|
||||
FSortDesc := False;
|
||||
MainDrawGrid.RowCount := 0;
|
||||
{ settings }
|
||||
chkSubDirs.Checked := gSyncDirsSubdirs;
|
||||
chkByContent.Checked := gSyncDirsByContent;
|
||||
chkIgnoreDate.Checked := gSyncDirsIgnoreDate;
|
||||
sbCopyRight.Down := gSyncDirsShowFilterCopyRight;
|
||||
sbEqual.Down := gSyncDirsShowFilterEqual;
|
||||
sbNotEqual.Down := gSyncDirsShowFilterNotEqual;
|
||||
sbCopyLeft.Down := gSyncDirsShowFilterCopyLeft;
|
||||
sbDuplicates.Down := gSyncDirsShowFilterDuplicates;
|
||||
sbSingles.Down := gSyncDirsShowFilterSingles;
|
||||
end;
|
||||
|
||||
destructor TfrmSyncDirsDlg.Destroy;
|
||||
|
|
|
|||
|
|
@ -346,6 +346,17 @@ var
|
|||
gBookFontColor: TColor;
|
||||
gTextPosition:PtrInt;
|
||||
|
||||
{SyncDirs}
|
||||
gSyncDirsSubdirs,
|
||||
gSyncDirsByContent,
|
||||
gSyncDirsIgnoreDate,
|
||||
gSyncDirsShowFilterCopyRight,
|
||||
gSyncDirsShowFilterEqual,
|
||||
gSyncDirsShowFilterNotEqual,
|
||||
gSyncDirsShowFilterCopyLeft,
|
||||
gSyncDirsShowFilterDuplicates,
|
||||
gSyncDirsShowFilterSingles: Boolean;
|
||||
|
||||
gUseShellForFileOperations: Boolean;
|
||||
|
||||
function LoadConfig: Boolean;
|
||||
|
|
@ -1191,6 +1202,17 @@ begin
|
|||
gTextPosition:= 0;
|
||||
gViewerMode:= 0;
|
||||
|
||||
{SyncDirs}
|
||||
gSyncDirsSubdirs := False;
|
||||
gSyncDirsByContent := False;
|
||||
gSyncDirsIgnoreDate := False;
|
||||
gSyncDirsShowFilterCopyRight := True;
|
||||
gSyncDirsShowFilterEqual := True;
|
||||
gSyncDirsShowFilterNotEqual := True;
|
||||
gSyncDirsShowFilterCopyLeft := True;
|
||||
gSyncDirsShowFilterDuplicates := True;
|
||||
gSyncDirsShowFilterSingles := True;
|
||||
|
||||
{ - Other - }
|
||||
gGoToRoot := False;
|
||||
gLuaLib := LuaDLL;
|
||||
|
|
@ -2242,6 +2264,22 @@ begin
|
|||
gThumbSave := GetValue(Node, 'SaveThumbnails', gThumbSave);
|
||||
end;
|
||||
end;
|
||||
|
||||
{ SyncDirs }
|
||||
Node := Root.FindNode('SyncDirs');
|
||||
if Assigned(Node) then
|
||||
begin
|
||||
gSyncDirsSubdirs := GetValue(Node, 'Subdirs', gSyncDirsSubdirs);
|
||||
gSyncDirsByContent := GetValue(Node, 'ByContent', gSyncDirsByContent);
|
||||
gSyncDirsIgnoreDate := GetValue(Node, 'IgnoreDate', gSyncDirsIgnoreDate);
|
||||
gSyncDirsShowFilterCopyRight := GetValue(Node, 'FilterCopyRight', gSyncDirsShowFilterCopyRight);
|
||||
gSyncDirsShowFilterEqual := GetValue(Node, 'FilterEqual', gSyncDirsShowFilterEqual);
|
||||
gSyncDirsShowFilterNotEqual := GetValue(Node, 'FilterNotEqual', gSyncDirsShowFilterNotEqual);
|
||||
gSyncDirsShowFilterCopyLeft := GetValue(Node, 'FilterCopyLeft', gSyncDirsShowFilterCopyLeft);
|
||||
gSyncDirsShowFilterDuplicates := GetValue(Node, 'FilterDuplicates', gSyncDirsShowFilterDuplicates);
|
||||
gSyncDirsShowFilterSingles := GetValue(Node, 'FilterSingles', gSyncDirsShowFilterSingles);
|
||||
end;
|
||||
|
||||
{ - Other - }
|
||||
gLuaLib := GetValue(Root, 'Lua/PathToLibrary', gLuaLib);
|
||||
gNameSCFile:= GetValue(Root, 'NameShortcutFile', gNameSCFile);
|
||||
|
|
@ -2538,6 +2576,18 @@ begin
|
|||
SetValue(Node, 'FontColor', gBookFontColor);
|
||||
SetValue(Node, 'TextPosition', gTextPosition);
|
||||
|
||||
{ SyncDirs }
|
||||
Node := FindNode(Root, 'SyncDirs', True);
|
||||
SetValue(Node, 'Subdirs', gSyncDirsSubdirs);
|
||||
SetValue(Node, 'ByContent', gSyncDirsByContent);
|
||||
SetValue(Node, 'IgnoreDate', gSyncDirsIgnoreDate);
|
||||
SetValue(Node, 'FilterCopyRight', gSyncDirsShowFilterCopyRight);
|
||||
SetValue(Node, 'FilterEqual', gSyncDirsShowFilterEqual);
|
||||
SetValue(Node, 'FilterNotEqual', gSyncDirsShowFilterNotEqual);
|
||||
SetValue(Node, 'FilterCopyLeft', gSyncDirsShowFilterCopyLeft);
|
||||
SetValue(Node, 'FilterDuplicates', gSyncDirsShowFilterDuplicates);
|
||||
SetValue(Node, 'FilterSingles', gSyncDirsShowFilterSingles);
|
||||
|
||||
{ - Other - }
|
||||
SetValue(Root, 'Lua/PathToLibrary', gLuaLib);
|
||||
SetValue(Root, 'NameShortcutFile', gNameSCFile);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue