diff options
| author | Christoph Berg <myon@debian.org> | 2022-08-08 23:08:17 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2022-08-08 23:08:17 +0200 |
| commit | 43bebfbad6e7ba026bd3d55720c7d9e12a7ef8ef (patch) | |
| tree | fac973fdc7378510849f4d749cd311176c023ebb /widgets/displaytext.cpp | |
| parent | d47341d71ff3df889c1180eb7bfb4fc0272eb26b (diff) | |
New upstream version 2.6.0~rc2+repackupstream/2.6.0_rc2+repack
Diffstat (limited to 'widgets/displaytext.cpp')
| -rwxr-xr-x | widgets/displaytext.cpp | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index d784ead1..65fc1d40 100755 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -277,6 +277,8 @@ QString DisplayText::appendWorkedB4 (QString message, QString call, QString cons gridB4onBand=true; } + if(callB4onBand) m_points=0; + message = message.trimmed (); highlight_types types; @@ -372,11 +374,17 @@ QString DisplayText::appendWorkedB4 (QString message, QString call, QString cons } m_CQPriority=DecodeHighlightingModel::highlight_name(top_highlight); + if(((m_points == 00) or (m_points == -1)) and m_bDisplayPoints) return message; return leftJustifyAppendage (message, extra); } -QString DisplayText::leftJustifyAppendage (QString message, QString const& appendage) const +QString DisplayText::leftJustifyAppendage (QString message, QString const& appendage0) const { + QString appendage=appendage0; + if(m_bDisplayPoints and (m_points>0)) { + appendage=" " + QString::number(m_points); + if(m_points<10) appendage=" " + appendage; + } if (appendage.size ()) { // allow for seconds @@ -398,12 +406,15 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con QString const& mode, bool displayDXCCEntity, LogBook const& logBook, QString const& currentBand, bool ppfx, bool bCQonly, - bool haveFSpread, float fSpread) + bool haveFSpread, float fSpread, bool bDisplayPoints, int points) { + m_points=points; + m_bDisplayPoints=bDisplayPoints; m_bPrincipalPrefix=ppfx; QColor bg; QColor fg; bool CQcall = false; + auto is_73 = decodedText.messageWords().filter (QRegularExpression {"^(73|RR73)$"}).size(); if (decodedText.string ().contains (" CQ ") || decodedText.string ().contains (" CQDX ") || decodedText.string ().contains (" QRZ ")) @@ -413,19 +424,6 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con else { 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(); QString dxCall; @@ -446,14 +444,14 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con message = message.left (ap_pos).trimmed (); } m_CQPriority=""; - if (CQcall) + if (CQcall || (is_73 && (m_config->highlight_73 ()))) { if (displayDXCCEntity) { // if enabled add the DXCC entity and B4 status to the end of the // preformated text line t1 auto currentMode = mode; - message = appendWorkedB4 (message, decodedText.CQersCall(), dxGrid, &bg, &fg + message = appendWorkedB4 (message, dxCall, dxGrid, &bg, &fg , logBook, currentBand, currentMode, extra); } else @@ -472,6 +470,20 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con 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); } |
