From aceba1bd21d069822909753020d798fe246d7bd9 Mon Sep 17 00:00:00 2001 From: skalogryz Date: Tue, 26 Jan 2010 07:40:15 +0000 Subject: [PATCH] iphonelazext: fixing project options saving. loading sdk list on lazarus start git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1144 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/iphonelazext/ideext.pas | 21 +++++++++++++++++-- components/iphonelazext/iphoneextstr.pas | 3 +++ .../iphonelazext/project_iphone_options.pas | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/components/iphonelazext/ideext.pas b/components/iphonelazext/ideext.pas index 3d246d288..5fab7c1cf 100644 --- a/components/iphonelazext/ideext.pas +++ b/components/iphonelazext/ideext.pas @@ -170,8 +170,25 @@ var idx : Integer; needfix : Boolean; sdkuse : String; + sdkver : String; + st : TStringList; begin - sdkuse:=EnvOptions.GetSDKFullPath(ProjOptions.SDK, not isRealDevice); + sdkver:=ProjOptions.SDK; + if sdkver='' then begin + st := TStringList.Create; + try + EnvOptions.GetSDKVersions(st); + if st.Count=0 then + IDEMessagesWindow.AddMsg(strWNoSDK, '', 0) + else begin + sdkver:=st[0]; + ProjOptions.SDK:=sdkver; + end; + finally + st.Free; + end; + end; + sdkuse:=EnvOptions.GetSDKFullPath(sdkver, not isRealDevice); Result:=Options; if FindParam(Result, '-XR', idx, rawprm) then begin @@ -213,7 +230,6 @@ end; function TiPhoneExtension.ProjectBuilding(Sender: TObject): TModalResult; begin - //writeln('project building: ', Sender.ClassName); Result:=mrOk; if not Assigned(LazarusIDE.ActiveProject) or not ProjOptions.isIPhoneApp then Exit; @@ -433,6 +449,7 @@ begin // IDE integration is done in constructor Extension := TiPhoneExtension.Create; EnvOptions.Load; + EnvOptions.RefreshVersions; end; initialization diff --git a/components/iphonelazext/iphoneextstr.pas b/components/iphonelazext/iphoneextstr.pas index 06f89fed8..9e8d7c256 100644 --- a/components/iphonelazext/iphoneextstr.pas +++ b/components/iphonelazext/iphoneextstr.pas @@ -32,6 +32,9 @@ resourcestring strXcodeUpdated = 'Xcode project updated'; + strWNoSDKSelected = 'Warning: SDK is not selected using %s'; + strWNoSDK = 'Warning: No SDK available. Linking might fail.'; + implementation end. diff --git a/components/iphonelazext/project_iphone_options.pas b/components/iphonelazext/project_iphone_options.pas index 1dd4f3a1d..1e066aeba 100644 --- a/components/iphonelazext/project_iphone_options.pas +++ b/components/iphonelazext/project_iphone_options.pas @@ -110,6 +110,7 @@ begin isIPhoneApp:=chkisPhone.Checked; SDK:=cmbSDKs.Caption; AppID:=edtAppID.Text; + Save; DoChanged; end; end;