From 3a765e3b1229e261edee9fe0a54ca9ccff020c2d Mon Sep 17 00:00:00 2001 From: Uwe Risse Date: Tue, 11 Jan 2022 14:35:15 +0100 Subject: [PATCH] Add optional highlighting of messages with 73 or RR73 --- Configuration.cpp | 7 +++++++ Configuration.hpp | 1 + Configuration.ui | 45 ++++++++++++++++++++++++----------------- widgets/displaytext.cpp | 5 +++-- 4 files changed, 37 insertions(+), 21 deletions(-) diff --git a/Configuration.cpp b/Configuration.cpp index f5bb816e3..661a42d6e 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -593,6 +593,7 @@ private: bool highlight_by_mode_; bool highlight_only_fields_; bool include_WAE_entities_; + bool highlight_73_; int LotW_days_since_upload_; TransceiverFactory::ParameterPack rig_params_; @@ -791,6 +792,7 @@ DecodeHighlightingModel const& Configuration::decode_highlighting () const {retu bool Configuration::highlight_by_mode () const {return m_->highlight_by_mode_;} bool Configuration::highlight_only_fields () const {return m_->highlight_only_fields_;} bool Configuration::include_WAE_entities () const {return m_->include_WAE_entities_;} +bool Configuration::highlight_73 () const {return m_->highlight_73_;} bool Configuration::highlight_DXcall () const {return m_->highlight_DXcall_;} bool Configuration::clear_DXcall () const {return m_->clear_DXcall_;} bool Configuration::highlight_DXgrid () const {return m_->highlight_DXgrid_;} @@ -1016,6 +1018,7 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network , highlight_by_mode_ {false} , highlight_only_fields_ {false} , include_WAE_entities_ {false} + , highlight_73_ {false} , LotW_days_since_upload_ {0} , last_port_type_ {TransceiverFactory::Capabilities::none} , rig_is_dummy_ {false} @@ -1429,6 +1432,7 @@ void Configuration::impl::initialize_models () ui_->highlight_by_mode_check_box->setChecked (highlight_by_mode_); ui_->only_fields_check_box->setChecked (highlight_only_fields_); ui_->include_WAE_check_box->setChecked (include_WAE_entities_); + ui_->highlight_73_check_box->setChecked (highlight_73_); ui_->LotW_days_since_upload_spin_box->setValue (LotW_days_since_upload_); ui_->cbHighlightDXcall->setChecked(highlight_DXcall_); ui_->cbClearDXcall->setChecked(clear_DXcall_); @@ -1528,6 +1532,7 @@ void Configuration::impl::read_settings () highlight_by_mode_ = settings_->value("HighlightByMode", false).toBool (); highlight_only_fields_ = settings_->value("OnlyFieldsSought", false).toBool (); include_WAE_entities_ = settings_->value("IncludeWAEEntities", false).toBool (); + highlight_73_ = settings_->value("Highlight73", false).toBool (); LotW_days_since_upload_ = settings_->value ("LotWDaysSinceLastUpload", 365).toInt (); lotw_users_.set_age_constraint (LotW_days_since_upload_); @@ -1666,6 +1671,7 @@ void Configuration::impl::write_settings () settings_->setValue ("HighlightByMode", highlight_by_mode_); settings_->setValue ("OnlyFieldsSought", highlight_only_fields_); settings_->setValue ("IncludeWAEEntities", include_WAE_entities_); + settings_->setValue ("Highlight73", highlight_73_); settings_->setValue ("LotWDaysSinceLastUpload", LotW_days_since_upload_); settings_->setValue ("toRTTY", log_as_RTTY_); settings_->setValue ("dBtoComments", report_in_comments_); @@ -2207,6 +2213,7 @@ void Configuration::impl::accept () highlight_by_mode_ = ui_->highlight_by_mode_check_box->isChecked (); highlight_only_fields_ = ui_->only_fields_check_box->isChecked (); include_WAE_entities_ = ui_->include_WAE_check_box->isChecked (); + highlight_73_ = ui_->highlight_73_check_box->isChecked (); LotW_days_since_upload_ = ui_->LotW_days_since_upload_spin_box->value (); lotw_users_.set_age_constraint (LotW_days_since_upload_); diff --git a/Configuration.hpp b/Configuration.hpp index cb45858a3..c4cf068ec 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -181,6 +181,7 @@ public: bool highlight_by_mode () const; bool highlight_only_fields () const; bool include_WAE_entities () const; + bool highlight_73 () const; void setSpecial_Hound(); void setSpecial_Fox(); void setSpecial_None(); diff --git a/Configuration.ui b/Configuration.ui index e08657002..c64160476 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -7,7 +7,7 @@ 0 0 554 - 560 + 599 @@ -17,7 +17,7 @@ - 0 + 6 @@ -2330,6 +2330,23 @@ Right click for insert and delete options. + + + + Include extra WAE entities + + + + + + + Check to for grid highlighting to only apply to unworked grid fields + + + Only grid Fields sought + + + @@ -2377,20 +2394,10 @@ Right click for insert and delete options. - - + + - Include extra WAE entities - - - - - - - Check to for grid highlighting to only apply to unworked grid fields - - - Only grid Fields sought + Highlight also messages with 73 or RR73 @@ -3262,12 +3269,12 @@ Right click for insert and delete options. - - + + + + - - diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index d784ead1b..d588573a9 100644 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -404,6 +404,7 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con 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 ")) @@ -446,14 +447,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