From 391b8ffa36491bd6a6d8a463f4b68f88dd6953e7 Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 9 Jan 2018 11:35:58 +0000 Subject: [PATCH] IDEIntf: moved TAbstractIDEProjectOptions to unit projectintf, added TAbstractIDEProjectOptions.GetProject git-svn-id: trunk@57024 - --- components/ideintf/ideoptionsintf.pas | 1 - components/ideintf/idewindowintf.pas | 1 + components/ideintf/maskpropedit.pas | 2 +- components/ideintf/projectintf.pas | 12 +++++++++--- components/pas2js/pjsprojectoptions.pp | 1 - ide/project.pp | 6 ++++++ 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/components/ideintf/ideoptionsintf.pas b/components/ideintf/ideoptionsintf.pas index 40d5770bb7..122f4c689d 100644 --- a/components/ideintf/ideoptionsintf.pas +++ b/components/ideintf/ideoptionsintf.pas @@ -121,7 +121,6 @@ type TAbstractIDEOptionsClass = class of TAbstractIDEOptions; TAbstractIDEEnvironmentOptions = class(TAbstractIDEOptions); - TAbstractIDEProjectOptions = class(TAbstractIDEOptions); TAbstractIDEHelpOptions = class(TAbstractIDEEnvironmentOptions); TOnAddToRecent = procedure(Sender: TObject; AFileName: string; var AAllow: Boolean) of object; diff --git a/components/ideintf/idewindowintf.pas b/components/ideintf/idewindowintf.pas index 40b731457d..e58157c7dd 100644 --- a/components/ideintf/idewindowintf.pas +++ b/components/ideintf/idewindowintf.pas @@ -1150,6 +1150,7 @@ procedure TSimpleWindowLayout.LoadFromConfig(Config: TConfigStorage; var P: string; begin + if FileVersion=0 then ; // set all values to default Clear; // read settings diff --git a/components/ideintf/maskpropedit.pas b/components/ideintf/maskpropedit.pas index b90c5699e5..a8809ca202 100644 --- a/components/ideintf/maskpropedit.pas +++ b/components/ideintf/maskpropedit.pas @@ -44,7 +44,7 @@ type TestMaskEdit: TMaskEdit; OpenDialog1: TOpenDialog; TestInputPanel: TPanel; - procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); + procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction); procedure LoadSampleMasksButtonClick(Sender: TObject); procedure SampleMasksListBoxDrawItem(Control: TWinControl; Index: Integer; ARect: TRect; {%H-}State: TOwnerDrawState); diff --git a/components/ideintf/projectintf.pas b/components/ideintf/projectintf.pas index af30413c33..3e6fdf292f 100644 --- a/components/ideintf/projectintf.pas +++ b/components/ideintf/projectintf.pas @@ -16,9 +16,11 @@ unit ProjectIntf; interface uses - Classes, SysUtils, FileUtil, LazFileUtils, Controls, Forms, AvgLvlTree, - NewItemIntf, ProjPackIntf, CompOptsIntf, ObjInspStrConsts, IDEImagesIntf, - LazFileCache, LazMethodList, ImgList, Graphics, Contnrs; + Classes, SysUtils, Contnrs, + FileUtil, LazFileUtils, LazFileCache, LazMethodList, AvgLvlTree, + Controls, Forms, ImgList, Graphics, + IDEOptionsIntf, NewItemIntf, ProjPackIntf, CompOptsIntf, ObjInspStrConsts, + IDEImagesIntf; const FileDescGroupName = 'File'; @@ -587,6 +589,10 @@ type TLazProjectClass = class of TLazProject; + TAbstractIDEProjectOptions = class(TAbstractIDEOptions) + public + function GetProject: TLazProject; virtual; abstract; + end; { TProjectDescriptors } diff --git a/components/pas2js/pjsprojectoptions.pp b/components/pas2js/pjsprojectoptions.pp index 0ff0037b8a..41d307a90c 100644 --- a/components/pas2js/pjsprojectoptions.pp +++ b/components/pas2js/pjsprojectoptions.pp @@ -38,7 +38,6 @@ type procedure CheckServerOptions(aEnabled: Boolean); function FillFilesCombo(PRJ: TLazProject): Integer; procedure ToggleCB(CB: TCheckBox; aEnabled: Boolean); - public function GetTitle: string; override; procedure Setup({%H-}ADialog: TAbstractOptionsEditorDialog); override; diff --git a/ide/project.pp b/ide/project.pp index 08e6811134..36683afb48 100644 --- a/ide/project.pp +++ b/ide/project.pp @@ -680,6 +680,7 @@ type public constructor Create(AProject: TProject); destructor Destroy; override; + function GetProject: TLazProject; override; class function GetInstance: TAbstractIDEOptions; override; class function GetGroupCaption: string; override; property Project: TProject read FProject; @@ -2639,6 +2640,11 @@ begin inherited Destroy; end; +function TProjectIDEOptions.GetProject: TLazProject; +begin + Result:=FProject; +end; + class function TProjectIDEOptions.GetInstance: TAbstractIDEOptions; begin if Project1<>nil then