|
3 | 3 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can
|
4 | 4 | * obtain one at https://mozilla.org/MPL/2.0/
|
5 | 5 | *
|
6 |
| - * Copyright (C) 2011-2021, Peter Johnson (gravatar.com/delphidabbler). |
| 6 | + * Copyright (C) 2011-2022, Peter Johnson (gravatar.com/delphidabbler). |
7 | 7 | *
|
8 | 8 | * Implements a frame used to edit executable file name of compiler being edited
|
9 | 9 | * in TCompilersDlg.
|
@@ -34,6 +34,7 @@ TCompilersDlgCompilerFrame = class(TCompilersDlgBaseFrame)
|
34 | 34 | btnBrowse: TButton;
|
35 | 35 | btnClear: TButton;
|
36 | 36 | chkShowInMain: TCheckBox;
|
| 37 | + chkPermitAutoDetect: TCheckBox; |
37 | 38 | /// <summary>Displays file open dialog box and places entered file name in
|
38 | 39 | /// compiler file name edit control.</summary>
|
39 | 40 | procedure btnBrowseClick(Sender: TObject);
|
@@ -98,6 +99,7 @@ procedure TCompilersDlgCompilerFrame.ArrangeControls;
|
98 | 99 | );
|
99 | 100 | btnClear.Top := TCtrlArranger.BottomOf([edCompilerPath, btnBrowse], 8);
|
100 | 101 | chkShowInMain.Top := TCtrlArranger.BottomOf(btnClear, 24);
|
| 102 | + chkPermitAutoDetect.Top := TCtrlArranger.BottomOf(chkShowInMain, 8); |
101 | 103 | end;
|
102 | 104 |
|
103 | 105 | procedure TCompilersDlgCompilerFrame.btnBrowseClick(Sender: TObject);
|
@@ -164,12 +166,22 @@ procedure TCompilersDlgCompilerFrame.Initialise;
|
164 | 166 | begin
|
165 | 167 | edCompilerPath.Text := Compiler.GetExecFile;
|
166 | 168 | chkShowInMain.Checked := Compiler.GetDisplayable;
|
| 169 | + chkPermitAutoDetect.Visible := Supports(Compiler, ICompilerAutoDetect); |
| 170 | + if chkPermitAutoDetect.Visible then |
| 171 | + chkPermitAutoDetect.Checked := |
| 172 | + (Compiler as ICompilerAutoDetect).GetCanAutoInstall |
| 173 | + else |
| 174 | + chkPermitAutoDetect.Checked := False; |
167 | 175 | end;
|
168 | 176 |
|
169 | 177 | procedure TCompilersDlgCompilerFrame.UpdateCompiler;
|
170 | 178 | begin
|
171 | 179 | Compiler.SetExecFile(GetCompilerPath);
|
172 | 180 | Compiler.SetDisplayable(chkShowInMain.Checked);
|
| 181 | + if Supports(Compiler, ICompilerAutoDetect) then |
| 182 | + (Compiler as ICompilerAutoDetect).SetCanAutoInstall( |
| 183 | + chkPermitAutoDetect.Checked |
| 184 | + ); |
173 | 185 | end;
|
174 | 186 |
|
175 | 187 | function TCompilersDlgCompilerFrame.ValidateFileName(const FileName: string;
|
|
0 commit comments