mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-06 11:55:15 -04:00
Correct highlighting of messages with myCall and 73
This commit is contained in:
parent
5c1b7a8d8f
commit
5c09e55351
@ -414,19 +414,6 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (bCQonly) return;
|
if (bCQonly) return;
|
||||||
if (myCall.size ())
|
|
||||||
{
|
|
||||||
QString regexp {"[ <]" + myCall + "[ >]"};
|
|
||||||
if (Radio::is_compound_callsign (myCall))
|
|
||||||
{
|
|
||||||
regexp = "(?:" + regexp + "|[ <]" + Radio::base_callsign (myCall) + "[ >])";
|
|
||||||
}
|
|
||||||
if ((decodedText.clean_string () + " ").contains (QRegularExpression {regexp}))
|
|
||||||
{
|
|
||||||
highlight_types types {Highlight::MyCall};
|
|
||||||
set_colours (m_config, &bg, &fg, types);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
auto message = decodedText.string();
|
auto message = decodedText.string();
|
||||||
QString dxCall;
|
QString dxCall;
|
||||||
@ -473,6 +460,20 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
|
|||||||
message = leftJustifyAppendage (message, extra);
|
message = leftJustifyAppendage (message, extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (myCall.size ())
|
||||||
|
{
|
||||||
|
QString regexp {"[ <]" + myCall + "[ >]"};
|
||||||
|
if (Radio::is_compound_callsign (myCall))
|
||||||
|
{
|
||||||
|
regexp = "(?:" + regexp + "|[ <]" + Radio::base_callsign (myCall) + "[ >])";
|
||||||
|
}
|
||||||
|
if ((decodedText.clean_string () + " ").contains (QRegularExpression {regexp}))
|
||||||
|
{
|
||||||
|
highlight_types types {Highlight::MyCall};
|
||||||
|
set_colours (m_config, &bg, &fg, types);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
appendText (message.trimmed (), bg, fg, decodedText.call (), dxCall);
|
appendText (message.trimmed (), bg, fg, decodedText.call (), dxCall);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user