From 229162c20371ed17c9405f04b40d12939cde54a2 Mon Sep 17 00:00:00 2001 From: Juha Date: Mon, 22 Nov 2021 12:24:59 +0200 Subject: [PATCH] ProjectGroups: Call ActiveChanged() when compiling all. Updates an indicator in the GUI. Issue #32475. --- components/projectgroups/projectgroup.pp | 19 ++++++++++++------- .../projectgroups/projectgroupeditor.pas | 6 ++++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/components/projectgroups/projectgroup.pp b/components/projectgroups/projectgroup.pp index 20873742bc..7150a6b003 100644 --- a/components/projectgroups/projectgroup.pp +++ b/components/projectgroups/projectgroup.pp @@ -1211,13 +1211,13 @@ end; procedure TIDEProjectGroup.ActiveTargetChanged(T: TPGCompileTarget); var Root: TIDEProjectGroup; -begin - if T.Active then begin - FActiveTarget:=T; - end else begin +begin // T=Nil means the compilation ended and the GUI should be restored. + if Assigned(T) then + if T.Active then + FActiveTarget:=T + else if FActiveTarget=T then FActiveTarget:=nil; - end; Root:=TIDEProjectGroup(GetRootGroup); if Assigned(Root.OnTargetActiveChanged) then Root.OnTargetActiveChanged(Self,T); @@ -2002,14 +2002,18 @@ begin taSettings: ; taCompile, taCompileClean: - begin + try for i:=0 to ProjectGroup.TargetCount-1 do begin aTarget:=TIDECompileTarget(ProjectGroup.Targets[i]); - if AAction in aTarget.AllowedActions then + if AAction in aTarget.AllowedActions then begin + ActiveChanged(aTarget); if aTarget.PerformAction(AAction)<>arOk then exit; + end; end; Result:=arOk; + finally + ActiveChanged(Nil); end; taCompileFromHere: begin @@ -2017,6 +2021,7 @@ begin exit; Result:=arOK; aTarget:=TIDECompileTarget(GetNext(true)); + ActiveChanged(aTarget); if aTarget=nil then exit; Result:=aTarget.PerformAction(taCompileFromHere); end; diff --git a/components/projectgroups/projectgroupeditor.pas b/components/projectgroups/projectgroupeditor.pas index a200c91987..2da35b78d4 100644 --- a/components/projectgroups/projectgroupeditor.pas +++ b/components/projectgroups/projectgroupeditor.pas @@ -888,8 +888,10 @@ begin NewActiveTVNode.StateIndex:=NSIActive; FActiveTarget:=Target; end; - //N:=DisplayFileName(Target); - //SBPG.Panels[piActiveTarget].Text:=Format(lisActiveTarget,[N]); + if Assigned(Target) then + SBPG.Panels[piActiveTarget].Text:=Format(lisActiveTarget,[DisplayFileName(Target)]) + else + TVPGSelectionChanged(Nil); // Restore the original status text. end; procedure TProjectGroupEditorForm.OnTargetExchanged(Sender: TObject; Target1,