Skip to content

Commit e073b9c

Browse files
committed
Fix welcome page redraw after compilers registered
Main form was not redrawing the welcome page to reflect the addition of compilers after user accepted new compilers automatically detected at startup. Changed UCompileMgr.TMainCompileMgr.CheckForNewCompilerInstalls to return True if user had permitted compilers to be registered. Main form's AfterShowForm event handler wa changed to refresh the display when the method returns True.
1 parent c29bd68 commit e073b9c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Src/FmMain.pas

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,8 @@ procedure TMainForm.AfterShowForm;
12191219
fMainDisplayMgr.Initialise(fWindowSettings.OverviewTab);
12201220
fMainDisplayMgr.ShowWelcomePage;
12211221
// check for registerable Delphi compiler installations
1222-
fCompileMgr.CheckForNewCompilerInstalls;
1222+
if fCompileMgr.CheckForNewCompilerInstalls then
1223+
fMainDisplayMgr.Refresh;
12231224
end;
12241225

12251226
function TMainForm.appEventsHelp(Command: Word; Data: Integer;

Src/UCompileMgr.pas

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,14 @@ TMainCompileMgr = class(TCompileMgr)
116116
/// <summary>Check for new compiler installations, get user permission to
117117
/// install any that are found and register any compilers that user
118118
/// selects.</summary>
119+
/// <returns>Boolean. True if any compilers were registered, False if not.
120+
/// </returns>
119121
/// <remarks>
120122
/// <para>Does nothing if compiler detection is disabled or if there are
121123
/// no installed but unregistered compilers.</para>
122124
/// <para>Should be called at program startup.</para>
123125
/// </remarks>
124-
procedure CheckForNewCompilerInstalls;
126+
function CheckForNewCompilerInstalls: Boolean;
125127
end;
126128

127129

@@ -264,7 +266,7 @@ function TMainCompileMgr.CanCompile(View: IView): Boolean;
264266
and SnippetView.Snippet.CanCompile;
265267
end;
266268

267-
procedure TMainCompileMgr.CheckForNewCompilerInstalls;
269+
function TMainCompileMgr.CheckForNewCompilerInstalls: Boolean;
268270
var
269271
CandidateCompilers: TCompilerList; // compilers available for registration
270272
SelectedCompilers: TCompilerList; // compilers chosen for registration
@@ -313,6 +315,7 @@ procedure TMainCompileMgr.CheckForNewCompilerInstalls;
313315
end;
314316

315317
begin
318+
Result := False;
316319
if not TCompilerSettings.PermitStartupDetection then
317320
Exit;
318321
SelectedCompilers := nil;
@@ -345,6 +348,7 @@ procedure TMainCompileMgr.CheckForNewCompilerInstalls;
345348
Persister.Save(Compilers);
346349
// tell user what got registered
347350
NotifyResults;
351+
Result := True;
348352
end
349353
else
350354
// User didn't select a file: tell them
@@ -381,4 +385,3 @@ function TMainCompileMgr.IsLastCompiledView(View: IView): Boolean;
381385
end;
382386

383387
end.
384-

0 commit comments

Comments
 (0)