Skip to content

Commit 9209e64

Browse files
committed
Add option to switch off pre-compiler auto-detect
Update FmCompilersDlg.FrCompiler frame to display a check box for Delphi compilers to permit auto-detection of each compiler to be disabled.
1 parent cb68028 commit 9209e64

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

Src/FmCompilersDlg.FrCompiler.dfm

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
inherited CompilersDlgCompilerFrame: TCompilersDlgCompilerFrame
2+
DesignSize = (
3+
362
4+
235)
25
object lblCompilerPath: TLabel
36
Left = 4
47
Top = 4
@@ -46,9 +49,17 @@ inherited CompilersDlgCompilerFrame: TCompilersDlgCompilerFrame
4649
object chkShowInMain: TCheckBox
4750
Left = 4
4851
Top = 88
49-
Width = 273
52+
Width = 320
5053
Height = 17
5154
Caption = 'Display &results for this compiler in details pane'
5255
TabOrder = 3
5356
end
57+
object chkPermitAutoDetect: TCheckBox
58+
Left = 4
59+
Top = 111
60+
Width = 320
61+
Height = 17
62+
Caption = 'Permit &auto-detection && registration of this compiler'
63+
TabOrder = 4
64+
end
5465
end

Src/FmCompilersDlg.FrCompiler.pas

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at https://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2011-2021, Peter Johnson (gravatar.com/delphidabbler).
6+
* Copyright (C) 2011-2022, Peter Johnson (gravatar.com/delphidabbler).
77
*
88
* Implements a frame used to edit executable file name of compiler being edited
99
* in TCompilersDlg.
@@ -34,6 +34,7 @@ TCompilersDlgCompilerFrame = class(TCompilersDlgBaseFrame)
3434
btnBrowse: TButton;
3535
btnClear: TButton;
3636
chkShowInMain: TCheckBox;
37+
chkPermitAutoDetect: TCheckBox;
3738
/// <summary>Displays file open dialog box and places entered file name in
3839
/// compiler file name edit control.</summary>
3940
procedure btnBrowseClick(Sender: TObject);
@@ -98,6 +99,7 @@ procedure TCompilersDlgCompilerFrame.ArrangeControls;
9899
);
99100
btnClear.Top := TCtrlArranger.BottomOf([edCompilerPath, btnBrowse], 8);
100101
chkShowInMain.Top := TCtrlArranger.BottomOf(btnClear, 24);
102+
chkPermitAutoDetect.Top := TCtrlArranger.BottomOf(chkShowInMain, 8);
101103
end;
102104

103105
procedure TCompilersDlgCompilerFrame.btnBrowseClick(Sender: TObject);
@@ -164,12 +166,22 @@ procedure TCompilersDlgCompilerFrame.Initialise;
164166
begin
165167
edCompilerPath.Text := Compiler.GetExecFile;
166168
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;
167175
end;
168176

169177
procedure TCompilersDlgCompilerFrame.UpdateCompiler;
170178
begin
171179
Compiler.SetExecFile(GetCompilerPath);
172180
Compiler.SetDisplayable(chkShowInMain.Checked);
181+
if Supports(Compiler, ICompilerAutoDetect) then
182+
(Compiler as ICompilerAutoDetect).SetCanAutoInstall(
183+
chkPermitAutoDetect.Checked
184+
);
173185
end;
174186

175187
function TCompilersDlgCompilerFrame.ValidateFileName(const FileName: string;

0 commit comments

Comments
 (0)