FpWeb: call New HTTP Application options dialog in DoInitDescriptor callback instead of InitProject in order to avoid closing current project when the options form was just shown (current project should only be closed when user presses OK button in the options form)

This commit is contained in:
Maxim Ganetsky 2022-01-18 02:06:41 +03:00
parent 5aee55a625
commit 897f7280cb

View File

@ -200,6 +200,7 @@ type
function GetOptions: TModalResult; function GetOptions: TModalResult;
public public
constructor Create; override; constructor Create; override;
function DoInitDescriptor: TModalResult; override;
function GetLocalizedName: string; override; function GetLocalizedName: string; override;
function GetLocalizedDescription: string; override; function GetLocalizedDescription: string; override;
function InitProject(AProject: TLazProject): TModalResult; override; function InitProject(AProject: TLazProject): TModalResult; override;
@ -856,6 +857,11 @@ begin
Name:='FPHTTPApplication'; Name:='FPHTTPApplication';
end; end;
function THTTPApplicationDescriptor.DoInitDescriptor: TModalResult;
begin
Result:=GetOptions;
end;
function THTTPApplicationDescriptor.GetLocalizedName: string; function THTTPApplicationDescriptor.GetLocalizedName: string;
begin begin
Result:=rsHTTPAppli; Result:=rsHTTPAppli;
@ -899,9 +905,6 @@ Var
begin begin
inherited InitProject(AProject); inherited InitProject(AProject);
Result:=GetOptions;
if Result<>mrOK then
Exit;
MainFile:=AProject.CreateProjectFile('httpproject1.lpr'); MainFile:=AProject.CreateProjectFile('httpproject1.lpr');
MainFile.IsPartOfProject:=true; MainFile.IsPartOfProject:=true;
AProject.AddFile(MainFile,false); AProject.AddFile(MainFile,false);