mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 05:39:29 +02:00
runtime packages can now be installed, but the IDE will warn
git-svn-id: trunk@7353 -
This commit is contained in:
parent
cc6e69cc7a
commit
32023e11ff
@ -388,7 +388,7 @@ var
|
||||
ANode: TAVLTreeNode;
|
||||
sl: TStringList;
|
||||
PkgName: String;
|
||||
Pkg: TLazPackageID;
|
||||
Pkg: TLazPackage;
|
||||
begin
|
||||
fPackages.Clear;
|
||||
// TODO: only distinct files
|
||||
@ -396,10 +396,12 @@ begin
|
||||
sl:=TStringList.Create;
|
||||
ANode:=fPackages.FindLowest;
|
||||
while ANode<>nil do begin
|
||||
Pkg:=TLazPackageID(ANode.Data);
|
||||
PkgName:=Pkg.IDAsString;
|
||||
if (sl.IndexOf(PkgName)<0) then
|
||||
sl.Add(PkgName);
|
||||
Pkg:=TLazPackage(ANode.Data);
|
||||
if Pkg.PackageType in [lptDesignTime,lptRunAndDesignTime] then begin
|
||||
PkgName:=Pkg.IDAsString;
|
||||
if (sl.IndexOf(PkgName)<0) then
|
||||
sl.Add(PkgName);
|
||||
end;
|
||||
ANode:=fPackages.FindSuccessor(ANode);
|
||||
end;
|
||||
AvailableListBox.Items.Assign(sl);
|
||||
|
@ -584,15 +584,18 @@ begin
|
||||
if LoadDependencyList(NewFirstAutoInstallDependency)<>mrOk then exit;
|
||||
PackageGraph.GetAllRequiredPackages(NewFirstAutoInstallDependency,PkgList);
|
||||
|
||||
// check if any package is a runtime package
|
||||
// check if any package is a runtime package, that is not needed
|
||||
for i:=0 to PkgList.Count-1 do begin
|
||||
APackage:=TLazPackage(PkgList[i]);
|
||||
if APackage.PackageType=lptRunTime then begin
|
||||
MessageDlg(lisPkgMangPackageIsNoDesigntimePackage,
|
||||
if (APackage.PackageType=lptRunTime)
|
||||
and (APackage.FirstUsedByDependency=nil) then begin
|
||||
// this is a runtime only package, not needed by any other package
|
||||
if MessageDlg(lisPkgMangPackageIsNoDesigntimePackage,
|
||||
Format(lisPkgMangThePackageIsARuntimeOnlyPackageRuntimeOnlyPackages, [
|
||||
APackage.IDAsString, #13]),
|
||||
mtError,[mbCancel],0);
|
||||
exit;
|
||||
mtWarning,[mbIgnore,mbCancel],0)<>mrIgnore
|
||||
then
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -958,7 +961,6 @@ var
|
||||
begin
|
||||
AProject:=Project1;
|
||||
if (pfMainUnitHasUsesSectionForAllUnits in AProject.Flags)
|
||||
and (APackage.PackageType in [lptRunTime,lptRunAndDesignTime])
|
||||
and (AProject.MainUnitInfo<>nil) then begin
|
||||
OldUnitName:=OldPkgName;
|
||||
NewUnitName:=APackage.Name;
|
||||
@ -3422,8 +3424,8 @@ begin
|
||||
Result:=MessageDlg(lisPkgMangPackageIsNoDesigntimePackage,
|
||||
Format(lisPkgMangThePackageIsARuntimeOnlyPackageRuntimeOnlyPackages, [
|
||||
APackage.IDAsString, #13]),
|
||||
mtError,[mbCancel,mbAbort],0);
|
||||
exit;
|
||||
mtError,[mbIgnore,mbAbort],0);
|
||||
if Result<>mrIgnore then exit;
|
||||
end;
|
||||
|
||||
// save package
|
||||
|
@ -114,7 +114,7 @@ type
|
||||
procedure ReadOptionsFromPackage;
|
||||
procedure ReadPkgTypeFromPackage;
|
||||
function GetEditForPathButton(AButton: TPathEditorButton): TEdit;
|
||||
procedure ShowMsgPackageTypeMustBeDesign;
|
||||
function ShowMsgPackageTypeMustBeDesign: Boolean;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -343,8 +343,7 @@ begin
|
||||
if NewPackageType<>LazPackage.PackageType then begin
|
||||
if (NewPackageType=lptRunTime) and (LazPackage.AutoInstall<>pitNope) then
|
||||
begin
|
||||
ShowMsgPackageTypeMustBeDesign;
|
||||
exit;
|
||||
if ShowMsgPackageTypeMustBeDesign then exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -888,13 +887,17 @@ begin
|
||||
Result:=nil;
|
||||
end;
|
||||
|
||||
procedure TPackageOptionsDialog.ShowMsgPackageTypeMustBeDesign;
|
||||
function TPackageOptionsDialog.ShowMsgPackageTypeMustBeDesign: Boolean;
|
||||
begin
|
||||
MessageDlg(lisPckOptsInvalidPackageType,
|
||||
if MessageDlg(lisPckOptsInvalidPackageType,
|
||||
Format(lisPckOptsThePackageHasTheAutoInstallFlagThisMeans, ['"',
|
||||
LazPackage.IDAsString, '"', #13, #13]),
|
||||
mtError,[mbCancel],0);
|
||||
ReadPkgTypeFromPackage;
|
||||
mtWarning,[mbIgnore,mbCancel],0) <>mrIgnore
|
||||
then begin
|
||||
Result:=true;
|
||||
ReadPkgTypeFromPackage;
|
||||
end else
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
constructor TPackageOptionsDialog.Create(TheOwner: TComponent);
|
||||
|
Loading…
Reference in New Issue
Block a user