diff --git a/src/ce_interfaces.pas b/src/ce_interfaces.pas index 5d1fddd8..4193aa0d 100644 --- a/src/ce_interfaces.pas +++ b/src/ce_interfaces.pas @@ -252,7 +252,16 @@ type /// describes the message kind, 'amkAuto' implies that an ICELogMessageObserver guess the kind. TCEAppMessageKind = (amkAuto, amkBub, amkInf, amkHint, amkWarn, amkErr); /// describes the message context. Used by a ICELogMessageObserver to filter the messages. - TCEAppMessageCtxt = (amcAll, amcEdit, amcProj, amcApp, amcMisc); + TCEAppMessageCtxt = ( + amcAll, // used as filter + amcEdit, // used as filter + amcProj, // used as filter + amcApp, // used as filter + amcMisc, // used as filter + amcAutoEdit, // same as amcEdit but the message data is set automatically from the widget side + amcAutoProj, // same as amcProj but the message data is set automatically from the widget side + amcAutoCompile // same as amcAutoEdit or amcAutoProj, according to what's being compiled. + ); (** * Single service provided by the messages widget. diff --git a/src/ce_messages.pas b/src/ce_messages.pas index 1efa0b2e..dd3c06ff 100644 --- a/src/ce_messages.pas +++ b/src/ce_messages.pas @@ -83,6 +83,7 @@ type fEditorMessagePos: TCEEditorMessagePos; fDemanglerAvailable: boolean; fMsgColors: array[TCEAppMessageKind] of TColor; + fProjCompile: boolean; fActAutoSel: TAction; fActClearAll: TAction; fActClearCurCat: TAction; @@ -674,10 +675,12 @@ end; procedure TCEMessagesWidget.projCompiling(aProject: ICECommonProject); begin + fProjCompile := true; end; procedure TCEMessagesWidget.projCompiled(aProject: ICECommonProject; success: boolean); begin + fProjCompile := false; end; {$ENDREGION} @@ -761,6 +764,23 @@ begin msg := aValue; if aKind = amkAuto then aKind := guessMessageKind(msg); + if aCtxt = amcAutoCompile then + begin + case fProjCompile of + false: aCtxt := amcAutoEdit; + true: aCtxt := amcAutoProj; + end; + end; + if aCtxt = amcAutoEdit then + begin + aData := fDoc; + aCtxt := amcEdit; + end + else if aCtxt = amcAutoProj then + begin + aData := fProj; + aCtxt := amcProj; + end; dt := new(PMessageData); dt^.data := aData; dt^.ctxt := aCtxt;