IDE: show skipped designtime only packages

git-svn-id: trunk@32137 -
This commit is contained in:
mattias 2011-08-31 21:50:56 +00:00
parent d5ad4ab713
commit c72bad92c1
2 changed files with 93 additions and 61 deletions

View File

@ -36,10 +36,10 @@ unit compiler_inherited_options;
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
Classes, SysUtils, LCLProc, FileUtil, Forms, Controls, Graphics, Dialogs,
StdCtrls, ComCtrls, ExtCtrls,
CodeToolsCfgScript, IDEOptionsIntf, IDEImagesIntf, ProjectIntf, CompOptsIntf,
Project, CompilerOptions, LazarusIDEStrConsts, IDEProcs;
Project, PackageDefs, CompilerOptions, LazarusIDEStrConsts, IDEProcs;
type
@ -150,9 +150,28 @@ var
ChildNode.SelectedIndex := ChildNode.ImageIndex;
end;
var
SkippedPkgList: TFPList;
AProject: TProject;
Pkg: TLazPackage;
begin
OptionsList := nil;
//debugln(['TCompilerInheritedOptionsFrame.UpdateInheritedTree START CompilerOpts=',DbgSName(CompilerOpts)]);
CompilerOpts.GetInheritedCompilerOptions(OptionsList);
SkippedPkgList:=nil;
try
if CompilerOpts is TProjectCompilerOptions then begin
AProject:=TProjectCompilerOptions(CompilerOpts).LazProject;
AProject.GetAllRequiredPackages(SkippedPkgList);
if (SkippedPkgList<>nil)
and (not (pfUseDesignTimePackages in AProject.Flags)) then begin
// keep design time only packages
for i:=SkippedPkgList.Count-1 downto 0 do
if TLazPackage(SkippedPkgList[i]).PackageType<>lptDesignTime then
SkippedPkgList.Delete(i);
end;
end;
//debugln(['TCompilerInheritedOptionsFrame.UpdateInheritedTree END']);
InhTreeView.BeginUpdate;
ClearInheritedTree;
if OptionsList <> nil then
@ -225,7 +244,19 @@ begin
begin
InhTreeView.Items.Add(nil, lisNoCompilerOptionsInherited);
end;
if SkippedPkgList<>nil then begin
for i:=0 to SkippedPkgList.Count-1 do begin
Pkg:=TLazPackage(SkippedPkgList[i]);
AncestorNode := InhTreeView.Items.Add(nil, '');
AncestorNode.Text := Format(lisExcludedAtRunTime, [Pkg.Name]);
AncestorNode.ImageIndex := ImageIndexPackage;
AncestorNode.SelectedIndex := AncestorNode.ImageIndex;
end;
end;
InhTreeView.EndUpdate;
finally
SkippedPkgList.Free;
end;
end;
destructor TCompilerInheritedOptionsFrame.Destroy;

View File

@ -1773,6 +1773,7 @@ resourcestring
dlgCOOpts = 'Options: ';
dlgCOAsmStyle = 'Assembler style:';
lisNoCompilerOptionsInherited = 'No compiler options inherited.';
lisExcludedAtRunTime = '%s excluded at run time';
lisAllInheritedOptions = 'All inherited options';
lisunitPath = 'unit path';
lisincludePath = 'include path';