mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 15:36:03 +02:00
ideintf: moved diff options back to ide
This commit is contained in:
parent
08e256ebbd
commit
3cff2b6dc4
@ -44,7 +44,7 @@ uses
|
|||||||
LazFileCache, LazFileUtils, LazLoggerBase, LazUTF8, AvgLvlTree, Laz2_XMLCfg,
|
LazFileCache, LazFileUtils, LazLoggerBase, LazUTF8, AvgLvlTree, Laz2_XMLCfg,
|
||||||
LazConfigStorage,
|
LazConfigStorage,
|
||||||
// IdeConfig
|
// IdeConfig
|
||||||
LazConf, RecentListProcs, IdeXmlConfigProcs,
|
RecentListProcs, IdeXmlConfigProcs,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
ProjectIntf, IDEDialogs;
|
ProjectIntf, IDEDialogs;
|
||||||
|
|
||||||
@ -162,8 +162,7 @@ type
|
|||||||
FCleanOutputFileMask: string;
|
FCleanOutputFileMask: string;
|
||||||
FCleanSourcesFileMask: string;
|
FCleanSourcesFileMask: string;
|
||||||
FFileDialogSettings: TFileDialogSettings;
|
FFileDialogSettings: TFileDialogSettings;
|
||||||
FFilename: string;
|
|
||||||
|
|
||||||
// Find- and replace-history
|
// Find- and replace-history
|
||||||
FFindHistory: TStringList;
|
FFindHistory: TStringList;
|
||||||
FFindInFilesSearchOptions: TLazFindInFileSearchOptions;
|
FFindInFilesSearchOptions: TLazFindInFileSearchOptions;
|
||||||
@ -187,6 +186,7 @@ type
|
|||||||
|
|
||||||
procedure SetFilename(const AValue: string);
|
procedure SetFilename(const AValue: string);
|
||||||
protected
|
protected
|
||||||
|
FFilename: string;
|
||||||
procedure LoadSearchOptions(XMLConfig: TXMLConfig; const Path: string); virtual; abstract;
|
procedure LoadSearchOptions(XMLConfig: TXMLConfig; const Path: string); virtual; abstract;
|
||||||
procedure SaveSearchOptions(XMLConfig: TXMLConfig; const Path: string); virtual; abstract;
|
procedure SaveSearchOptions(XMLConfig: TXMLConfig; const Path: string); virtual; abstract;
|
||||||
public
|
public
|
||||||
@ -296,7 +296,6 @@ implementation
|
|||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
DefaultHistoryFile = 'inputhistory.xml';
|
|
||||||
InputHistoryVersion = 1;
|
InputHistoryVersion = 1;
|
||||||
|
|
||||||
function CompareIHIgnoreItems(Item1, Item2: Pointer): integer;
|
function CompareIHIgnoreItems(Item1, Item2: Pointer): integer;
|
||||||
@ -508,12 +507,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TInputHistories.SetLazarusDefaultFilename;
|
procedure TInputHistories.SetLazarusDefaultFilename;
|
||||||
var
|
|
||||||
ConfFileName: string;
|
|
||||||
begin
|
begin
|
||||||
ConfFileName:=AppendPathDelim(GetPrimaryConfigPath)+DefaultHistoryFile;
|
|
||||||
CopySecondaryConfigFile(DefaultHistoryFile);
|
|
||||||
FFilename:=ConfFilename;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TInputHistories.Load;
|
procedure TInputHistories.Load;
|
||||||
|
@ -47,9 +47,10 @@ uses
|
|||||||
// SynEdit
|
// SynEdit
|
||||||
SynEdit, SynHighlighterDiff,
|
SynEdit, SynHighlighterDiff,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
IDEWindowIntf, IDEHelpIntf, IDEImagesIntf, InputHistory,
|
IDEWindowIntf, IDEHelpIntf, IDEImagesIntf,
|
||||||
// IDE
|
// IDE
|
||||||
LazarusIDEStrConsts, EditorOptions, DiffPatch, SourceEditor, EnvironmentOpts;
|
LazarusIDEStrConsts, EditorOptions, DiffPatch, SourceEditor,
|
||||||
|
InputhistoryWithSearchOpt, EnvironmentOpts;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -440,7 +441,7 @@ begin
|
|||||||
|
|
||||||
// get recent Text 2
|
// get recent Text 2
|
||||||
i:=0;
|
i:=0;
|
||||||
LastText2Name:=InputHistories.DiffText2;
|
LastText2Name:=InputHistoriesSO.DiffText2;
|
||||||
if LastText2Name<>'' then
|
if LastText2Name<>'' then
|
||||||
i:=fAvailableFiles.IndexOfName(LastText2Name);
|
i:=fAvailableFiles.IndexOfName(LastText2Name);
|
||||||
if i<0 then i:=0;
|
if i<0 then i:=0;
|
||||||
@ -448,7 +449,7 @@ begin
|
|||||||
fSelectedFile2.SetIndex(i);
|
fSelectedFile2.SetIndex(i);
|
||||||
|
|
||||||
// set recent options
|
// set recent options
|
||||||
SetDiffOptions(InputHistories.DiffFlags);
|
SetDiffOptions(InputHistoriesSO.DiffFlags);
|
||||||
|
|
||||||
// and action ...
|
// and action ...
|
||||||
UpdateDiff;
|
UpdateDiff;
|
||||||
@ -481,13 +482,13 @@ end;
|
|||||||
|
|
||||||
procedure TDiffDlg.SaveSettings;
|
procedure TDiffDlg.SaveSettings;
|
||||||
begin
|
begin
|
||||||
InputHistories.DiffFlags:=GetDiffOptions;
|
InputHistoriesSO.DiffFlags:=GetDiffOptions;
|
||||||
if (fSelectedFile2<>nil) and (fSelectedFile2.fFile<>nil) then begin
|
if (fSelectedFile2<>nil) and (fSelectedFile2.fFile<>nil) then begin
|
||||||
InputHistories.DiffText2:=fSelectedFile2.fFile.Name;
|
InputHistoriesSO.DiffText2:=fSelectedFile2.fFile.Name;
|
||||||
InputHistories.DiffText2OnlySelection:=Text2OnlySelectionCheckBox.Checked;
|
InputHistoriesSO.DiffText2OnlySelection:=Text2OnlySelectionCheckBox.Checked;
|
||||||
end else begin
|
end else begin
|
||||||
InputHistories.DiffText2:='';
|
InputHistoriesSO.DiffText2:='';
|
||||||
InputHistories.DiffText2OnlySelection:=false;
|
InputHistoriesSO.DiffText2OnlySelection:=false;
|
||||||
end;
|
end;
|
||||||
IDEDialogLayoutList.SaveLayout(Self);
|
IDEDialogLayoutList.SaveLayout(Self);
|
||||||
end;
|
end;
|
||||||
|
@ -30,11 +30,11 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
// LazUtils
|
// LazUtils
|
||||||
Laz2_XMLCfg,
|
Laz2_XMLCfg, LazFileUtils,
|
||||||
// SynEdit
|
// SynEdit
|
||||||
SynEditTypes,
|
SynEditTypes,
|
||||||
// IDE
|
// IDE
|
||||||
InputHistory, DiffPatch;
|
LazConf, InputHistory, DiffPatch;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -65,6 +65,8 @@ type
|
|||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Clear; override;
|
procedure Clear; override;
|
||||||
|
procedure SetLazarusDefaultFilename; override;
|
||||||
|
|
||||||
property FindOptions[const ASelAvail: Boolean]: TSynSearchOptions read GetFindOptions write SetFindOptions;
|
property FindOptions[const ASelAvail: Boolean]: TSynSearchOptions read GetFindOptions write SetFindOptions;
|
||||||
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string); override;
|
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string); override;
|
||||||
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); override;
|
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); override;
|
||||||
@ -99,6 +101,7 @@ var
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
const
|
const
|
||||||
|
DefaultHistoryFile = 'inputhistory.xml';
|
||||||
DefaultDiffFlags = [tdfIgnoreCase,tdfIgnoreEmptyLineChanges,
|
DefaultDiffFlags = [tdfIgnoreCase,tdfIgnoreEmptyLineChanges,
|
||||||
tdfIgnoreLineEnds,tdfIgnoreTrailingSpaces];
|
tdfIgnoreLineEnds,tdfIgnoreTrailingSpaces];
|
||||||
|
|
||||||
@ -123,6 +126,16 @@ begin
|
|||||||
FDiffText2OnlySelection:=false;
|
FDiffText2OnlySelection:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TInputHistoriesWithSearchOpt.SetLazarusDefaultFilename;
|
||||||
|
var
|
||||||
|
ConfFileName: string;
|
||||||
|
begin
|
||||||
|
ConfFileName:=AppendPathDelim(GetPrimaryConfigPath)+DefaultHistoryFile;
|
||||||
|
CopySecondaryConfigFile(DefaultHistoryFile);
|
||||||
|
FFilename:=ConfFilename;
|
||||||
|
inherited SetLazarusDefaultFilename;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TInputHistoriesWithSearchOpt.LoadFromXMLConfig(XMLConfig: TXMLConfig;
|
procedure TInputHistoriesWithSearchOpt.LoadFromXMLConfig(XMLConfig: TXMLConfig;
|
||||||
const Path: string);
|
const Path: string);
|
||||||
var
|
var
|
||||||
|
Loading…
Reference in New Issue
Block a user