ADD: Save file search start directory history

This commit is contained in:
Alexander Koblov 2017-02-05 08:54:52 +00:00
commit e795a8748e
3 changed files with 194 additions and 163 deletions

View file

@ -4,7 +4,7 @@ object frmFindDlg: TfrmFindDlg
Top = 176
Width = 875
Caption = 'Find files'
ClientHeight = 390
ClientHeight = 382
ClientWidth = 875
Constraints.MinHeight = 360
Constraints.MinWidth = 585
@ -21,20 +21,20 @@ object frmFindDlg: TfrmFindDlg
LCLVersion = '1.6.0.4'
object pnlFindFile: TPanel
Left = 3
Height = 384
Height = 376
Top = 3
Width = 869
Align = alClient
BorderSpacing.Around = 3
BevelOuter = bvNone
ClientHeight = 384
ClientHeight = 376
ClientWidth = 869
TabOrder = 0
object pgcSearch: TPageControl
Left = 0
Height = 384
Height = 376
Top = 0
Width = 760
Width = 763
ActivePage = tsStandard
Align = alClient
TabIndex = 0
@ -44,8 +44,8 @@ object frmFindDlg: TfrmFindDlg
Caption = 'Standard'
ChildSizing.LeftRightSpacing = 3
ChildSizing.TopBottomSpacing = 3
ClientHeight = 356
ClientWidth = 752
ClientHeight = 348
ClientWidth = 759
OnEnter = tsStandardEnter
object gbDirectories: TGroupBox
AnchorSideLeft.Control = tsStandard
@ -53,15 +53,15 @@ object frmFindDlg: TfrmFindDlg
AnchorSideRight.Control = tsStandard
AnchorSideRight.Side = asrBottom
Left = 3
Height = 116
Height = 123
Top = 3
Width = 746
Width = 753
Anchors = [akTop, akLeft, akRight]
AutoSize = True
Caption = 'Directories'
ChildSizing.LeftRightSpacing = 5
ClientHeight = 96
ClientWidth = 742
ClientHeight = 101
ClientWidth = 749
TabOrder = 0
OnResize = gbDirectoriesResize
object lblFindPathStart: TLabel
@ -69,50 +69,61 @@ object frmFindDlg: TfrmFindDlg
AnchorSideBottom.Control = cbFollowSymLinks
AnchorSideBottom.Side = asrBottom
Left = 5
Height = 15
Top = 4
Width = 87
Height = 18
Top = 5
Width = 101
Anchors = [akLeft, akBottom]
Caption = 'Start in &directory'
FocusControl = edtFindPathStart
FocusControl = cmbFindPathStart
ParentColor = False
end
object cbFollowSymLinks: TCheckBox
AnchorSideTop.Control = gbDirectories
AnchorSideRight.Control = gbDirectories
AnchorSideRight.Side = asrBottom
Left = 633
Height = 19
Left = 625
Height = 23
Top = 0
Width = 104
Width = 119
Anchors = [akTop, akRight]
Caption = 'Follow s&ymlinks'
TabOrder = 0
end
object edtFindPathStart: TDirectoryEdit
object cmbFindPathStart: TComboBoxWithDelItems
AnchorSideLeft.Control = lblFindPathStart
AnchorSideTop.Control = cbFollowSymLinks
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
AnchorSideRight.Control = btnChooseFolder
Left = 5
Height = 23
Top = 19
Width = 706
ShowHidden = False
ButtonWidth = 23
NumGlyphs = 1
Height = 24
Top = 23
Width = 714
Anchors = [akTop, akLeft, akRight]
MaxLength = 0
BorderSpacing.Right = 2
ItemHeight = 18
TabOrder = 1
end
object btnChooseFolder: TSpeedButton
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cmbFindPathStart
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = cmbFindPathStart
AnchorSideBottom.Side = asrBottom
Left = 721
Height = 24
Top = 23
Width = 23
Anchors = [akTop, akRight, akBottom]
OnClick = btnSelDirClick
end
object lblExcludeDirectories: TLabel
AnchorSideLeft.Control = edtFindPathStart
AnchorSideTop.Control = edtFindPathStart
AnchorSideLeft.Control = cmbFindPathStart
AnchorSideTop.Control = cmbFindPathStart
AnchorSideTop.Side = asrBottom
Left = 5
Height = 15
Top = 45
Width = 117
Height = 18
Top = 50
Width = 135
BorderSpacing.Top = 3
Caption = 'E&xclude subdirectories'
FocusControl = cmbExcludeDirectories
@ -124,14 +135,14 @@ object frmFindDlg: TfrmFindDlg
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = pnlDirectoriesDepth
Left = 5
Height = 23
Height = 24
Hint = 'Enter directories names that should be excluded from search separated with ";"'
Top = 60
Width = 527
Top = 68
Width = 534
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Right = 5
BorderSpacing.Bottom = 5
ItemHeight = 15
ItemHeight = 18
ParentShowHint = False
ShowHint = True
TabOrder = 2
@ -140,9 +151,9 @@ object frmFindDlg: TfrmFindDlg
AnchorSideTop.Control = lblExcludeDirectories
AnchorSideRight.Control = gbDirectories
AnchorSideRight.Side = asrBottom
Left = 537
Left = 544
Height = 51
Top = 45
Top = 50
Width = 200
Anchors = [akTop, akRight]
BevelOuter = bvNone
@ -154,7 +165,7 @@ object frmFindDlg: TfrmFindDlg
TabOrder = 3
object lblSearchDepth: TLabel
Left = 0
Height = 15
Height = 18
Top = 0
Width = 200
Caption = 'Search su&bdirectories:'
@ -163,10 +174,10 @@ object frmFindDlg: TfrmFindDlg
end
object cmbSearchDepth: TComboBox
Left = 0
Height = 23
Top = 15
Height = 24
Top = 18
Width = 200
ItemHeight = 15
ItemHeight = 18
Style = csDropDownList
TabOrder = 0
end
@ -176,10 +187,10 @@ object frmFindDlg: TfrmFindDlg
AnchorSideRight.Control = cbFollowSymLinks
AnchorSideBottom.Control = cbFollowSymLinks
AnchorSideBottom.Side = asrBottom
Left = 458
Height = 19
Left = 425
Height = 23
Top = 0
Width = 169
Width = 194
Anchors = [akRight, akBottom]
BorderSpacing.Right = 6
Caption = 'Selected directories and &files'
@ -190,10 +201,10 @@ object frmFindDlg: TfrmFindDlg
AnchorSideRight.Control = cbSelectedFiles
AnchorSideBottom.Control = cbSelectedFiles
AnchorSideBottom.Side = asrBottom
Left = 365
Height = 19
Left = 317
Height = 23
Top = 0
Width = 87
Width = 102
Anchors = [akRight, akBottom]
BorderSpacing.Right = 6
Caption = 'Opened tabs'
@ -208,24 +219,24 @@ object frmFindDlg: TfrmFindDlg
AnchorSideRight.Control = tsStandard
AnchorSideRight.Side = asrBottom
Left = 3
Height = 108
Top = 119
Width = 746
Height = 119
Top = 126
Width = 753
Anchors = [akTop, akLeft, akRight]
AutoSize = True
Caption = 'Files'
ChildSizing.LeftRightSpacing = 5
ClientHeight = 88
ClientWidth = 742
ClientHeight = 97
ClientWidth = 749
TabOrder = 1
object lblFindFileMask: TLabel
AnchorSideLeft.Control = gbFiles
AnchorSideBottom.Control = cbPartialNameSearch
AnchorSideBottom.Side = asrBottom
Left = 5
Height = 15
Top = 4
Width = 51
Height = 18
Top = 5
Width = 63
Anchors = [akLeft, akBottom]
Caption = '&File mask'
FocusControl = cmbFindFileMask
@ -240,12 +251,12 @@ object frmFindDlg: TfrmFindDlg
AnchorSideRight.Control = gbFiles
AnchorSideRight.Side = asrBottom
Left = 5
Height = 23
Height = 24
Hint = 'Enter files names separated with ";"'
Top = 19
Width = 732
Top = 23
Width = 739
Anchors = [akTop, akLeft, akRight]
ItemHeight = 15
ItemHeight = 18
ParentShowHint = False
ShowHint = True
TabOrder = 0
@ -256,9 +267,9 @@ object frmFindDlg: TfrmFindDlg
AnchorSideTop.Control = cmbFindFileMask
AnchorSideTop.Side = asrBottom
Left = 5
Height = 15
Top = 45
Width = 64
Height = 18
Top = 50
Width = 74
BorderSpacing.Top = 3
Caption = '&Exclude files'
FocusControl = cmbExcludeFiles
@ -271,13 +282,13 @@ object frmFindDlg: TfrmFindDlg
AnchorSideRight.Control = gbFiles
AnchorSideRight.Side = asrBottom
Left = 5
Height = 23
Height = 24
Hint = 'Enter files names that should be excluded from search separated with ";"'
Top = 60
Width = 732
Top = 68
Width = 739
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 5
ItemHeight = 15
ItemHeight = 18
ParentShowHint = False
ShowHint = True
TabOrder = 1
@ -286,10 +297,10 @@ object frmFindDlg: TfrmFindDlg
AnchorSideRight.Control = cbRegExp
AnchorSideBottom.Control = cbRegExp
AnchorSideBottom.Side = asrBottom
Left = 450
Height = 19
Left = 414
Height = 23
Top = 0
Width = 163
Width = 186
Anchors = [akRight, akBottom]
BorderSpacing.Right = 6
Caption = 'Searc&h for part of file name'
@ -302,10 +313,10 @@ object frmFindDlg: TfrmFindDlg
AnchorSideTop.Control = gbFiles
AnchorSideRight.Control = gbFiles
AnchorSideRight.Side = asrBottom
Left = 619
Height = 19
Left = 606
Height = 23
Top = 0
Width = 118
Width = 138
Anchors = [akTop, akRight]
Caption = '&Regular expression'
OnChange = cbRegExpChange
@ -315,10 +326,10 @@ object frmFindDlg: TfrmFindDlg
AnchorSideRight.Control = cbPartialNameSearch
AnchorSideBottom.Control = cbPartialNameSearch
AnchorSideBottom.Side = asrBottom
Left = 330
Height = 19
Left = 277
Height = 23
Top = 0
Width = 114
Width = 131
Anchors = [akRight, akBottom]
BorderSpacing.Right = 6
Caption = 'Search in &archives'
@ -333,15 +344,15 @@ object frmFindDlg: TfrmFindDlg
AnchorSideRight.Control = tsStandard
AnchorSideRight.Side = asrBottom
Left = 3
Height = 123
Top = 227
Width = 746
Height = 132
Top = 245
Width = 753
Anchors = [akTop, akLeft, akRight]
AutoSize = True
Caption = 'Find Data'
ChildSizing.TopBottomSpacing = 2
ClientHeight = 103
ClientWidth = 742
ClientHeight = 110
ClientWidth = 749
TabOrder = 2
object lblEncoding: TLabel
AnchorSideLeft.Control = gbFindData
@ -350,9 +361,9 @@ object frmFindDlg: TfrmFindDlg
AnchorSideRight.Control = CheksPanel
AnchorSideRight.Side = asrBottom
Left = 6
Height = 15
Top = 81
Width = 53
Height = 18
Top = 86
Width = 60
BorderSpacing.Left = 6
BorderSpacing.Top = 6
BorderSpacing.Right = 6
@ -365,10 +376,10 @@ object frmFindDlg: TfrmFindDlg
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cbNotContainingText
AnchorSideTop.Side = asrCenter
Left = 239
Height = 19
Top = 55
Width = 93
Left = 267
Height = 23
Top = 57
Width = 108
BorderSpacing.Left = 36
BorderSpacing.Top = 4
BorderSpacing.Bottom = 8
@ -381,9 +392,9 @@ object frmFindDlg: TfrmFindDlg
AnchorSideTop.Control = cmbReplaceText
AnchorSideTop.Side = asrBottom
Left = 6
Height = 19
Top = 55
Width = 197
Height = 23
Top = 57
Width = 225
BorderSpacing.Top = 4
Caption = 'Find files N&OT containing the text'
TabOrder = 3
@ -392,13 +403,13 @@ object frmFindDlg: TfrmFindDlg
AnchorSideLeft.Control = cmbReplaceText
AnchorSideTop.Control = cbNotContainingText
AnchorSideTop.Side = asrBottom
Left = 112
Height = 23
Top = 77
Left = 128
Height = 24
Top = 83
Width = 100
BorderSpacing.Top = 3
BorderSpacing.Bottom = 3
ItemHeight = 15
ItemHeight = 18
OnSelect = cmbEncodingSelect
Style = csDropDownList
TabOrder = 6
@ -409,14 +420,14 @@ object frmFindDlg: TfrmFindDlg
AnchorSideTop.Control = gbFindData
AnchorSideRight.Control = gbFindData
AnchorSideRight.Side = asrBottom
Left = 112
Height = 23
Left = 128
Height = 24
Top = 2
Width = 627
Width = 618
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 3
BorderSpacing.Right = 3
ItemHeight = 15
ItemHeight = 18
TabOrder = 1
end
object cmbReplaceText: TComboBoxWithDelItems
@ -425,14 +436,14 @@ object frmFindDlg: TfrmFindDlg
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = gbFindData
AnchorSideRight.Side = asrBottom
Left = 112
Height = 23
Top = 28
Width = 627
Left = 128
Height = 24
Top = 29
Width = 618
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 3
BorderSpacing.Right = 3
ItemHeight = 15
ItemHeight = 18
TabOrder = 2
end
object CheksPanel: TPanel
@ -441,23 +452,23 @@ object frmFindDlg: TfrmFindDlg
AnchorSideBottom.Control = cmbReplaceText
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 49
Height = 51
Top = 2
Width = 109
Width = 125
Anchors = [akTop, akLeft, akBottom]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 49
ClientWidth = 109
ClientHeight = 51
ClientWidth = 125
TabOrder = 0
object cbFindText: TCheckBox
AnchorSideLeft.Control = CheksPanel
AnchorSideTop.Control = CheksPanel
AnchorSideRight.Side = asrBottom
Left = 6
Height = 19
Height = 23
Top = 2
Width = 97
Width = 113
BorderSpacing.Left = 6
BorderSpacing.Top = 2
BorderSpacing.Right = 6
@ -472,9 +483,9 @@ object frmFindDlg: TfrmFindDlg
AnchorSideBottom.Control = CheksPanel
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 19
Top = 28
Width = 77
Height = 23
Top = 26
Width = 89
Anchors = [akLeft, akBottom]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
@ -489,10 +500,10 @@ object frmFindDlg: TfrmFindDlg
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cbCaseSens
AnchorSideTop.Side = asrCenter
Left = 344
Height = 19
Top = 55
Width = 118
Left = 387
Height = 23
Top = 57
Width = 138
BorderSpacing.Left = 12
Caption = 'Regular &expression'
OnChange = cbTextRegExpChange
@ -564,7 +575,7 @@ object frmFindDlg: TfrmFindDlg
Width = 83
Anchors = [akTop, akLeft, akRight]
Enabled = False
ItemHeight = 15
ItemHeight = 18
Style = csDropDownList
TabOrder = 2
end
@ -651,7 +662,7 @@ object frmFindDlg: TfrmFindDlg
Width = 160
Anchors = [akTop, akLeft, akRight]
Enabled = False
ItemHeight = 15
ItemHeight = 18
Style = csDropDownList
TabOrder = 7
end
@ -916,7 +927,7 @@ object frmFindDlg: TfrmFindDlg
BorderSpacing.Left = 3
BorderSpacing.Top = 10
Enabled = False
ItemHeight = 15
ItemHeight = 18
TabOrder = 1
end
inline frmContentPlugins: TfrmSearchPlugin
@ -1269,10 +1280,10 @@ object frmFindDlg: TfrmFindDlg
end
end
object pnlButtons: TPanel
Left = 766
Height = 344
Left = 769
Height = 336
Top = 40
Width = 103
Width = 100
Align = alRight
Anchors = [akTop, akRight]
AutoSize = True
@ -1284,15 +1295,15 @@ object frmFindDlg: TfrmFindDlg
ChildSizing.ShrinkHorizontal = crsHomogenousChildResize
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 344
ClientWidth = 103
ClientHeight = 336
ClientWidth = 100
Constraints.MinWidth = 100
TabOrder = 1
object btnUseTemplate: TButton
Left = 0
Height = 33
Height = 38
Top = 0
Width = 103
Width = 100
AutoSize = True
BorderSpacing.InnerBorder = 4
Caption = 'Use template'
@ -1304,9 +1315,9 @@ object frmFindDlg: TfrmFindDlg
object btnSaveTemplate: TButton
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 33
Top = 39
Width = 103
Height = 38
Top = 44
Width = 100
AutoSize = True
BorderSpacing.InnerBorder = 4
Caption = '&Save'
@ -1318,9 +1329,9 @@ object frmFindDlg: TfrmFindDlg
end
object btnStart: TButton
Left = 0
Height = 33
Top = 78
Width = 103
Height = 38
Top = 88
Width = 100
Action = actStart
AutoSize = True
BorderSpacing.InnerBorder = 4
@ -1329,9 +1340,9 @@ object frmFindDlg: TfrmFindDlg
end
object btnStop: TButton
Left = 0
Height = 33
Top = 117
Width = 103
Height = 38
Top = 132
Width = 100
Action = actCancel
AutoSize = True
BorderSpacing.InnerBorder = 4
@ -1340,9 +1351,9 @@ object frmFindDlg: TfrmFindDlg
end
object btnClose: TButton
Left = 0
Height = 33
Top = 156
Width = 103
Height = 38
Top = 176
Width = 100
Action = actClose
AutoSize = True
BorderSpacing.InnerBorder = 4
@ -1351,9 +1362,9 @@ object frmFindDlg: TfrmFindDlg
end
object btnNewSearch: TButton
Left = 0
Height = 33
Top = 219
Width = 103
Height = 38
Top = 244
Width = 100
Action = actNewSearch
AutoSize = True
BorderSpacing.Top = 30
@ -1363,9 +1374,9 @@ object frmFindDlg: TfrmFindDlg
end
object btnLastSearch: TButton
Left = 0
Height = 33
Top = 258
Width = 103
Height = 38
Top = 288
Width = 100
Action = actLastSearch
AutoSize = True
BorderSpacing.InnerBorder = 4

View file

@ -4,7 +4,7 @@
Find dialog, with searching in thread
Copyright (C) 2003-2004 Radek Cervinka (radek.cervinka@centrum.cz)
Copyright (C) 2006-2016 Alexander Koblov (alexx2000@mail.ru)
Copyright (C) 2006-2017 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
@ -105,7 +105,7 @@ type
cmbFindText: TComboBoxWithDelItems;
cmbExcludeFiles: TComboBoxWithDelItems;
edtAttrib: TEdit;
edtFindPathStart: TDirectoryEdit;
cmbFindPathStart: TComboBoxWithDelItems;
frmContentPlugins: TfrmSearchPlugin;
gbDirectories: TGroupBox;
gbFiles: TGroupBox;
@ -139,6 +139,7 @@ type
seFileSizeTo: TSpinEdit;
pnlFindFile: TPanel;
pgcSearch: TPageControl;
btnChooseFolder: TSpeedButton;
tsPlugins: TTabSheet;
tsResults: TTabSheet;
tsLoadSave: TTabSheet;
@ -478,7 +479,7 @@ begin
// Prepare window for search files
ClearFilter;
// SetWindowCaption(wcs_NewSearch);
edtFindPathStart.Text := FileView.CurrentPath;
cmbFindPathStart.Hint := FileView.CurrentPath;
// Get paths of selected files, if any.
FSelectedFiles.Clear;
@ -613,7 +614,6 @@ begin
FSearchWithWDXPluginInProgress := False;
// load language
edtFindPathStart.DialogTitle := rsFindWhereBeg;
cmbNotOlderThanUnit.Items.Add(rsTimeUnitSecond);
cmbNotOlderThanUnit.Items.Add(rsTimeUnitMinute);
cmbNotOlderThanUnit.Items.Add(rsTimeUnitHour);
@ -662,7 +662,6 @@ begin
cmbNotOlderThanUnit.ItemIndex := 3; // Days
cmbFileSizeUnit.ItemIndex := 1; // Kilobytes
edtFindPathStart.ShowHidden := gShowSystemFiles;
InitPropStorage(Self);
@ -699,6 +698,8 @@ end;
{ TfrmFindDlg.Create }
constructor TfrmFindDlg.Create(TheOwner: TComponent);
var
C: TPortableNetworkGraphic;
begin
FSelectedFiles := TStringList.Create;
inherited Create(TheOwner);
@ -707,6 +708,14 @@ begin
FUpdateTimer.Enabled := False;
FUpdateTimer.OnTimer := @OnUpdateTimer;
try
C := TPortableNetworkGraphic.Create;
C.LoadFromResourceName(hInstance, ResBtnSelDir);
btnChooseFolder.Glyph.Assign(C);
finally
C.Free;
end;
FCommands := TFormCommands.Create(Self, actList);
end;
@ -722,7 +731,7 @@ end;
procedure TfrmFindDlg.DisableControlsForTemplate;
begin
lblFindPathStart.Visible := False;
edtFindPathStart.Visible := False;
cmbFindPathStart.Visible := False;
cbFollowSymLinks.Visible := False;
cbSelectedFiles.Visible := False;
cbOpenedTabs.Visible := False;
@ -766,8 +775,7 @@ begin
FLastTemplateName := '';
if bClearSearchLocation then
begin
edtFindPathStart.Text := '';
edtFindPathStart.ShowHidden := gShowSystemFiles;
cmbFindPathStart.Text := '';
cmbExcludeDirectories.Text := '';
end;
@ -926,7 +934,7 @@ procedure TfrmFindDlg.cbOpenedTabsChange(Sender: TObject);
begin
cbSelectedFiles.Enabled := not cbOpenedTabs.Checked;
cbFollowSymLinks.Enabled := not cbOpenedTabs.Checked;
edtFindPathStart.Enabled := not cbOpenedTabs.Checked;
cmbFindPathStart.Enabled := not cbOpenedTabs.Checked;
end;
{ TfrmFindDlg.cbPartialNameSearchChange }
@ -963,18 +971,19 @@ end;
{ TfrmFindDlg.cbSelectedFilesChange }
procedure TfrmFindDlg.cbSelectedFilesChange(Sender: TObject);
begin
edtFindPathStart.Enabled := not cbSelectedFiles.Checked;
cmbFindPathStart.Enabled := not cbSelectedFiles.Checked;
end;
{ TfrmFindDlg.btnSelDirClick }
procedure TfrmFindDlg.btnSelDirClick(Sender: TObject);
var
s: string;
S, AFolder: String;
begin
s := edtFindPathStart.Text;
if not mbDirectoryExists(s) then s := '';
SelectDirectory(rsFindWhereBeg, '', s, False);
edtFindPathStart.Text := s;
S := cmbFindPathStart.Text;
AFolder:= ExtractFilePath(ExcludeTrailingBackslash(S));
if not mbDirectoryExists(AFolder) then AFolder := EmptyStr;
if SelectDirectory(rsFindWhereBeg, AFolder, S, gShowSystemFiles) then
cmbFindPathStart.Text := S;
end;
{ TfrmFindDlg.btnNewSearchKeyDown }
@ -990,7 +999,7 @@ begin
with FindOptions do
begin
if SetStartPath then
StartPath := edtFindPathStart.Text
StartPath := cmbFindPathStart.Text
else
StartPath := '';
ExcludeDirectories := cmbExcludeDirectories.Text;
@ -1339,7 +1348,7 @@ begin
Self.Repaint;
Application.ProcessMessages;
sTemp := edtFindPathStart.Text;
sTemp := cmbFindPathStart.Text;
repeat
sPath := Copy2SymbDel(sTemp, ';');
if not mbDirectoryExists(sPath) then
@ -1726,10 +1735,12 @@ end;
procedure TfrmFindDlg.LoadHistory;
begin
cmbFindFileMask.Items.Assign(glsMaskHistory);
cmbFindPathStart.Items.Assign(glsSearchDirectories);
cmbExcludeDirectories.Items.Assign(glsSearchExcludeDirectories);
cmbExcludeFiles.Items.Assign(glsSearchExcludeFiles);
cmbFindText.Items.Assign(glsSearchHistory);
cmbFindPathStart.Text:= cmbFindPathStart.Hint;
// If we already search text then use last searched text
if not gFirstTextSearch then
begin
@ -1746,6 +1757,10 @@ begin
InsertFirstItem(cmbFindFileMask.Text, cmbFindFileMask);
glsMaskHistory.Assign(cmbFindFileMask.Items);
// 1. Add to find directory history
InsertFirstItem(cmbFindPathStart.Text, cmbFindPathStart);
glsSearchDirectories.Assign(cmbFindPathStart.Items);
// 2. Add to exclude directories history
InsertFirstItem(cmbExcludeDirectories.Text, cmbExcludeDirectories);
glsSearchExcludeFiles.Assign(cmbExcludeFiles.Items);
@ -1844,7 +1859,7 @@ begin
with Template do
begin
if StartPath <> '' then
edtFindPathStart.Text := StartPath;
cmbFindPathStart.Text := StartPath;
cmbExcludeDirectories.Text := ExcludeDirectories;
cmbFindFileMask.Text := FilesMasks;
cmbExcludeFiles.Text := ExcludeFiles;

View file

@ -276,6 +276,7 @@ var
glsSearchPathHistory : TStringListEx;
glsReplaceHistory : TStringListEx;
glsReplacePathHistory : TStringListEx;
glsSearchDirectories: TStringList;
glsSearchExcludeFiles: TStringList;
glsSearchExcludeDirectories: TStringList;
glsIgnoreList : TStringListEx;
@ -757,6 +758,7 @@ begin
LoadHistory('SearchTextPath', glsSearchPathHistory);
LoadHistory('ReplaceText', glsReplaceHistory);
LoadHistory('ReplaceTextPath', glsReplacePathHistory);
LoadHistory('SearchDirectories', glsSearchDirectories);
LoadHistory('SearchExcludeFiles', glsSearchExcludeFiles);
LoadHistory('SearchExcludeDirectories', glsSearchExcludeDirectories);
end;
@ -799,6 +801,7 @@ begin
SaveHistory('SearchTextPath', glsSearchPathHistory);
SaveHistory('ReplaceText', glsReplaceHistory);
SaveHistory('ReplaceTextPath', glsReplacePathHistory);
SaveHistory('SearchDirectories', glsSearchDirectories);
SaveHistory('SearchExcludeFiles', glsSearchExcludeFiles);
SaveHistory('SearchExcludeDirectories', glsSearchExcludeDirectories);
end;
@ -1194,6 +1197,7 @@ begin
glsReplaceHistory := TStringListEx.Create;
glsReplacePathHistory := TStringListEx.Create;
glsIgnoreList := TStringListEx.Create;
glsSearchDirectories := TStringList.Create;
glsSearchExcludeFiles:= TStringList.Create;
glsSearchExcludeDirectories:= TStringList.Create;
gSearchTemplateList := TSearchTemplateList.Create;
@ -1223,6 +1227,7 @@ begin
FreeThenNil(glsReplaceHistory);
FreeThenNil(glsReplacePathHistory);
FreeThenNil(glsIgnoreList);
FreeThenNil(glsSearchDirectories);
FreeThenNil(glsSearchExcludeFiles);
FreeThenNil(glsSearchExcludeDirectories);
FreeThenNil(gExts);