mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 11:42:42 +02:00
Revert "ideintf: moved diff options to ide"
This reverts commit 08e256ebbd
.
This commit is contained in:
parent
7a05fd5b85
commit
1132dcd45e
@ -44,7 +44,7 @@ uses
|
||||
LazFileCache, LazFileUtils, LazLoggerBase, LazUTF8, AvgLvlTree, Laz2_XMLCfg,
|
||||
LazConfigStorage,
|
||||
// IdeConfig
|
||||
LazConf, RecentListProcs, IdeXmlConfigProcs,
|
||||
DiffPatch, LazConf, RecentListProcs, IdeXmlConfigProcs,
|
||||
// IdeIntf
|
||||
ProjectIntf, IDEDialogs;
|
||||
|
||||
@ -161,6 +161,9 @@ type
|
||||
private
|
||||
FCleanOutputFileMask: string;
|
||||
FCleanSourcesFileMask: string;
|
||||
FDiffFlags: TTextDiffFlags;
|
||||
FDiffText2: string;
|
||||
FDiffText2OnlySelection: boolean;
|
||||
FFileDialogSettings: TFileDialogSettings;
|
||||
FFilename: string;
|
||||
|
||||
@ -192,12 +195,12 @@ type
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
procedure Clear; virtual;
|
||||
procedure Load; virtual;
|
||||
procedure Save; virtual;
|
||||
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string); virtual;
|
||||
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); virtual;
|
||||
procedure SetLazarusDefaultFilename; virtual;
|
||||
procedure Clear;
|
||||
procedure Load;
|
||||
procedure Save;
|
||||
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
||||
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
||||
procedure SetLazarusDefaultFilename;
|
||||
|
||||
// Find- and replace-history
|
||||
function AddToFindHistory(const AFindStr: string): boolean;
|
||||
@ -238,6 +241,11 @@ type
|
||||
// various history lists
|
||||
property HistoryLists: THistoryLists read FHistoryLists;
|
||||
|
||||
// diff dialog
|
||||
property DiffFlags: TTextDiffFlags read FDiffFlags write FDiffFlags;
|
||||
property DiffText2: string read FDiffText2 write FDiffText2;
|
||||
property DiffText2OnlySelection: boolean read FDiffText2OnlySelection
|
||||
write FDiffText2OnlySelection;
|
||||
// new dialog
|
||||
property NewProjectType: string read FNewProjectType write FNewProjectType;
|
||||
property NewFileType: string read FNewFileType write FNewFileType;
|
||||
@ -284,7 +292,7 @@ const
|
||||
);
|
||||
|
||||
var
|
||||
InputHistories: TInputHistories = nil; // set by IDE
|
||||
InputHistories: TInputHistories = nil;
|
||||
|
||||
function CompareIHIgnoreItems(Item1, Item2: Pointer): integer;
|
||||
function CompareAnsiStringWithIHIgnoreItem(AString, Item: Pointer): integer;
|
||||
@ -298,6 +306,8 @@ implementation
|
||||
const
|
||||
DefaultHistoryFile = 'inputhistory.xml';
|
||||
InputHistoryVersion = 1;
|
||||
DefaultDiffFlags = [tdfIgnoreCase,tdfIgnoreEmptyLineChanges,
|
||||
tdfIgnoreLineEnds,tdfIgnoreTrailingSpaces];
|
||||
|
||||
function CompareIHIgnoreItems(Item1, Item2: Pointer): integer;
|
||||
var
|
||||
@ -382,6 +392,9 @@ begin
|
||||
Height:=0;
|
||||
InitialDir:='';
|
||||
end;
|
||||
FDiffFlags:=DefaultDiffFlags;
|
||||
FDiffText2:='';
|
||||
FDiffText2OnlySelection:=false;
|
||||
FNewProjectType:='';
|
||||
FNewFileType:='';
|
||||
FLastConvertDelphiProject:='';
|
||||
@ -394,6 +407,7 @@ end;
|
||||
|
||||
procedure TInputHistories.LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
||||
var
|
||||
DiffFlag: TTextDiffFlag;
|
||||
FIFOption: TLazFindInFileSearchOption;
|
||||
begin
|
||||
// Find- and replace-history
|
||||
@ -430,6 +444,18 @@ begin
|
||||
DefaultProjectCleanSourcesFileMask);
|
||||
// history lists
|
||||
FHistoryLists.LoadFromXMLConfig(XMLConfig,Path+'HistoryLists/');
|
||||
// diff dialog
|
||||
FDiffFlags:=[];
|
||||
for DiffFlag:=Low(TTextDiffFlag) to High(TTextDiffFlag) do begin
|
||||
if XMLConfig.GetValue(
|
||||
Path+'DiffDialog/Options/'+TextDiffFlagNames[DiffFlag],
|
||||
DiffFlag in DefaultDiffFlags)
|
||||
then
|
||||
Include(FDiffFlags,DiffFlag);
|
||||
end;
|
||||
FDiffText2:=XMLConfig.GetValue(Path+'DiffDialog/Text2/Name','');
|
||||
FDiffText2OnlySelection:=
|
||||
XMLConfig.GetValue(Path+'DiffDialog/Text2/OnlySelection',false);
|
||||
|
||||
// new items
|
||||
FNewProjectType:=XMLConfig.GetValue(Path+'New/Project/Type','');
|
||||
@ -451,6 +477,7 @@ end;
|
||||
|
||||
procedure TInputHistories.SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
|
||||
var
|
||||
DiffFlag: TTextDiffFlag;
|
||||
FIFOption: TLazFindInFileSearchOption;
|
||||
begin
|
||||
// Find- and replace-history
|
||||
@ -485,6 +512,15 @@ begin
|
||||
DefaultProjectCleanSourcesFileMask);
|
||||
// history lists
|
||||
FHistoryLists.SaveToXMLConfig(XMLConfig,Path+'HistoryLists/',True);
|
||||
// diff dialog
|
||||
for DiffFlag:=Low(TTextDiffFlag) to High(TTextDiffFlag) do begin
|
||||
XMLConfig.SetDeleteValue(
|
||||
Path+'DiffDialog/Options/'+TextDiffFlagNames[DiffFlag],
|
||||
DiffFlag in DiffFlags,DiffFlag in DefaultDiffFlags);
|
||||
end;
|
||||
XMLConfig.SetDeleteValue(Path+'DiffDialog/Text2/Name',FDiffText2,'');
|
||||
XMLConfig.SetDeleteValue(Path+'DiffDialog/Text2/OnlySelection',
|
||||
FDiffText2OnlySelection,false);
|
||||
|
||||
// new items
|
||||
XMLConfig.SetDeleteValue(Path+'New/Project/Type',FNewProjectType,'');
|
||||
|
@ -34,7 +34,7 @@ uses
|
||||
// SynEdit
|
||||
SynEditTypes,
|
||||
// IDE
|
||||
InputHistory, DiffPatch;
|
||||
InputHistory;
|
||||
|
||||
type
|
||||
|
||||
@ -51,9 +51,6 @@ type
|
||||
SaveOptionsSelSpecific = [ssoEntireScope, ssoSelectedOnly];
|
||||
SaveOptions = SaveOptionsGeneral + SaveOptionsSelSpecific;
|
||||
private
|
||||
FDiffFlags: TTextDiffFlags;
|
||||
FDiffText2: string;
|
||||
FDiffText2OnlySelection: boolean;
|
||||
FFindOptions: array[Boolean] of TSynSearchOptions; // array[SelAvail] - selection available
|
||||
function GetFindOptions(const ASelAvail: Boolean): TSynSearchOptions;
|
||||
procedure SetFindOptions(const ASelAvail: Boolean;
|
||||
@ -64,16 +61,7 @@ type
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
procedure Clear; override;
|
||||
property FindOptions[const ASelAvail: Boolean]: TSynSearchOptions read GetFindOptions write SetFindOptions;
|
||||
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string); override;
|
||||
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); override;
|
||||
|
||||
// diff dialog
|
||||
property DiffFlags: TTextDiffFlags read FDiffFlags write FDiffFlags;
|
||||
property DiffText2: string read FDiffText2 write FDiffText2;
|
||||
property DiffText2OnlySelection: boolean read FDiffText2OnlySelection
|
||||
write FDiffText2OnlySelection;
|
||||
end;
|
||||
|
||||
const
|
||||
@ -98,10 +86,6 @@ var
|
||||
|
||||
implementation
|
||||
|
||||
const
|
||||
DefaultDiffFlags = [tdfIgnoreCase,tdfIgnoreEmptyLineChanges,
|
||||
tdfIgnoreLineEnds,tdfIgnoreTrailingSpaces];
|
||||
|
||||
{ TInputHistoriesWithSearchOpt }
|
||||
|
||||
constructor TInputHistoriesWithSearchOpt.Create;
|
||||
@ -115,53 +99,6 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TInputHistoriesWithSearchOpt.Clear;
|
||||
begin
|
||||
inherited Clear;
|
||||
FDiffFlags:=DefaultDiffFlags;
|
||||
FDiffText2:='';
|
||||
FDiffText2OnlySelection:=false;
|
||||
end;
|
||||
|
||||
procedure TInputHistoriesWithSearchOpt.LoadFromXMLConfig(XMLConfig: TXMLConfig;
|
||||
const Path: string);
|
||||
var
|
||||
DiffFlag: TTextDiffFlag;
|
||||
begin
|
||||
inherited LoadFromXMLConfig(XMLConfig, Path);
|
||||
|
||||
// diff dialog
|
||||
FDiffFlags:=[];
|
||||
for DiffFlag:=Low(TTextDiffFlag) to High(TTextDiffFlag) do begin
|
||||
if XMLConfig.GetValue(
|
||||
Path+'DiffDialog/Options/'+TextDiffFlagNames[DiffFlag],
|
||||
DiffFlag in DefaultDiffFlags)
|
||||
then
|
||||
Include(FDiffFlags,DiffFlag);
|
||||
end;
|
||||
FDiffText2:=XMLConfig.GetValue(Path+'DiffDialog/Text2/Name','');
|
||||
FDiffText2OnlySelection:=
|
||||
XMLConfig.GetValue(Path+'DiffDialog/Text2/OnlySelection',false);
|
||||
end;
|
||||
|
||||
procedure TInputHistoriesWithSearchOpt.SaveToXMLConfig(XMLConfig: TXMLConfig;
|
||||
const Path: string);
|
||||
var
|
||||
DiffFlag: TTextDiffFlag;
|
||||
begin
|
||||
inherited SaveToXMLConfig(XMLConfig, Path);
|
||||
|
||||
// diff dialog
|
||||
for DiffFlag:=Low(TTextDiffFlag) to High(TTextDiffFlag) do begin
|
||||
XMLConfig.SetDeleteValue(
|
||||
Path+'DiffDialog/Options/'+TextDiffFlagNames[DiffFlag],
|
||||
DiffFlag in DiffFlags,DiffFlag in DefaultDiffFlags);
|
||||
end;
|
||||
XMLConfig.SetDeleteValue(Path+'DiffDialog/Text2/Name',FDiffText2,'');
|
||||
XMLConfig.SetDeleteValue(Path+'DiffDialog/Text2/OnlySelection',
|
||||
FDiffText2OnlySelection,false);
|
||||
end;
|
||||
|
||||
function TInputHistoriesWithSearchOpt.GetFindOptions(
|
||||
const ASelAvail: Boolean): TSynSearchOptions;
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user