This repository has been archived by the owner on Jul 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
PageInstallHelpFiles.pas
90 lines (77 loc) · 2.46 KB
/
PageInstallHelpFiles.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{**
DelphiPI (Delphi Package Installer)
Author : ibrahim dursun (ibrahimdursun gmail)
License : GNU General Public License 2.0
**}
unit PageInstallHelpFiles;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Vcl.Controls, Forms,
Dialogs, PageBase, StdCtrls, ComCtrls, WizardIntfs;
type
TInstallHelpFilesPage = class(TWizardPage)
Label1: TLabel;
helpFileList: TListView;
btnInstallHelpFiles: TButton;
procedure FormCreate(Sender: TObject);
procedure btnInstallHelpFilesClick(Sender: TObject);
private
public
procedure UpdateWizardState; override;
function CanShowPage: Boolean; override;
end;
var
InstallHelpFilesPage: TInstallHelpFilesPage;
implementation
{$R *.dfm}
uses JclFileUtils, JclIDEUtils, gnugettext;
{ TInstallHelpFilesPage }
function TInstallHelpFilesPage.CanShowPage: Boolean;
begin
Result := fCompilationData.HelpFiles.Count > 0;
end;
procedure TInstallHelpFilesPage.FormCreate(Sender: TObject);
var
I: Integer;
item: TListItem;
begin
inherited;
if fCompilationData.HelpFiles.Count = 0 then begin
label1.Caption := _('No help files are found.');
helpFileList.Enabled := false;
btnInstallHelpFiles.Enabled := false;
exit;
end;
if (fCompilationData.Installation.VersionNumber <= 7) then
for I := 0 to fCompilationData.HelpFiles.Count - 1 do begin
item :=helpFileList.Items.Add;
item.Caption := fCompilationData.HelpFiles[i];
item.Checked := true;
end;
end;
procedure TInstallHelpFilesPage.UpdateWizardState;
begin
inherited;
wizard.SetHeader(_('Help Files'));
wizard.SetDescription(_('Select the help files that you want to register, if there are any.'));
with wizard.GetAction(wbtBack) do
Visible := False;
end;
procedure TInstallHelpFilesPage.btnInstallHelpFilesClick(Sender: TObject);
//var
// openHelp : TJclBorlandOpenHelp;
// helpFileName: string;
// successCount: integer;
begin
inherited;
// successCount := 0;
// if fCompilationData.Installation is TJclBorRADToolInstallation then begin
// openHelp := fCompilationData.Installation.OpenHelp;
// for helpFileName in fCompilationData.HelpFiles do begin
// if openHelp.AddHelpFile(helpFileName,PathExtractFileNameNoExt(helpFileName)) then
// inc(successCount);
// end;
// end;
// ShowMessage(Format(_('%d help file(s) are registered successfully'),[successCount]));
end;
end.