mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-24 21:12:21 +02:00
Packager: In order to preserve consistency with other opkman related dialogs(install/download/extract), confirmation dlg. from packager was moved to opkman. Extended InstallPackages function.
git-svn-id: trunk@56635 -
This commit is contained in:
parent
2b465125f8
commit
40b29b08ce
@ -107,7 +107,9 @@ type
|
||||
|
||||
TOPMInterface = class
|
||||
public
|
||||
function InstallPackages(APkgLinks: TList): TModalResult; virtual; abstract;
|
||||
{confirmation/install/extract/download dialogs will be displayed in the center of ParentForm}
|
||||
function InstallPackages(APkgLinks: TList; AParentForm: TForm;
|
||||
const AResolveDependencies: Boolean = True): TModalResult; virtual; abstract;
|
||||
end;
|
||||
|
||||
var
|
||||
|
||||
@ -226,32 +226,21 @@ var
|
||||
I: Integer;
|
||||
PackageLink: TPackageLink;
|
||||
PkgList: TList;
|
||||
PkgListStr: String;
|
||||
begin
|
||||
Result := mrOk;
|
||||
PkgList := TList.Create;
|
||||
try
|
||||
PkgListStr := '';
|
||||
for I := 0 to DependPkgNameListBox.Count - 1 do
|
||||
begin
|
||||
if DependPkgNameListBox.Selected[I] then
|
||||
begin
|
||||
PackageLink := FindPackageLink(TLazPackageID(DependPkgNameListBox.Items.Objects[I]));
|
||||
if (PackageLink <> nil) and (PackageLink.Origin = ploOnline) then
|
||||
begin
|
||||
PkgList.Add(PackageLink);
|
||||
if PkgListStr = '' then
|
||||
PkgListStr := '"' + PackageLink.Name + '"'
|
||||
else
|
||||
PkgListStr := PkgListStr + ', "' + PackageLink.Name + '"';
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
if PkgList.Count > 0 then
|
||||
begin
|
||||
if IDEMessageDialog(lisProjAddInstConfCaption, lisProjAddInstConf + ' ' + PkgListStr + ' ?', mtInformation, [mbYes, mbNo]) = mrYes then
|
||||
Result := OPMInterface.InstallPackages(PkgList);
|
||||
end;
|
||||
Result := OPMInterface.InstallPackages(PkgList, Self);
|
||||
finally
|
||||
PkgList.Free;
|
||||
PkgList := nil;
|
||||
@ -259,9 +248,12 @@ begin
|
||||
end;
|
||||
|
||||
procedure TAddPkgDependencyDialog.CloseButtonClick(Sender: TObject);
|
||||
var
|
||||
InstallRes: TModalResult;
|
||||
begin
|
||||
ModalResult := mrNone;
|
||||
if InstallOnlinePackages <> mrOk then
|
||||
InstallRes := InstallOnlinePackages;
|
||||
if (InstallRes <> mrCancel) and (InstallRes <> mrOk) then
|
||||
IDEMessageDialog(lisProjAddInstErrCaption, lisProjAddInstErr, mtError, [mbOk]);
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user