-
Notifications
You must be signed in to change notification settings - Fork 0
/
PageCompilerOptions.pas
146 lines (127 loc) · 3.93 KB
/
PageCompilerOptions.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{**
DelphiPI (Delphi Package Installer)
Author : ibrahim dursun (ibrahimdursun gmail)
License : GNU General Public License 2.0
**}
unit PageCompilerOptions;
interface
uses
Classes, CompilationData, Windows, Messages, SysUtils, Variants, Graphics, Controls, Forms,
Dialogs, PageBase, StdCtrls, ExtCtrls, WizardIntfs;
type
TSelectCompilerOptions = class(TWizardPage)
grpOutputFolders: TGroupBox;
lblBPLOutputFolder: TLabel;
edtBPL: TEdit;
btnBPLBrowse: TButton;
lblDCP: TLabel;
edtDCP: TEdit;
btnDCPBrowse: TButton;
lblDCU: TLabel;
edtDCU: TEdit;
btnDCUBrowse: TButton;
Label1: TLabel;
edtConditionals: TEdit;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure btnBPLBrowseClick(Sender: TObject);
procedure btnDCPBrowseClick(Sender: TObject);
procedure btnDCUBrowseClick(Sender: TObject);
private
procedure SaveInstallationOutputFolders;
procedure ShowInstallationOutputFolders;
procedure BrowseFolder(var folder: string);
function SelectFolder(const editBox: TEdit): string;
public
constructor Create(Owner: TComponent; const compilationData: TCompilationData); override;
procedure UpdateWizardState; override;
function CanShowPage: Boolean; override;
end;
var
SelectCompilerOptions: TSelectCompilerOptions;
implementation
uses gnugettext, FileCtrl;
{$R *.dfm}
{ TSelectDelphiInstallationPage }
constructor TSelectCompilerOptions.Create(Owner: TComponent;
const compilationData: TCompilationData);
begin
inherited;
TranslateComponent(self);
FCompilationData := compilationData;
end;
procedure TSelectCompilerOptions.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
inherited;
SaveInstallationOutputFolders;
end;
procedure TSelectCompilerOptions.FormCreate(Sender: TObject);
begin
inherited;
TranslateComponent(self);
ShowInstallationOutputFolders;
end;
procedure TSelectCompilerOptions.BrowseFolder(var folder:string);
var
directory: string;
begin
directory := '';
if SelectDirectory(_('Select output folder'),'',directory) then
begin
folder := directory;
end;
end;
function TSelectCompilerOptions.SelectFolder(const editBox: TEdit):string;
var
path: string;
begin
inherited;
Assert(Assigned(editBox));
path := editBox.Text;
BrowseFolder(path);
editBox.Text := path;
end;
procedure TSelectCompilerOptions.btnBPLBrowseClick(Sender: TObject);
begin
inherited;
SelectFolder(edtBPL);
end;
procedure TSelectCompilerOptions.btnDCPBrowseClick(Sender: TObject);
begin
inherited;
SelectFolder(edtDCP);
end;
procedure TSelectCompilerOptions.btnDCUBrowseClick(Sender: TObject);
begin
inherited;
SelectFolder(edtDCU);
end;
function TSelectCompilerOptions.CanShowPage: Boolean;
begin
Result := True;
//Result := FCompilationData.Scripting;
end;
procedure TSelectCompilerOptions.SaveInstallationOutputFolders;
begin
Assert(Assigned(fCompilationData), 'Compilation data is null');
fCompilationData.BPLOutputFolder := edtBPL.Text;
fCompilationData.DCPOutputFolder := edtDCP.Text;
fCompilationData.DCUOutputFolder := edtDCU.Text;
fCompilationData.Conditionals := edtConditionals.Text;
end;
procedure TSelectCompilerOptions.ShowInstallationOutputFolders;
begin
Assert(Assigned(fCompilationData), 'Compilation data is null');
edtBPL.Text:= fCompilationData.BPLOutputFolder;
edtDCP.Text:= fCompilationData.DCPOutputFolder;
edtDCU.Text:= fCompilationData.DCUOutputFolder;
edtConditionals.Text := fCompilationData.Conditionals;
end;
procedure TSelectCompilerOptions.UpdateWizardState;
begin
inherited;
wizard.SetHeader(_('Select Output Folders and Compiler Conditionals'));
wizard.SetDescription(_('Please select output folders and compiler conditionals that will affect the compilation'));
end;
end.