Skip to content

Commit

Permalink
implemented buttons to open homepage, projectpage and bugreportingpage
Browse files Browse the repository at this point in the history
  • Loading branch information
Memnarch committed Aug 29, 2015
1 parent 9d165f7 commit 2f31f4a
Show file tree
Hide file tree
Showing 12 changed files with 715 additions and 3 deletions.
12 changes: 12 additions & 0 deletions DN.JSonFile.CacheInfo.pas
Expand Up @@ -23,6 +23,9 @@ TCacheInfo = class(TJSonFile)
FVersions: TStringDynArray;
FDownloadLocation: string;
FRepositoryName: string;
FProjectUrl: string;
FReportUrl: string;
FHomepageUrl: string;
protected
procedure Load(const ARoot: TJSONObject); override;
procedure Save(const ARoot: TJSONObject); override;
Expand All @@ -33,6 +36,9 @@ TCacheInfo = class(TJSonFile)
property RepositoryName: string read FRepositoryName write FRepositoryName;
property DownloadLocation: string read FDownloadLocation write FDownloadLocation;
property Versions: TStringDynArray read FVersions write FVersions;
property ProjectUrl: string read FProjectUrl write FProjectUrl;
property HomepageUrl: string read FHomepageUrl write FHomepageUrl;
property ReportUrl: string read FReportUrl write FReportUrl;
end;

implementation
Expand All @@ -50,6 +56,9 @@ procedure TCacheInfo.Load(const ARoot: TJSONObject);
FDefaultBranch := ReadString(ARoot, 'default_branch');
FRepositoryName := ReadString(ARoot, 'repository_name');
FDownloadLocation := ReadString(ARoot, 'download_location');
FProjectUrl := ReadString(ARoot, 'project_url');
FHomepageUrl := ReadString(ARoot, 'homepage_url');
FReportUrl := ReadString(ARoot, 'report_url');
if ReadArray(ARoot, 'versions', LArray) then
begin
SetLength(FVersions, LArray.Count);
Expand All @@ -71,6 +80,9 @@ procedure TCacheInfo.Save(const ARoot: TJSONObject);
WriteString(ARoot, 'default_branch', FDefaultBranch);
WriteString(ARoot, 'repository_name', FRepositoryName);
WriteString(ARoot, 'download_location', FDownloadLocation);
WriteString(ARoot, 'project_url', FProjectUrl);
WriteString(ARoot, 'homepage_url', FHomepageUrl);
WriteString(ARoot, 'report_url',FReportUrl);
LArray := WriteArray(ARoot, 'versions');
for LVersion in FVersions do
begin
Expand Down
12 changes: 12 additions & 0 deletions DN.JSonFile.InstalledInfo.pas
Expand Up @@ -19,13 +19,19 @@ TInstalledInfoFile = class(TInfoFile)
FDescription: string;
FVersion: string;
FAuthor: string;
FProjectUrl: string;
FReportUrl: string;
FHomepageUrl: string;
protected
procedure Load(const ARoot: TJSONObject); override;
procedure Save(const ARoot: TJSONObject); override;
public
property Author: string read FAuthor write FAuthor;
property Description: string read FDescription write FDescription;
property Version: string read FVersion write FVersion;
property ProjectUrl: string read FProjectUrl write FProjectUrl;
property HomepageUrl: string read FHomepageUrl write FHomepageUrl;
property ReportUrl: string read FReportUrl write FReportUrl;
end;

implementation
Expand All @@ -38,6 +44,9 @@ procedure TInstalledInfoFile.Load(const ARoot: TJSONObject);
FAuthor := ReadString(ARoot, 'author');
FDescription := ReadString(ARoot, 'description');
FVersion := ReadString(ARoot, 'version');
FProjectUrl := ReadString(ARoot, 'project_url');
FHomepageUrl := ReadString(ARoot, 'homepage_url');
FReportUrl := ReadString(ARoot, 'report_url');
end;

procedure TInstalledInfoFile.Save(const ARoot: TJSONObject);
Expand All @@ -46,6 +55,9 @@ procedure TInstalledInfoFile.Save(const ARoot: TJSONObject);
WriteString(ARoot, 'author', FAuthor);
WriteString(ARoot, 'description', FDescription);
WriteString(ARoot, 'version', FVersion);
WriteString(ARoot, 'project_url', FProjectUrl);
WriteString(ARoot, 'homepage_url', FHomepageUrl);
WriteString(ARoot, 'report_url', FReportUrl);
end;

end.
9 changes: 9 additions & 0 deletions DN.Package.Intf.pas
Expand Up @@ -41,6 +41,12 @@ interface
function GetLicenseType: string;
procedure SetLicenseText(const Value: string);
procedure SetLicenseType(const Value: string);
function GetHomepageUrl: string;
function GetProjectUrl: string;
function GetReportUrl: string;
procedure SetProjectUrl(const Value: string);
procedure SetReportUrl(const Value: string);
procedure SetHomepageUrl(const Value: string);
property ID: TGUID read GetID write SetID;
property CompilerMin: TCompilerVersion read GetCompilerMin write SetCompilerMin;
property CompilerMax: TCompilerVersion read GetCompilerMax write SetCompilerMax;
Expand All @@ -53,6 +59,9 @@ interface
property Versions: TList<IDNPackageVersion> read GetVersions;
property LicenseType: string read GetLicenseType write SetLicenseType;
property LicenseText: string read GetLicenseText write SetLicenseText;
property ProjectUrl: string read GetProjectUrl write SetProjectUrl;
property HomepageUrl: string read GetHomepageUrl write SetHomepageUrl;
property ReportUrl: string read GetReportUrl write SetReportUrl;
end;

implementation
Expand Down
42 changes: 42 additions & 0 deletions DN.Package.pas
Expand Up @@ -32,6 +32,9 @@ TDNPackage = class(TInterfacedObject, IDNPackage)
FVersions: TList<IDNPackageVersion>;
FLicenseType: string;
FLicenseText: string;
FProjectUrl: string;
FHomepageUrl: string;
FReportUrl: string;
protected
function GetID: TGUID; virtual;
procedure SetID(const Value: TGUID); virtual;
Expand All @@ -55,6 +58,12 @@ TDNPackage = class(TInterfacedObject, IDNPackage)
function GetLicenseType: string; virtual;
procedure SetLicenseText(const Value: string); virtual;
procedure SetLicenseType(const Value: string); virtual;
function GetHomepageUrl: string; virtual;
function GetProjectUrl: string; virtual;
function GetReportUrl: string; virtual;
procedure SetProjectUrl(const Value: string); virtual;
procedure SetReportUrl(const Value: string); virtual;
procedure SetHomepageUrl(const Value: string); virtual;
public
constructor Create();
destructor Destroy(); override;
Expand All @@ -70,6 +79,9 @@ TDNPackage = class(TInterfacedObject, IDNPackage)
property Versions: TList<IDNPackageVersion> read GetVersions;
property LicenseType: string read GetLicenseType write SetLicenseType;
property LicenseText: string read GetLicenseText write SetLicenseText;
property ProjectUrl: string read GetProjectUrl write SetProjectUrl;
property HomepageUrl: string read GetHomepageUrl write SetHomepageUrl;
property ReportUrl: string read GetReportUrl write SetReportUrl;
end;

implementation
Expand Down Expand Up @@ -115,6 +127,11 @@ function TDNPackage.GetDownloadLocation: string;
Result := FDownloadLocation;
end;

function TDNPackage.GetHomepageUrl: string;
begin
Result := FHomepageUrl;
end;

function TDNPackage.GetID: TGUID;
begin
Result := FID;
Expand Down Expand Up @@ -145,6 +162,16 @@ function TDNPackage.GetPicture: TPicture;
Result := FPicture;
end;

function TDNPackage.GetProjectUrl: string;
begin
Result := FProjectUrl;
end;

function TDNPackage.GetReportUrl: string;
begin
Result := FReportUrl;
end;

function TDNPackage.GetVersions: TList<IDNPackageVersion>;
begin
Result := FVersions;
Expand Down Expand Up @@ -175,6 +202,11 @@ procedure TDNPackage.SetDownloadLocation(const Value: string);
FDownloadLocation := Value;
end;

procedure TDNPackage.SetHomepageUrl(const Value: string);
begin
FHomepageUrl := Value;
end;

procedure TDNPackage.SetID(const Value: TGUID);
begin
FID := Value;
Expand All @@ -200,4 +232,14 @@ procedure TDNPackage.SetName(const Value: string);
FName := Value;
end;

procedure TDNPackage.SetProjectUrl(const Value: string);
begin
FProjectUrl := Value;
end;

procedure TDNPackage.SetReportUrl(const Value: string);
begin
FReportUrl := Value;
end;

end.

0 comments on commit 2f31f4a

Please sign in to comment.