mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 15:59:31 +02:00
ideintf, ide: add a notification that options are written by dialogs to a settings class
git-svn-id: trunk@23121 -
This commit is contained in:
parent
bf0c6805aa
commit
b3de22c35b
@ -4224,6 +4224,7 @@ begin
|
||||
UpdateEditorOptions;
|
||||
|
||||
// save to disk
|
||||
IDEEditorGroups.DoAfterWrite;
|
||||
EnvironmentOptions.Save(False);
|
||||
EditorOpts.Save;
|
||||
CodeToolsOpts.AssignTo(CodeToolBoss);
|
||||
|
@ -42,6 +42,7 @@ type
|
||||
public
|
||||
class function GetGroupCaption:string; virtual; abstract;
|
||||
class function GetInstance: TAbstractIDEOptions; virtual; abstract;
|
||||
procedure DoAfterWrite; virtual;
|
||||
end;
|
||||
TAbstractIDEOptionsClass = class of TAbstractIDEOptions;
|
||||
|
||||
@ -111,6 +112,7 @@ type
|
||||
function GetByIndex(AIndex: Integer): PIDEOptionsGroupRec;
|
||||
public
|
||||
procedure Resort;
|
||||
procedure DoAfterWrite;
|
||||
procedure Add(AGroupIndex: Integer; AGroupClass: TAbstractIDEOptionsClass); reintroduce;
|
||||
property Items[AIndex: Integer]: PIDEOptionsGroupRec read GetItem write SetItem; default;
|
||||
end;
|
||||
@ -376,6 +378,27 @@ begin
|
||||
Items[i]^.Items.Resort;
|
||||
end;
|
||||
|
||||
procedure TIDEOptionsGroupList.DoAfterWrite;
|
||||
var
|
||||
i: integer;
|
||||
Rec: PIDEOptionsGroupRec;
|
||||
Instance: TAbstractIDEOptions;
|
||||
begin
|
||||
for i := 0 to Count - 1 do
|
||||
begin
|
||||
Rec := Items[i];
|
||||
if Rec^.Items <> nil then
|
||||
begin
|
||||
if Rec^.GroupClass <> nil then
|
||||
begin
|
||||
Instance := Rec^.GroupClass.GetInstance;
|
||||
if Instance <> nil then
|
||||
Instance.DoAfterWrite;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TIDEOptionsGroupList.Add(AGroupIndex: Integer; AGroupClass: TAbstractIDEOptionsClass);
|
||||
var
|
||||
Rec: PIDEOptionsGroupRec;
|
||||
@ -392,6 +415,13 @@ begin
|
||||
Rec^.GroupClass := AGroupClass;
|
||||
end;
|
||||
|
||||
{ TAbstractIDEOptions }
|
||||
|
||||
procedure TAbstractIDEOptions.DoAfterWrite;
|
||||
begin
|
||||
// nothing
|
||||
end;
|
||||
|
||||
initialization
|
||||
FIDEEditorGroups := nil;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user