mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 01:26:31 +02:00
IDE: options: reduced some overhead on loading/saving
git-svn-id: trunk@33768 -
This commit is contained in:
parent
9534efa9f7
commit
c24a308083
@ -34,6 +34,9 @@ type
|
||||
|
||||
TCodeExplorerCategoriesOptionsFrame = class(TAbstractIDEOptionsEditor)
|
||||
CategoriesCheckGroup: TCheckGroup;
|
||||
private
|
||||
fLoaded: Boolean;
|
||||
FSaved: Boolean;
|
||||
public
|
||||
function GetTitle: String; override;
|
||||
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
|
||||
@ -68,6 +71,8 @@ procedure TCodeExplorerCategoriesOptionsFrame.ReadSettings(
|
||||
var
|
||||
c: TCodeExplorerCategory;
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
with AOptions as TCodeExplorerOptions do
|
||||
for c := FirstCodeExplorerCategory to high(TCodeExplorerCategory) do
|
||||
CategoriesCheckGroup.Checked[ord(c) - 1] := c in Categories;
|
||||
@ -79,6 +84,8 @@ var
|
||||
NewCategories: TCodeExplorerCategories;
|
||||
c: TCodeExplorerCategory;
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
NewCategories:=[];
|
||||
for c := FirstCodeExplorerCategory to high(TCodeExplorerCategory) do
|
||||
if CategoriesCheckGroup.Checked[ord(c) - 1] then
|
||||
|
@ -52,6 +52,8 @@ type
|
||||
private
|
||||
FCategoryCheckBoxes: array [TCEObserverCategory] of TCheckBox;
|
||||
FGroupCheckBoxes: array [TCEObserverCategoryGroup] of TCheckBox;
|
||||
fLoaded: Boolean;
|
||||
FSaved: Boolean;
|
||||
public
|
||||
function GetTitle: String; override;
|
||||
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
|
||||
@ -166,6 +168,8 @@ var
|
||||
c: TCEObserverCategory;
|
||||
Tmp: TStrings;
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
with TCodeExplorerOptions(AOptions) do
|
||||
begin
|
||||
for c := Low(c) to High(c) do
|
||||
@ -191,6 +195,8 @@ var
|
||||
NewCategories: TCEObserverCategories;
|
||||
c: TCEObserverCategory;
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
NewCategories := [];
|
||||
for c := Low(c) to high(c) do
|
||||
if FCategoryCheckBoxes[c].Checked then
|
||||
|
@ -42,6 +42,8 @@ type
|
||||
private
|
||||
BeautifyCodeOptions: TBeautifyCodeOptions;
|
||||
FHighlighter: TPreviewPasSyn;
|
||||
fLoaded: Boolean;
|
||||
FSaved: Boolean;
|
||||
procedure UpdateSplitLineExample;
|
||||
procedure UpdatePreviewSettings;
|
||||
procedure WriteBeautifyCodeOptions(Options: TBeautifyCodeOptions);
|
||||
@ -171,6 +173,8 @@ end;
|
||||
procedure TCodetoolsLineSplittingOptionsFrame.ReadSettings(
|
||||
AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
with AOptions as TCodetoolsOptions do
|
||||
begin
|
||||
LineLengthEdit.Text := IntToStr(LineLength);
|
||||
@ -182,6 +186,8 @@ end;
|
||||
procedure TCodetoolsLineSplittingOptionsFrame.WriteSettings(
|
||||
AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
with AOptions as TCodetoolsOptions do
|
||||
begin
|
||||
LineLength := StrToIntDef(LineLengthEdit.Text, 80);
|
||||
|
@ -36,6 +36,8 @@ type
|
||||
IdentifierPolicyRadioGroup: TRadioGroup;
|
||||
KeyWordPolicyRadioGroup: TRadioGroup;
|
||||
private
|
||||
fLoaded: Boolean;
|
||||
FSaved: Boolean;
|
||||
{ private declarations }
|
||||
public
|
||||
function GetTitle: String; override;
|
||||
@ -87,6 +89,8 @@ end;
|
||||
procedure TCodetoolsWordPolicyOptionsFrame.ReadSettings(
|
||||
AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
with AOptions as TCodetoolsOptions do
|
||||
begin
|
||||
case KeyWordPolicy of
|
||||
@ -117,6 +121,8 @@ end;
|
||||
procedure TCodetoolsWordPolicyOptionsFrame.WriteSettings(
|
||||
AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
with AOptions as TCodetoolsOptions do
|
||||
begin
|
||||
case KeyWordPolicyRadioGroup.ItemIndex of
|
||||
|
@ -45,6 +45,9 @@ type
|
||||
TargetCPUComboBox: TComboBox;
|
||||
TargetOSComboBox: TComboBox;
|
||||
TargetProcessorProcComboBox: TComboBox;
|
||||
private
|
||||
fLoaded: Boolean;
|
||||
FSaved: Boolean;
|
||||
public
|
||||
function GetTitle: string; override;
|
||||
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
|
||||
@ -219,6 +222,8 @@ procedure TCompilerCodegenOptionsFrame.ReadSettings(AOptions: TAbstractIDEOption
|
||||
var
|
||||
i: longint;
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
with AOptions as TBaseCompilerOptions do
|
||||
begin
|
||||
chkSmartLinkUnit.Checked := SmartLinkUnit;
|
||||
@ -267,6 +272,8 @@ var
|
||||
NewTargetOS: string;
|
||||
NewTargetCPU: string;
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
with AOptions as TBaseCompilerOptions do
|
||||
begin
|
||||
SmartLinkUnit := chkSmartLinkUnit.Checked;
|
||||
|
@ -52,6 +52,8 @@ type
|
||||
InhTreeView: TTreeView;
|
||||
procedure InhTreeViewSelectionChanged(Sender: TObject);
|
||||
private
|
||||
fLoaded: Boolean;
|
||||
FSaved: Boolean;
|
||||
ImageIndexInherited: Integer;
|
||||
ImageIndexRequired: Integer;
|
||||
ImageIndexPackage: Integer;
|
||||
@ -98,11 +100,15 @@ end;
|
||||
|
||||
procedure TCompilerInheritedOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
UpdateInheritedTree(AOptions as TBaseCompilerOptions);
|
||||
end;
|
||||
|
||||
procedure TCompilerInheritedOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
|
||||
end;
|
||||
|
||||
|
@ -58,7 +58,9 @@ type
|
||||
FHighlighters: array[TLazSyntaxHighlighter] of TSrcIDEHighlighter;
|
||||
FCurHighlighter: TSrcIDEHighlighter;
|
||||
FCurFoldInfo: TEditorOptionsFoldRecord;
|
||||
fLoaded: Boolean;
|
||||
FModeLock: Boolean;
|
||||
FSaved: Boolean;
|
||||
procedure UpdateFoldHideRadio;
|
||||
protected
|
||||
function GetHighlighter(SynType: TLazSyntaxHighlighter;
|
||||
@ -249,6 +251,8 @@ var
|
||||
i: Integer;
|
||||
rf: TEditorOptionsFoldRecord;
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
FModeLock := False;
|
||||
with AOptions as TEditorOptions do
|
||||
begin
|
||||
@ -275,6 +279,8 @@ procedure TEditorCodefoldingOptionsFrame.WriteSettings(
|
||||
var
|
||||
i: TLazSyntaxHighlighter;
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
with AOptions as TEditorOptions do
|
||||
begin
|
||||
UseCodeFolding := chkCodeFoldingEnabled.Checked;
|
||||
|
@ -49,6 +49,9 @@ type
|
||||
AutoToolTipSymbToolsCheckBox: TCheckBox;
|
||||
AutoRemoveEmptyMethodsOnSave: TCheckBox;
|
||||
procedure AutoDelayTrackBarChange(Sender: TObject);
|
||||
private
|
||||
fLoaded: Boolean;
|
||||
FSaved: Boolean;
|
||||
public
|
||||
function GetTitle: String; override;
|
||||
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
|
||||
@ -95,6 +98,8 @@ end;
|
||||
|
||||
procedure TEditorCodetoolsOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
with AOptions as TEditorOptions do
|
||||
begin
|
||||
AutoCompleteBlockCheckBox.Checked := AutoBlockCompletion;
|
||||
@ -113,6 +118,8 @@ end;
|
||||
|
||||
procedure TEditorCodetoolsOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
with AOptions as TEditorOptions do
|
||||
begin
|
||||
AutoBlockCompletion := AutoCompleteBlockCheckBox.Checked;
|
||||
|
@ -35,6 +35,8 @@ type
|
||||
procedure FPCDocHTMLBrowseButtonClick(Sender: TObject);
|
||||
procedure ViewersListBoxSelectionChange(Sender: TObject; User: boolean);
|
||||
private
|
||||
fLoaded: Boolean;
|
||||
FSaved: Boolean;
|
||||
ViewersPropertiesGrid: TCustomPropertiesGrid;
|
||||
DatabasesPropertiesGrid: TCustomPropertiesGrid;
|
||||
procedure FillViewersList;
|
||||
@ -195,6 +197,8 @@ end;
|
||||
|
||||
procedure THelpGeneralOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
with AOptions as THelpOptions do
|
||||
begin
|
||||
FPCDocHTMLEdit.Text := FPCDocsHTMLDirectory;
|
||||
@ -207,6 +211,8 @@ end;
|
||||
|
||||
procedure THelpGeneralOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
with AOptions as THelpOptions do
|
||||
begin
|
||||
FPCDocsHTMLDirectory := FPCDocHTMLEdit.Text;
|
||||
|
@ -40,6 +40,8 @@ type
|
||||
PascalFileExtRadiogroup: TRadioGroup;
|
||||
UnitReferencesRadioGroup: TRadioGroup;
|
||||
private
|
||||
fLoaded: Boolean;
|
||||
FSaved: Boolean;
|
||||
public
|
||||
function GetTitle: String; override;
|
||||
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
|
||||
@ -130,6 +132,8 @@ procedure TNamingOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
with AOptions as TEnvironmentOptions do
|
||||
begin
|
||||
for i := 0 to PascalFileExtRadiogroup.Items.Count-1 do
|
||||
@ -146,6 +150,8 @@ end;
|
||||
|
||||
procedure TNamingOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
with AOptions as TEnvironmentOptions do
|
||||
begin
|
||||
if PascalFileExtRadiogroup.ItemIndex >= 0 then
|
||||
|
@ -40,7 +40,9 @@ type
|
||||
procedure SaveIconButtonClick(Sender: TObject);
|
||||
procedure UseXPManifestCheckBoxChange(Sender: TObject);
|
||||
private
|
||||
fLoaded: Boolean;
|
||||
FProject: TProject;
|
||||
FSaved: Boolean;
|
||||
procedure SetIconFromStream(Value: TStream);
|
||||
function GetIconAsStream: TStream;
|
||||
public
|
||||
@ -212,6 +214,8 @@ procedure TProjectApplicationOptionsFrame.ReadSettings(AOptions: TAbstractIDEOpt
|
||||
var
|
||||
AStream: TStream;
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
FProject := AOptions as TProject;
|
||||
with FProject do
|
||||
begin
|
||||
@ -233,6 +237,8 @@ procedure TProjectApplicationOptionsFrame.WriteSettings(AOptions: TAbstractIDEOp
|
||||
var
|
||||
AStream: TStream;
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
with AOptions as TProject do
|
||||
begin
|
||||
Title := TitleEdit.Text;
|
||||
|
@ -31,6 +31,8 @@ type
|
||||
UseFPCResourcesRadioButton: TRadioButton;
|
||||
UseLRSFilesRadioButton: TRadioButton;
|
||||
private
|
||||
fLoaded: Boolean;
|
||||
FSaved: Boolean;
|
||||
{ private declarations }
|
||||
public
|
||||
function GetTitle: string; override;
|
||||
@ -74,6 +76,8 @@ end;
|
||||
|
||||
procedure TProjectMiscOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
if fLoaded then exit;
|
||||
fLoaded:=true;
|
||||
with AOptions as TProject do
|
||||
begin
|
||||
MainUnitIsPascalSourceCheckBox.Checked := (pfMainUnitIsPascalSource in Flags);
|
||||
@ -112,6 +116,8 @@ var
|
||||
end;
|
||||
|
||||
begin
|
||||
if FSaved then exit;
|
||||
FSaved:=true;
|
||||
NewFlags := Project.Flags;
|
||||
SetProjectFlag(pfMainUnitIsPascalSource,
|
||||
MainUnitIsPascalSourceCheckBox.Checked);
|
||||
|
Loading…
Reference in New Issue
Block a user