Opkman: Add a new node("External dependencies") to the package tree. The node provides information about any external libraries/files required by the package.

git-svn-id: trunk@62962 -
This commit is contained in:
balazs 2020-04-14 08:16:49 +00:00
parent 48e5d6068e
commit 742ffadced
6 changed files with 116 additions and 62 deletions

View File

@ -88,6 +88,7 @@ resourcestring
rsMainFrm_VSTText_PackageInfo = 'Package info';
rsMainFrm_VSTText_Category = 'Category';
rsMainFrm_VSTText_CommunityDescription = 'Community description';
rsMainFrm_VSTText_ExternalDependecies = 'External dependencies';
rsMainFrm_VSTText_RepositoryFilename = 'Repository filename';
rsMainFrm_VSTText_RepositoryFileSize = 'Repository filesize';
rsMainFrm_VSTText_RepositoryFileHash = 'Repository filehash';
@ -143,6 +144,7 @@ resourcestring
rsMainFrm_VSTText_Open_Notfound = 'Package file not found.';
rsMainFrm_VSTText_Open_Error = 'Cannot open package file.';
rsMainFrm_VSTText_ComDesc = 'Community description for metapackage';
rsMainFrm_VSTText_ExternalDependencies = 'External dependencies for metapackage';
rsMainFrm_cbAll_Caption = 'All/None';
rsMainFrm_cbAll_Hint = 'Check/Uncheck packages';
rsMainFrm_lbFilter_Caption = 'Filter by:';

View File

@ -1,12 +1,12 @@
object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 511
Height = 600
Top = 198
Width = 800
Left = 429
Height = 687
Top = 173
Width = 904
BorderIcons = [biSystemMenu]
Caption = 'CreateRepositoryPackagesFrm'
ClientHeight = 600
ClientWidth = 800
ClientHeight = 687
ClientWidth = 904
Constraints.MinHeight = 450
Constraints.MinWidth = 650
OnCreate = FormCreate
@ -16,9 +16,9 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
LCLVersion = '2.1.0.0'
object pnMessage: TPanel
Left = 247
Height = 502
Height = 589
Top = 57
Width = 553
Width = 657
Align = alClient
BevelOuter = bvNone
Caption = 'No items to show'
@ -35,7 +35,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
end
object pnPackages: TPanel
Left = 0
Height = 502
Height = 589
Top = 57
Width = 245
Align = alLeft
@ -46,11 +46,11 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 0
Height = 57
Top = 0
Width = 800
Width = 904
Align = alTop
BevelOuter = bvNone
ClientHeight = 57
ClientWidth = 800
ClientWidth = 904
TabOrder = 2
object lbPackagedir: TLabel
AnchorSideLeft.Control = pnBrowse
@ -69,7 +69,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 0
Height = 2
Top = 55
Width = 800
Width = 904
Align = alBottom
end
object edPackageDir: TDirectoryEdit
@ -82,7 +82,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 80
Height = 23
Top = 17
Width = 714
Width = 818
OnAcceptDirectory = edPackageDirAcceptDirectory
ShowHidden = False
ButtonWidth = 23
@ -96,24 +96,24 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
end
object pnData: TPanel
Left = 247
Height = 502
Height = 589
Top = 57
Width = 553
Width = 657
Align = alClient
BevelOuter = bvNone
ClientHeight = 502
ClientWidth = 553
ClientHeight = 589
ClientWidth = 657
TabOrder = 3
object pnPackageData: TPanel
Left = 0
Height = 187
Top = 315
Width = 553
Height = 110
Top = 479
Width = 657
Align = alClient
BevelOuter = bvNone
BorderStyle = bsSingle
ClientHeight = 183
ClientWidth = 549
ClientHeight = 106
ClientWidth = 653
TabOrder = 1
Visible = False
object lbLazCompatibility: TLabel
@ -141,7 +141,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
ParentColor = False
end
object lbOF1: TLabel
Left = 524
Left = 628
Height = 15
Top = 14
Width = 5
@ -153,7 +153,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
ParentFont = False
end
object lbOF3: TLabel
Left = 524
Left = 628
Height = 15
Top = 50
Width = 5
@ -165,7 +165,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
ParentFont = False
end
object lbOF4: TLabel
Left = 524
Left = 628
Height = 15
Top = 85
Width = 5
@ -180,17 +180,17 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 9
Width = 351
Width = 455
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 351
ClientWidth = 455
ParentColor = False
TabOrder = 0
object spLazCompatibility: TSpeedButton
Tag = 2
Left = 328
Left = 432
Height = 23
Top = 0
Width = 23
@ -204,7 +204,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 0
Height = 23
Top = 0
Width = 328
Width = 432
Align = alClient
AutoSize = False
ParentShowHint = False
@ -217,17 +217,17 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 45
Width = 351
Width = 455
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 351
ClientWidth = 455
ParentColor = False
TabOrder = 1
object spFPCCompatibility: TSpeedButton
Tag = 3
Left = 328
Left = 432
Height = 23
Top = 0
Width = 23
@ -241,7 +241,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 0
Height = 23
Top = 0
Width = 328
Width = 432
Align = alClient
AutoSize = False
ParentShowHint = False
@ -254,17 +254,17 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 79
Width = 351
Width = 455
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 351
ClientWidth = 455
ParentColor = False
TabOrder = 2
object spSupportedWidgetset: TSpeedButton
Tag = 4
Left = 328
Left = 432
Height = 23
Top = 0
Width = 23
@ -278,7 +278,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 0
Height = 23
Top = 0
Width = 328
Width = 432
Align = alClient
AutoSize = False
ParentShowHint = False
@ -290,14 +290,14 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
end
object pnCategory: TPanel
Left = 0
Height = 315
Height = 479
Top = 0
Width = 553
Width = 657
Align = alTop
BevelOuter = bvNone
BorderStyle = bsSingle
ClientHeight = 311
ClientWidth = 549
ClientHeight = 475
ClientWidth = 653
TabOrder = 0
Visible = False
object lbCategory: TLabel
@ -309,7 +309,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
ParentColor = False
end
object lbOF2: TLabel
Left = 524
Left = 628
Height = 15
Top = 14
Width = 5
@ -340,7 +340,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 83
Width = 350
Width = 454
Anchors = [akTop, akLeft, akRight]
TabOrder = 2
end
@ -348,7 +348,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 118
Width = 350
Width = 454
Anchors = [akTop, akLeft, akRight]
TabOrder = 3
end
@ -365,7 +365,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 152
Width = 350
Width = 454
Anchors = [akTop, akLeft, akRight]
TabOrder = 4
Visible = False
@ -382,7 +382,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 48
Width = 350
Width = 454
Anchors = [akTop, akLeft, akRight]
OnKeyPress = edDisplayNameKeyPress
TabOrder = 1
@ -391,17 +391,17 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 9
Width = 351
Width = 455
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 351
ClientWidth = 455
ParentColor = False
TabOrder = 0
object spCategories: TSpeedButton
Tag = 1
Left = 328
Left = 432
Height = 23
Top = 0
Width = 23
@ -415,7 +415,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 0
Height = 23
Top = 0
Width = 328
Width = 432
Align = alClient
AutoSize = False
ParentShowHint = False
@ -428,7 +428,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 152
Top = 152
Width = 350
Width = 454
TabOrder = 5
end
object lbComDescr: TLabel
@ -439,11 +439,26 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Caption = 'lbComDescr'
ParentColor = False
end
object lbExternalDependencies: TLabel
Left = 9
Height = 15
Top = 314
Width = 125
Caption = 'lbExternalDependencies'
ParentColor = False
end
object mExternalDependencies: TMemo
Left = 170
Height = 152
Top = 314
Width = 454
TabOrder = 6
end
end
end
object spMain: TSplitter
Left = 245
Height = 502
Height = 589
Top = 57
Width = 2
AutoSnap = False
@ -454,13 +469,13 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
object pnButtons: TPanel
Left = 0
Height = 41
Top = 559
Width = 800
Top = 646
Width = 904
Align = alBottom
BevelOuter = bvNone
BorderStyle = bsSingle
ClientHeight = 37
ClientWidth = 796
ClientWidth = 900
TabOrder = 5
object cbJSONForUpdates: TCheckBox
AnchorSideLeft.Control = pnButtons
@ -479,7 +494,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = pnButtons
AnchorSideRight.Side = asrBottom
Left = 375
Left = 479
Height = 29
Top = 4
Width = 415

View File

@ -60,6 +60,7 @@ type
edSVNURL: TEdit;
edHomePageURL: TEdit;
lbCategory: TLabel;
lbExternalDependencies: TLabel;
lbDownloadURL: TLabel;
lbDisplayName: TLabel;
lbSVNURL: TLabel;
@ -74,6 +75,7 @@ type
lbSupportedWidgetSet: TLabel;
lbComDescr: TLabel;
mComDescr: TMemo;
mExternalDependencies: TMemo;
pnB: TPanel;
pnButtons: TPanel;
pnCategories: TPanel;
@ -194,6 +196,7 @@ type
FDownloadURL: String;
FSVNURL: String;
FCommunityDescription: String;
FExternalDependencies: String;
end;
procedure TCreateRepositoryPackagesFrm.FormCreate(Sender: TObject);
@ -211,6 +214,7 @@ begin
lbDownloadURL.Caption := rsCreateRepositoryPackageFrm_lbDownloadURL_Caption;
lbSVNURL.Caption := rsCreateRepositoryPackageFrm_lbSVNURL_Caption;
lbComDescr.Caption := rsMainFrm_VSTText_CommunityDescription + ':';
lbExternalDependencies.Caption := rsMainFrm_VSTText_ExternalDependecies + ':';
bHelp.Caption := rsCreateRepositoryPackageFrm_bHelp_Caption;
bHelp.Hint := rsCreateRepositoryPackageFrm_bHelp_Hint;
@ -476,6 +480,7 @@ begin
RootData^.FDownloadURL := '';
RootData^.FSVNURL := '';
RootData^.FCommunityDescription := '';
RootData^.FExternalDependencies := '';
RootData^.FDataType := 0;
FPackageName := RootData^.FName;
for I := 0 to PackageList.Count - 1 do
@ -748,6 +753,7 @@ begin
Data^.FDownloadURL := edDownloadURL.Text;
Data^.FSVNURL := edSVNURL.Text;
Data^.FCommunityDescription := mComDescr.Text;
Data^.FExternalDependencies := mExternalDependencies.Text;
end;
1: begin
Data^.FLazCompatibility := edLazCompatibility.Text;
@ -797,6 +803,7 @@ begin
edDownloadURL.Text := Data^.FDownloadURL;
edSVNURL.Text := Data^.FSVNURL;
mComDescr.Text := Data^.FCommunityDescription;
mExternalDependencies.Text := Data^.FExternalDependencies;
end
else if Level = 1 then
begin
@ -1076,6 +1083,7 @@ begin
MetaPkg.DownloadURL := RootData^.FDownloadURL;
MetaPkg.SVNURL := RootData^.FSVNURL;
MetaPkg.CommunityDescription := RootData^.FCommunityDescription;
MetaPkg.ExternalDependecies := RootData^.FExternalDependencies;
Node := FVSTPackages.GetFirstChild(RootNode);
while Assigned(Node) do
begin

View File

@ -7,7 +7,7 @@ interface
uses
SysUtils, Classes, laz.VirtualTrees,
// LCL
Forms, Controls, Buttons, Graphics, ExtCtrls, StdCtrls, LCLType, ButtonPanel,
Forms, Controls, Buttons, Graphics, ExtCtrls, LCLType, ButtonPanel,
Menus,
//IDEIntf
PackageIntf,

View File

@ -172,6 +172,7 @@ type
FDisplayName: String;
FCategory: String;
FCommunityDescription: String;
FExternalDependencies: String;
FRepositoryFileName: String;
FRepositoryFileSize: Int64;
FRepositoryFileHash: String;
@ -214,7 +215,8 @@ type
property Name: String read FName write FName;
property DisplayName: String read FDisplayName write FDisplayName;
property Category: String read FCategory write FCategory;
property CommunityDescription: string read FCommunityDescription write FCommunityDescription;
property CommunityDescription: String read FCommunityDescription write FCommunityDescription;
property ExternalDependecies: String read FExternalDependencies write FExternalDependencies;
property Checked: Boolean read FChecked write FChecked;
property RepositoryFileName: String read FRepositoryFileName write FRepositoryFileName;
property RepositoryFileSize: int64 read FRepositoryFileSize write FRepositoryFileSize;
@ -856,6 +858,7 @@ begin
AMetaPackage.DisplayName := PackageData.Get('DisplayName');
AMetaPackage.Category := PackageData.Get('Category');
AMetaPackage.CommunityDescription := PackageData.Get('CommunityDescription');
AMetaPackage.ExternalDependecies := PackageData.Get('ExternalDependecies');
AMetaPackage.RepositoryFileName := PackageData.Get('RepositoryFileName');
AMetaPackage.RepositoryFileSize := PackageData.Get('RepositoryFileSize');
AMetaPackage.RepositoryFileHash := PackageData.Get('RepositoryFileHash');
@ -1311,6 +1314,7 @@ begin
APackageData.Add('DisplayName', AMetaPackage.DisplayName);
APackageData.Add('Category', AMetaPackage.Category);
APackageData.Add('CommunityDescription', AMetaPackage.CommunityDescription);
APackageData.Add('ExternalDependecies', AMetaPackage.ExternalDependecies);
APackageData.Add('RepositoryFileName', AMetaPackage.RepositoryFileName);
APackageData.Add('RepositoryFileSize', AMetaPackage.RepositoryFileSize);
APackageData.Add('RepositoryFileHash', AMetaPackage.RepositoryFileHash);

View File

@ -75,6 +75,7 @@ type
IsUpdated: Boolean;
SVNURL: String;
CommunityDescription: String;
ExternalDependencies: String;
InstallState: Integer;
ButtonID: Integer;
Button: TSpeedButton;
@ -490,7 +491,17 @@ begin
GrandChildData^.DataType := 19;
Inc(UniqueID);
GrandChildData^.ButtonID := UniqueID;
Data^.CommunityDescription := SerializablePackages.Items[I].CommunityDescription;;
Data^.CommunityDescription := SerializablePackages.Items[I].CommunityDescription;
//add external dependecies(DataType = 20) - added 2020.04.14
GrandChildNode := FVST.AddChild(ChildNode);
FVST.IsDisabled[GrandChildNode] := FVST.IsDisabled[GrandChildNode^.Parent];
GrandChildData := FVST.GetNodeData(GrandChildNode);
GrandChildData^.ExternalDependencies := SerializablePackages.Items[I].ExternalDependecies;
GrandChildData^.DataType := 20;
Inc(UniqueID);
GrandChildData^.ButtonID := UniqueID;
Data^.ExternalDependencies := SerializablePackages.Items[I].ExternalDependecies;
end;
FVST.SortTree(0, laz.VirtualTrees.sdAscending);
ExpandEx;
@ -559,6 +570,15 @@ begin
FrmCaption := rsMainFrm_VSTText_ComDesc + ' "' + MetaPackageData^.PackageDisplayName + '"';
end;
end;
20: begin
MetaPackageNode := ParentNode^.Parent;
if MetaPackageNode <> nil then
begin
MetaPackageData := VST.GetNodeData(MetaPackageNode);
Text := Data^.ExternalDependencies;
FrmCaption := rsMainFrm_VSTText_ExternalDependencies + ' "' + MetaPackageData^.PackageDisplayName + '"';
end;
end;
end;
Break;
end;
@ -1209,7 +1229,7 @@ begin
FVST.RepaintNode(Node);
end;
end;
if Data^.DataType in [3..19] then
if Data^.DataType in [3..20] then
begin
FVST.IsDisabled[Node] := FVST.IsDisabled[Node^.Parent];
ParentData := FVST.GetNodeData(Node^.Parent);
@ -1457,7 +1477,8 @@ begin
ImageIndex := 25
else
ImageIndex := 1;
else
20: ImageIndex := 9
else
ImageIndex := Data^.DataType
end;
end;
@ -1529,6 +1550,7 @@ begin
17: CellText := rsMainFrm_VSTText_HomePageURL;
18: CellText := rsMainFrm_VSTText_DownloadURL;
19: CellText := rsMainFrm_VSTText_CommunityDescription;
20: CellText := rsMainFrm_VSTText_ExternalDependecies
end;
end
else if Column = 1 then
@ -1631,6 +1653,7 @@ begin
17: CellText := Data^.HomePageURL;
18: CellText := Data^.DownloadURL;
19: CellText := GetDisplayString(Data^.CommunityDescription);
20: CellText := GetDisplayString(Data^.ExternalDependencies);
end;
end
else if Column = 5 then
@ -1840,7 +1863,8 @@ begin
((Data^.DataType = 2) and (Data^.PackageState in [psExtracted, psInstalled])) or
((Data^.DataType = 3) and (Trim(Data^.Description) <> '')) or
((Data^.DataType = 9) and (Trim(Data^.License) <> '')) or
((Data^.DataType = 19) and (Trim(Data^.CommunityDescription) <> ''))
((Data^.DataType = 19) and (Trim(Data^.CommunityDescription) <> '')) or
((Data^.DataType = 20) and (Trim(Data^.ExternalDependencies) <> ''))
) then
begin
Data := FVST.GetNodeData(FHoverNode);
@ -2006,6 +2030,7 @@ begin
17: HintText := Data^.HomePageURL;
18: HintText := Data^.DownloadURL;
19: HintText := Data^.CommunityDescription;
20: HintText := Data^.ExternalDependencies;
else
HintText := '';
end;