Merge branch 'hotfix-2.0.0-rc6' of bitbucket.org:k1jt/wsjtx into hotfix-2.0.0-rc6

This commit is contained in:
Steve Franke 2018-11-29 10:34:33 -06:00
commit 9c8fc17ecc
10 changed files with 107 additions and 110 deletions

View File

@ -2197,7 +2197,7 @@ Right click for insert and delete options.</string>
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable or disable using the check boxes and right-click an item to change the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.&lt;/p&gt;&lt;p&gt;Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="sizeAdjustPolicy"> <property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum> <enum>QAbstractScrollArea::AdjustToContents</enum>
@ -3013,12 +3013,12 @@ Right click for insert and delete options.</string>
</connections> </connections>
<buttongroups> <buttongroups>
<buttongroup name="CAT_stop_bits_button_group"/> <buttongroup name="CAT_stop_bits_button_group"/>
<buttongroup name="TX_audio_source_button_group"/>
<buttongroup name="TX_mode_button_group"/>
<buttongroup name="split_mode_button_group"/>
<buttongroup name="CAT_handshake_button_group"/>
<buttongroup name="special_op_activity_button_group"/> <buttongroup name="special_op_activity_button_group"/>
<buttongroup name="PTT_method_button_group"/> <buttongroup name="TX_audio_source_button_group"/>
<buttongroup name="split_mode_button_group"/>
<buttongroup name="CAT_data_bits_button_group"/> <buttongroup name="CAT_data_bits_button_group"/>
<buttongroup name="PTT_method_button_group"/>
<buttongroup name="CAT_handshake_button_group"/>
<buttongroup name="TX_mode_button_group"/>
</buttongroups> </buttongroups>
</ui> </ui>

View File

@ -136,12 +136,12 @@ namespace Radio
// the full call if no valid prefix (or prefix as a suffix) is specified // the full call if no valid prefix (or prefix as a suffix) is specified
QString effective_prefix (QString callsign) QString effective_prefix (QString callsign)
{ {
auto prefix = callsign.toUpper (); auto prefix = callsign;
auto slash_pos = callsign.indexOf ('/'); auto slash_pos = callsign.indexOf ('/');
if (slash_pos >= 0) if (slash_pos >= 0)
{ {
auto right_size = callsign.size () - slash_pos - 1; auto right_size = callsign.size () - slash_pos - 1;
if (right_size >= slash_pos) // naive call is longer than if (right_size >= slash_pos) // native call is longer than
// prefix/suffix algorithm // prefix/suffix algorithm
{ {
prefix = callsign.left (slash_pos); prefix = callsign.left (slash_pos);
@ -157,6 +157,6 @@ namespace Radio
} }
} }
} }
return prefix; return prefix.toUpper ();
} }
} }

View File

@ -159,8 +159,9 @@ public:
{ {
} }
Record fixup (QString const& call, prefix const& p) const Record fixup (QString call, prefix const& p) const
{ {
call = call.toUpper ();
using entity_by_id = entities_type::index<id>::type; using entity_by_id = entities_type::index<id>::type;
entity_by_id::iterator e; // iterator into entity set entity_by_id::iterator e; // iterator into entity set

View File

@ -307,10 +307,10 @@ WorkedBefore::WorkedBefore ()
if (call.size ()) if (call.size ())
{ {
auto const& entity = m_->prefixes_.lookup (call); auto const& entity = m_->prefixes_.lookup (call);
m_->worked_.emplace (call m_->worked_.emplace (call.toUpper ()
, extractField (record, "GRIDSQUARE").left (4) // not interested in 6-digit grids , extractField (record, "GRIDSQUARE").left (4).toUpper () // not interested in 6-digit grids
, extractField (record, "BAND") , extractField (record, "BAND").toUpper ()
, extractField (record, "MODE") , extractField (record, "MODE").toUpper ()
, entity.entity_name , entity.entity_name
, entity.continent , entity.continent
, entity.CQ_zone , entity.CQ_zone
@ -357,8 +357,8 @@ bool WorkedBefore::add (QString const& call
} }
out << ADIF_record << " <eor>" << endl; out << ADIF_record << " <eor>" << endl;
} }
m_->worked_.emplace (call, grid, band, mode, entity.entity_name m_->worked_.emplace (call.toUpper (), grid.left (4).toUpper (), band.toUpper (), mode.toUpper ()
, entity.continent, entity.CQ_zone, entity.ITU_zone); , entity.entity_name, entity.continent, entity.CQ_zone, entity.ITU_zone);
} }
return true; return true;
} }
@ -372,7 +372,7 @@ bool WorkedBefore::country_worked (QString const& country, QString const& mode,
return return
country.size () country.size ()
&& m_->worked_.get<entity_mode_band> ().end () && m_->worked_.get<entity_mode_band> ().end ()
!= m_->worked_.get<entity_mode_band> ().find (std::make_tuple (country, mode, band)); != m_->worked_.get<entity_mode_band> ().find (std::make_tuple (country, mode.toUpper (), band.toUpper ()));
} }
else else
{ {
@ -380,7 +380,7 @@ bool WorkedBefore::country_worked (QString const& country, QString const& mode,
return return
country.size () country.size ()
&& m_->worked_.get<entity_mode_band> ().end () && m_->worked_.get<entity_mode_band> ().end ()
!= m_->worked_.get<entity_mode_band> ().find (std::make_tuple (country, mode)); != m_->worked_.get<entity_mode_band> ().find (std::make_tuple (country, mode.toUpper ()));
} }
} }
else else
@ -390,7 +390,7 @@ bool WorkedBefore::country_worked (QString const& country, QString const& mode,
return return
country.size () country.size ()
&& m_->worked_.get<entity_band> ().end () && m_->worked_.get<entity_band> ().end ()
!= m_->worked_.get<entity_band> ().find (std::make_tuple (country, band)); != m_->worked_.get<entity_band> ().find (std::make_tuple (country, band.toUpper ()));
} }
else else
{ {
@ -410,13 +410,13 @@ bool WorkedBefore::grid_worked (QString const& grid, QString const& mode, QStrin
if (band.size ()) if (band.size ())
{ {
return m_->worked_.get<grid_mode_band> ().end () return m_->worked_.get<grid_mode_band> ().end ()
!= m_->worked_.get<grid_mode_band> ().find (std::make_tuple (grid, mode, band)); != m_->worked_.get<grid_mode_band> ().find (std::make_tuple (grid.left (4).toUpper (), mode.toUpper (), band.toUpper ()));
} }
else else
{ {
// partial key lookup // partial key lookup
return m_->worked_.get<grid_mode_band> ().end () return m_->worked_.get<grid_mode_band> ().end ()
!= m_->worked_.get<grid_mode_band> ().find (std::make_tuple (grid, mode)); != m_->worked_.get<grid_mode_band> ().find (std::make_tuple (grid.left (4).toUpper (), mode.toUpper ()));
} }
} }
else else
@ -424,13 +424,13 @@ bool WorkedBefore::grid_worked (QString const& grid, QString const& mode, QStrin
if (band.size ()) if (band.size ())
{ {
return m_->worked_.get<grid_band> ().end () return m_->worked_.get<grid_band> ().end ()
!= m_->worked_.get<grid_band> ().find (std::make_tuple (grid, band)); != m_->worked_.get<grid_band> ().find (std::make_tuple (grid.left (4).toUpper (), band.toUpper ()));
} }
else else
{ {
// partial key lookup // partial key lookup
return m_->worked_.get<grid_band> ().end () return m_->worked_.get<grid_band> ().end ()
!= m_->worked_.get<grid_band> ().find (grid); != m_->worked_.get<grid_band> ().find (grid.left (4).toUpper ());
} }
} }
} }
@ -442,13 +442,13 @@ bool WorkedBefore::call_worked (QString const& call, QString const& mode, QStrin
if (band.size ()) if (band.size ())
{ {
return m_->worked_.get<call_mode_band> ().end () return m_->worked_.get<call_mode_band> ().end ()
!= m_->worked_.get<call_mode_band> ().find (std::make_tuple (call, mode, band)); != m_->worked_.get<call_mode_band> ().find (std::make_tuple (call.toUpper (), mode.toUpper (), band.toUpper ()));
} }
else else
{ {
// partial key lookup // partial key lookup
return m_->worked_.get<call_mode_band> ().end () return m_->worked_.get<call_mode_band> ().end ()
!= m_->worked_.get<call_mode_band> ().find (std::make_tuple (call, mode)); != m_->worked_.get<call_mode_band> ().find (std::make_tuple (call.toUpper (), mode.toUpper ()));
} }
} }
else else
@ -456,13 +456,13 @@ bool WorkedBefore::call_worked (QString const& call, QString const& mode, QStrin
if (band.size ()) if (band.size ())
{ {
return m_->worked_.get<call_band> ().end () return m_->worked_.get<call_band> ().end ()
!= m_->worked_.get<call_band> ().find (std::make_tuple (call, band)); != m_->worked_.get<call_band> ().find (std::make_tuple (call.toUpper (), band.toUpper ()));
} }
else else
{ {
// partial key lookup // partial key lookup
return m_->worked_.get<call_band> ().end () return m_->worked_.get<call_band> ().end ()
!= m_->worked_.get<call_band> ().find (std::make_tuple (call)); != m_->worked_.get<call_band> ().find (std::make_tuple (call.toUpper ()));
} }
} }
} }
@ -474,13 +474,13 @@ bool WorkedBefore::continent_worked (Continent continent, QString const& mode, Q
if (band.size ()) if (band.size ())
{ {
return m_->worked_.get<continent_mode_band> ().end () return m_->worked_.get<continent_mode_band> ().end ()
!= m_->worked_.get<continent_mode_band> ().find (std::make_tuple (continent, mode, band)); != m_->worked_.get<continent_mode_band> ().find (std::make_tuple (continent, mode.toUpper (), band.toUpper ()));
} }
else else
{ {
// partial key lookup // partial key lookup
return m_->worked_.get<continent_mode_band> ().end () return m_->worked_.get<continent_mode_band> ().end ()
!= m_->worked_.get<continent_mode_band> ().find (std::make_tuple (continent, mode)); != m_->worked_.get<continent_mode_band> ().find (std::make_tuple (continent, mode.toUpper ()));
} }
} }
else else
@ -488,7 +488,7 @@ bool WorkedBefore::continent_worked (Continent continent, QString const& mode, Q
if (band.size ()) if (band.size ())
{ {
return m_->worked_.get<continent_band> ().end () return m_->worked_.get<continent_band> ().end ()
!= m_->worked_.get<continent_band> ().find (std::make_tuple (continent, band)); != m_->worked_.get<continent_band> ().find (std::make_tuple (continent, band.toUpper ()));
} }
else else
{ {
@ -506,13 +506,13 @@ bool WorkedBefore::CQ_zone_worked (int CQ_zone, QString const& mode, QString con
if (band.size ()) if (band.size ())
{ {
return m_->worked_.get<CQ_zone_mode_band> ().end () return m_->worked_.get<CQ_zone_mode_band> ().end ()
!= m_->worked_.get<CQ_zone_mode_band> ().find (std::make_tuple (CQ_zone, mode, band)); != m_->worked_.get<CQ_zone_mode_band> ().find (std::make_tuple (CQ_zone, mode.toUpper (), band.toUpper ()));
} }
else else
{ {
// partial key lookup // partial key lookup
return m_->worked_.get<CQ_zone_mode_band> ().end () return m_->worked_.get<CQ_zone_mode_band> ().end ()
!= m_->worked_.get<CQ_zone_mode_band> ().find (std::make_tuple (CQ_zone, mode)); != m_->worked_.get<CQ_zone_mode_band> ().find (std::make_tuple (CQ_zone, mode.toUpper ()));
} }
} }
else else
@ -520,7 +520,7 @@ bool WorkedBefore::CQ_zone_worked (int CQ_zone, QString const& mode, QString con
if (band.size ()) if (band.size ())
{ {
return m_->worked_.get<CQ_zone_band> ().end () return m_->worked_.get<CQ_zone_band> ().end ()
!= m_->worked_.get<CQ_zone_band> ().find (std::make_tuple (CQ_zone, band)); != m_->worked_.get<CQ_zone_band> ().find (std::make_tuple (CQ_zone, band.toUpper ()));
} }
else else
{ {
@ -538,13 +538,13 @@ bool WorkedBefore::ITU_zone_worked (int ITU_zone, QString const& mode, QString c
if (band.size ()) if (band.size ())
{ {
return m_->worked_.get<ITU_zone_mode_band> ().end () return m_->worked_.get<ITU_zone_mode_band> ().end ()
!= m_->worked_.get<ITU_zone_mode_band> ().find (std::make_tuple (ITU_zone, mode, band)); != m_->worked_.get<ITU_zone_mode_band> ().find (std::make_tuple (ITU_zone, mode.toUpper (), band.toUpper ()));
} }
else else
{ {
// partial key lookup // partial key lookup
return m_->worked_.get<ITU_zone_mode_band> ().end () return m_->worked_.get<ITU_zone_mode_band> ().end ()
!= m_->worked_.get<ITU_zone_mode_band> ().find (std::make_tuple (ITU_zone, mode)); != m_->worked_.get<ITU_zone_mode_band> ().find (std::make_tuple (ITU_zone, mode.toUpper ()));
} }
} }
else else
@ -552,7 +552,7 @@ bool WorkedBefore::ITU_zone_worked (int ITU_zone, QString const& mode, QString c
if (band.size ()) if (band.size ())
{ {
return m_->worked_.get<ITU_zone_band> ().end () return m_->worked_.get<ITU_zone_band> ().end ()
!= m_->worked_.get<ITU_zone_band> ().find (std::make_tuple (ITU_zone, band)); != m_->worked_.get<ITU_zone_band> ().find (std::make_tuple (ITU_zone, band.toUpper ()));
} }
else else
{ {

View File

@ -4,7 +4,8 @@
#include <QVariant> #include <QVariant>
#include <QList> #include <QList>
#include <QBrush> #include <QBrush>
#include <QFont> #include <QColor>
#include <QFont>
#include <QMap> #include <QMap>
#include <QVector> #include <QVector>
#include <QDataStream> #include <QDataStream>
@ -160,7 +161,10 @@ QVariant DecodeHighlightingModel::data (const QModelIndex& index, int role) cons
result = item.enabled_ ? Qt::Checked : Qt::Unchecked; result = item.enabled_ ? Qt::Checked : Qt::Unchecked;
break; break;
case Qt::DisplayRole: case Qt::DisplayRole:
result = highlight_name (item.type_); return QString {"%1 [f/g:%2, b/g:%3]"}
.arg (highlight_name (item.type_))
.arg (item.foreground_.style () != Qt::NoBrush ? QString {"#%1"}.arg (item.foreground_.color ().rgb () & 0xffffff, 6, 16, QChar {'0'}) : QString {"unset"})
.arg (item.background_.style () != Qt::NoBrush ? QString {"#%1"}.arg (item.background_.color ().rgb () & 0xffffff, 6, 16, QChar {'0'}) : QString {"unset"});
break; break;
case Qt::ForegroundRole: case Qt::ForegroundRole:
if (Qt::NoBrush != item.foreground_.style ()) if (Qt::NoBrush != item.foreground_.style ())

View File

@ -6,31 +6,12 @@
#include "models/DecodeHighlightingModel.hpp" #include "models/DecodeHighlightingModel.hpp"
#include "MessageBox.hpp" #include "MessageBox.hpp"
#include "pimpl_impl.hpp"
class DecodeHighlightingListView::impl final
{
public:
impl ()
: fg_colour_action_ {tr ("&Foreground color ..."), nullptr}
, bg_colour_action_ {tr ("&Background color ..."), nullptr}
, defaults_action_ {tr ("&Reset this item to defaults"), nullptr}
{
}
DecodeHighlightingListView * self_;
QAction fg_colour_action_;
QAction bg_colour_action_;
QAction defaults_action_;
};
DecodeHighlightingListView::DecodeHighlightingListView (QWidget * parent) DecodeHighlightingListView::DecodeHighlightingListView (QWidget * parent)
: QListView {parent} : QListView {parent}
{ {
addAction (&m_->fg_colour_action_); auto * fg_colour_action = new QAction {tr ("&Foreground color ..."), this};
addAction (&m_->bg_colour_action_); addAction (fg_colour_action);
addAction (&m_->defaults_action_); connect (fg_colour_action, &QAction::triggered, [this] (bool /*checked*/) {
connect (&m_->fg_colour_action_, &QAction::triggered, [this] (bool /*checked*/) {
auto const& index = currentIndex (); auto const& index = currentIndex ();
auto colour = QColorDialog::getColor (model ()->data (index, Qt::ForegroundRole).value<QBrush> ().color () auto colour = QColorDialog::getColor (model ()->data (index, Qt::ForegroundRole).value<QBrush> ().color ()
, this , this
@ -38,10 +19,19 @@ DecodeHighlightingListView::DecodeHighlightingListView (QWidget * parent)
.arg (model ()->data (index).toString ())); .arg (model ()->data (index).toString ()));
if (colour.isValid ()) if (colour.isValid ())
{ {
model ()->setData (index, colour, Qt::ForegroundRole); model ()->setData (index, QBrush {colour}, Qt::ForegroundRole);
} }
}); });
connect (&m_->bg_colour_action_, &QAction::triggered, [this] (bool /*checked*/) {
auto * unset_fg_colour_action = new QAction {tr ("&Unset foreground color"), this};
addAction (unset_fg_colour_action);
connect (unset_fg_colour_action, &QAction::triggered, [this] (bool /*checked*/) {
model ()->setData (currentIndex (), QBrush {}, Qt::ForegroundRole);
});
auto * bg_colour_action = new QAction {tr ("&Background color ..."), this};
addAction (bg_colour_action);
connect (bg_colour_action, &QAction::triggered, [this] (bool /*checked*/) {
auto const& index = currentIndex (); auto const& index = currentIndex ();
auto colour = QColorDialog::getColor (model ()->data (index, Qt::BackgroundRole).value<QBrush> ().color () auto colour = QColorDialog::getColor (model ()->data (index, Qt::BackgroundRole).value<QBrush> ().color ()
, this , this
@ -49,10 +39,19 @@ DecodeHighlightingListView::DecodeHighlightingListView (QWidget * parent)
.arg (model ()->data (index).toString ())); .arg (model ()->data (index).toString ()));
if (colour.isValid ()) if (colour.isValid ())
{ {
model ()->setData (index, colour, Qt::BackgroundRole); model ()->setData (index, QBrush {colour}, Qt::BackgroundRole);
} }
}); });
connect (&m_->defaults_action_, &QAction::triggered, [this] (bool /*checked*/) {
auto * unset_bg_colour_action = new QAction {tr ("U&nset background color"), this};
addAction (unset_bg_colour_action);
connect (unset_bg_colour_action, &QAction::triggered, [this] (bool /*checked*/) {
model ()->setData (currentIndex (), QBrush {}, Qt::BackgroundRole);
});
auto * defaults_action = new QAction {tr ("&Reset this item to defaults"), this};
addAction (defaults_action);
connect (defaults_action, &QAction::triggered, [this] (bool /*checked*/) {
auto const& index = currentIndex (); auto const& index = currentIndex ();
model ()->setData (index, model ()->data (index, DecodeHighlightingModel::EnabledDefaultRole).toBool () ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole); model ()->setData (index, model ()->data (index, DecodeHighlightingModel::EnabledDefaultRole).toBool () ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole);
model ()->setData (index, model ()->data (index, DecodeHighlightingModel::ForegroundDefaultRole), Qt::ForegroundRole); model ()->setData (index, model ()->data (index, DecodeHighlightingModel::ForegroundDefaultRole), Qt::ForegroundRole);
@ -60,10 +59,6 @@ DecodeHighlightingListView::DecodeHighlightingListView (QWidget * parent)
}); });
} }
DecodeHighlightingListView::~DecodeHighlightingListView ()
{
}
QSize DecodeHighlightingListView::sizeHint () const QSize DecodeHighlightingListView::sizeHint () const
{ {
auto item_height = sizeHintForRow (0); auto item_height = sizeHintForRow (0);

View File

@ -3,8 +3,6 @@
#include <QListView> #include <QListView>
#include "pimpl_h.hpp"
class QWidget; class QWidget;
// Class Decode Highlighting List View // Class Decode Highlighting List View
@ -20,13 +18,9 @@ class DecodeHighlightingListView final
{ {
public: public:
explicit DecodeHighlightingListView (QWidget * parent = nullptr); explicit DecodeHighlightingListView (QWidget * parent = nullptr);
~DecodeHighlightingListView ();
private: private:
QSize sizeHint () const override; QSize sizeHint () const override;
class impl;
pimpl<impl> m_;
}; };
#endif #endif

View File

@ -121,6 +121,7 @@ void DisplayText::appendText(QString const& text, QColor bg, QColor fg
, QString const& call1, QString const& call2) , QString const& call1, QString const& call2)
{ {
// qDebug () << "DisplayText::appendText: text:" << text << "Nbsp pos:" << text.indexOf (QChar::Nbsp); // qDebug () << "DisplayText::appendText: text:" << text << "Nbsp pos:" << text.indexOf (QChar::Nbsp);
auto cursor = textCursor (); auto cursor = textCursor ();
cursor.movePosition (QTextCursor::End); cursor.movePosition (QTextCursor::End);
auto block_format = cursor.blockFormat (); auto block_format = cursor.blockFormat ();
@ -136,16 +137,6 @@ void DisplayText::appendText(QString const& text, QColor bg, QColor fg
{ {
format.setForeground (fg); format.setForeground (fg);
} }
if (call2.size () && m_config && m_config->lotw_users ().user (call2))
{
QColor bg;
QColor fg;
highlight_types types {Highlight::LotW};
set_colours (m_config, &bg, &fg, types);
if (bg.isValid ()) block_format.setBackground (bg);
if (fg.isValid ()) format.setForeground (fg);
}
if (cursor.position ()) if (cursor.position ())
{ {
cursor.insertBlock (block_format, format); cursor.insertBlock (block_format, format);
@ -212,13 +203,12 @@ void DisplayText::appendText(QString const& text, QColor bg, QColor fg
document ()->setMaximumBlockCount (document ()->maximumBlockCount ()); document ()->setMaximumBlockCount (document ()->maximumBlockCount ());
} }
QString DisplayText::appendWorkedB4 (QString message, QString const& callsign, QString const& grid, QString DisplayText::appendWorkedB4 (QString message, QString call, QString const& grid,
QColor * bg, QColor * fg, LogBook const& logBook, QColor * bg, QColor * fg, LogBook const& logBook,
QString const& currentBand, QString const& currentMode) QString const& currentBand, QString const& currentMode)
{ {
// allow for seconds // allow for seconds
int padding {message.indexOf (" ") > 4 ? 2 : 0}; int padding {message.indexOf (" ") > 4 ? 2 : 0};
QString call = callsign;
QString countryName; QString countryName;
bool callB4; bool callB4;
bool callB4onBand; bool callB4onBand;
@ -292,6 +282,10 @@ QString DisplayText::appendWorkedB4 (QString message, QString const& callsign, Q
if(!ITUZoneB4onBand) { if(!ITUZoneB4onBand) {
types.push_back (Highlight::ITUZoneBand); types.push_back (Highlight::ITUZoneBand);
} }
if (m_config && m_config->lotw_users ().user (call))
{
types.push_back (Highlight::LotW);
}
types.push_back (Highlight::CQ); types.push_back (Highlight::CQ);
auto top_highlight = set_colours (m_config, bg, fg, types); auto top_highlight = set_colours (m_config, bg, fg, types);
@ -367,11 +361,11 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
|| decodedText.string ().contains (" QRZ ")) || decodedText.string ().contains (" QRZ "))
{ {
CQcall = true; CQcall = true;
highlight_types types {Highlight::CQ};
set_colours (m_config, &bg, &fg, types);
} }
if(bCQonly and !CQcall) return; else
if (myCall != "" and (decodedText.indexOf (" " + myCall + " ") >= 0 {
if (bCQonly) return;
if (myCall != "" && (decodedText.indexOf (" " + myCall + " ") >= 0
or decodedText.indexOf (" " + myCall + "/") >= 0 or decodedText.indexOf (" " + myCall + "/") >= 0
or decodedText.indexOf ("<" + myCall + "/") >= 0 or decodedText.indexOf ("<" + myCall + "/") >= 0
or decodedText.indexOf ("/" + myCall + " ") >= 0 or decodedText.indexOf ("/" + myCall + " ") >= 0
@ -382,6 +376,7 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
highlight_types types {Highlight::MyCall}; highlight_types types {Highlight::MyCall};
set_colours (m_config, &bg, &fg, types); set_colours (m_config, &bg, &fg, types);
} }
}
auto message = decodedText.string(); auto message = decodedText.string();
QString dxCall; QString dxCall;
QString dxGrid; QString dxGrid;
@ -389,7 +384,9 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"}; QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"};
if(!dxGrid.contains(grid_regexp)) dxGrid=""; if(!dxGrid.contains(grid_regexp)) dxGrid="";
message = message.left (message.indexOf (QChar::Nbsp)); // strip appended info message = message.left (message.indexOf (QChar::Nbsp)); // strip appended info
if (displayDXCCEntity && CQcall) if (CQcall)
{
if (displayDXCCEntity)
{ {
// if enabled add the DXCC entity and B4 status to the end of the // if enabled add the DXCC entity and B4 status to the end of the
// preformated text line t1 // preformated text line t1
@ -401,6 +398,12 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con
message = appendWorkedB4 (message, decodedText.CQersCall(), dxGrid, &bg, &fg message = appendWorkedB4 (message, decodedText.CQersCall(), dxGrid, &bg, &fg
, logBook, currentBand, currentMode); , logBook, currentBand, currentMode);
} }
else
{
highlight_types types {Highlight::CQ, Highlight::LotW};
set_colours (m_config, &bg, &fg, types);
}
}
appendText (message.trimmed (), bg, fg, decodedText.call (), dxCall); appendText (message.trimmed (), bg, fg, decodedText.call (), dxCall);
} }

View File

@ -44,7 +44,7 @@ protected:
private: private:
Configuration const * m_config; Configuration const * m_config;
bool m_bPrincipalPrefix; bool m_bPrincipalPrefix;
QString appendWorkedB4(QString message, QString const& callsign QString appendWorkedB4(QString message, QString callsign
, QString const& grid, QColor * bg, QColor * fg , QString const& grid, QColor * bg, QColor * fg
, LogBook const& logBook, QString const& currentBand , LogBook const& logBook, QString const& currentBand
, QString const& currentMode); , QString const& currentMode);

View File

@ -139,7 +139,7 @@ void LogQSO::accept()
return; // without accepting return; // without accepting
} }
if (!m_cabrilloLog->add_QSO (m_dialFreq, QDateTime::currentDateTimeUtc (), hisCall, if (!m_cabrilloLog->add_QSO (m_dialFreq, m_dateTimeOff, hisCall,
ui->exchSent->text (), ui->exchRcvd->text ())) ui->exchSent->text (), ui->exchRcvd->text ()))
{ {
show (); show ();