From 4320ce238aae1fe87fc9f379cdd816e9317885fa Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 30 Sep 2024 22:36:11 +0200 Subject: New upstream version 2.7.0~rc7+repack --- widgets/displaytext.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'widgets/displaytext.cpp') diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index b3575102..f8d89d2a 100755 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -539,7 +539,7 @@ void DisplayText::displayTransmittedText(QString text, QString modeTx, qint32 tx int i1=t.indexOf("<"); int i2=t.indexOf(">"); QString foxcall=t.mid(i1+1,i2-i1-1); - t2=t.left(i0) + " " + foxcall; + t2=t.left(i0).replace(" RR73", " " + foxcall + " RR73"); QString t3=t.left(24) + t.mid(i0+2,-1).remove("<").remove(">"); insertText (t2, bg, fg); insertText (t3, bg, fg); @@ -560,6 +560,22 @@ void DisplayText::displayHoundToBeCalled(QString t, bool bAtTop, QColor bg, QCol insertText(t, bg, fg, "", "", bAtTop ? QTextCursor::Start : QTextCursor::End); } +void DisplayText::setHighlightedHoundText(QString t) { + QColor bg=QColor{255,255,255}; + QColor fg=QColor{0,0,0}; + highlight_types types{Highlight::Call}; + set_colours(m_config, &bg, &fg, types); + // t is multiple lines of text, each line is a hound calling + // iterate through each line and highlight the callsign + auto lines = t.split(QChar('\n'), SkipEmptyParts); + clear(); + foreach (auto line, lines) + { + auto fields = line.split(QChar(' '), SkipEmptyParts); + insertText(line, bg, fg, fields.first(), QString{}); + } +} + namespace { void update_selection (QTextCursor& cursor, QColor const& bg, QColor const& fg) @@ -619,6 +635,11 @@ void DisplayText::highlight_callsign (QString const& callsign, QColor const& bg, { return; } + if (callsign == "CLEARALL!") // programmatic means of clearing all highlighting + { + highlighted_calls_.clear(); + return; + } auto regexp = callsign; // allow for hashed callsigns and escape any regexp metacharacters QRegularExpression target {QString {"