From ca8e90efe3959b0bc8d1a5aaf074ee99220d7367 Mon Sep 17 00:00:00 2001 From: loesje_ Date: Wed, 16 Jan 2013 09:49:42 +0000 Subject: [PATCH] * Scan for .xib-resources (from the iOSDesigner package) and convert them to .nib files * When the project is not saved yet, use project1 for the bundle-name git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2626 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/iphonelazext/ideext.pas | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/iphonelazext/ideext.pas b/components/iphonelazext/ideext.pas index 86bad4a30..1b59df329 100644 --- a/components/iphonelazext/ideext.pas +++ b/components/iphonelazext/ideext.pas @@ -107,14 +107,18 @@ var Space : WideString; RealSpace : WideString; Info : TiPhoneBundleInfo; + AProjectFile: TLazProjectFile; xiblist : TStringList; i : Integer; + s : string; begin Space:=ProjOptions.SpaceName; // LazarusIDE.ActiveProject.CustomData.; bundleName:=ExtractFileName(LazarusIDE.ActiveProject.ProjectInfoFile); bundleName:=Copy(bundleName, 1, length(bundleName)-length(ExtractFileExt(bundleName))); + if bundlename='' then + bundlename:='project1'; nm:=GetProjectExeName(LazarusIDE.ActiveProject); @@ -139,6 +143,15 @@ begin xiblist := TStringList.Create; try + // Scan for resource-files in the .xib file-format, which are + // used by the iOSDesigner package + for i := 0 to LazarusIDE.ActiveProject.FileCount-1 do + begin + AProjectFile := LazarusIDE.ActiveProject.Files[i]; + s := ChangeFileExt(AProjectFile.filename,'.xib'); + if (AProjectFile.IsPartOfProject) and FileExistsUTF8(s) then + xiblist.add(s); + end; EnumFilesAtDir(ResolveProjectPath(ProjOptions.ResourceDir), '*.xib', xiblist); for i:=0 to xiblist.Count-1 do begin dstpath:=IncludeTrailingPathDelimiter(bundlepath)+ChangeFileExt(ExtractFileName(xiblist[i]), '.nib');