IDE: when no lps file: open main unit

git-svn-id: trunk@22939 -
This commit is contained in:
mattias 2009-12-03 10:59:32 +00:00
parent ca869ce1fc
commit 1d47d3d54a
6 changed files with 35 additions and 28 deletions

View File

@ -24,13 +24,10 @@
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local> </local>
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="1">
<Item1> <Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="CodeTools"/> <PackageName Value="CodeTools"/>
</Item2> </Item1>
</RequiredPackages> </RequiredPackages>
<Units Count="3"> <Units Count="3">
<Unit0> <Unit0>

View File

@ -4,6 +4,8 @@
<Version Value="7"/> <Version Value="7"/>
<General> <General>
<Flags> <Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<LRSInOutputDirectory Value="False"/> <LRSInOutputDirectory Value="False"/>
</Flags> </Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>

View File

@ -4,6 +4,8 @@
<Version Value="7"/> <Version Value="7"/>
<General> <General>
<Flags> <Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<LRSInOutputDirectory Value="False"/> <LRSInOutputDirectory Value="False"/>
</Flags> </Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>

View File

@ -1,9 +1,11 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<PathDelim Value="/"/> <Version Value="7"/>
<Version Value="6"/>
<General> <General>
<Flags>
<LRSInOutputDirectory Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<TargetFileExt Value=""/> <TargetFileExt Value=""/>

View File

@ -1,12 +1,15 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<PathDelim Value="/"/> <Version Value="7"/>
<Version Value="6"/>
<General> <General>
<Flags>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<LRSInOutputDirectory Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
</General> </General>
<PublishOptions> <PublishOptions>
@ -39,13 +42,10 @@
</Units> </Units>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="5"/> <Version Value="8"/>
<SearchPaths> <SearchPaths>
<OtherUnitFiles Value="scanexamples/"/> <OtherUnitFiles Value="scanexamples/"/>
</SearchPaths> </SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Other> <Other>
<CompilerPath Value="$(CompPath)"/> <CompilerPath Value="$(CompPath)"/>
</Other> </Other>

View File

@ -2450,14 +2450,17 @@ var
BestUnitInfo:=nil; BestUnitInfo:=nil;
if (MainUnitID>=0) if (MainUnitID>=0) then begin
and ([pfMainUnitHasCreateFormStatements,pfMainUnitHasTitleStatement]*Flags=[]) if Requires(PackageGraph.LCLPackage,true)
and (Flags*[pfMainUnitHasCreateFormStatements,pfMainUnitHasTitleStatement]<>[])
then begin then begin
// the main unit contains no automatic statements // this is a probably a LCL project where the main source only contains
// open the main unit // automatic code
end else
BestUnitInfo:=MainUnitInfo; BestUnitInfo:=MainUnitInfo;
end; end;
if BestUnitInfo=nil then begin
AnUnitInfo:=FirstPartOfProject; AnUnitInfo:=FirstPartOfProject;
while AnUnitInfo<>nil do begin while AnUnitInfo<>nil do begin
if (BestUnitInfo=nil) if (BestUnitInfo=nil)
@ -2468,6 +2471,7 @@ var
end; end;
AnUnitInfo:=AnUnitInfo.NextPartOfProject; AnUnitInfo:=AnUnitInfo.NextPartOfProject;
end; end;
end;
if BestUnitInfo<>nil then begin if BestUnitInfo<>nil then begin
BestUnitInfo.EditorIndex:=0; BestUnitInfo.EditorIndex:=0;
ActiveEditorIndexAtStart:=0; ActiveEditorIndexAtStart:=0;