diff --git a/Configuration.cpp b/Configuration.cpp index 1d2e816..ffb22f4 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -467,6 +467,7 @@ private: Q_SLOT void on_calibration_slope_ppm_spin_box_valueChanged (double); Q_SLOT void handle_transceiver_update (TransceiverState const&, unsigned sequence_number); Q_SLOT void handle_transceiver_failure (QString const& reason); + Q_SLOT void on_cqMessagesButton_clicked(); Q_SLOT void on_primaryHighlightButton_clicked(); Q_SLOT void on_secondaryHighlightButton_clicked(); Q_SLOT void on_pbMyCall_clicked(); @@ -591,6 +592,8 @@ private: QColor next_color_primary_highlight_; QColor color_secondary_highlight_; QColor next_color_secondary_highlight_; + QColor color_cq_; + QColor next_color_cq_; QColor color_mycall_; QColor next_color_mycall_; @@ -728,6 +731,7 @@ QColor Configuration::color_table_highlight() const { return m_->color_table_hi QColor Configuration::color_table_foreground() const { return m_->color_table_foreground_; } QColor Configuration::color_primary_highlight () const {return m_->color_primary_highlight_;} QColor Configuration::color_secondary_highlight () const {return m_->color_secondary_highlight_;} +QColor Configuration::color_CQ() const { return m_->color_cq_; } QColor Configuration::color_MyCall () const {return m_->color_mycall_;} QColor Configuration::color_rx_background () const {return m_->color_rx_background_;} QColor Configuration::color_rx_foreground () const {return m_->color_rx_foreground_;} @@ -1417,6 +1421,7 @@ void Configuration::impl::initialize_models () ui_->tableSelectionBackgroundLabel->setStyleSheet(QString("background: %1; color: %2").arg(next_color_table_highlight_.name()).arg(next_color_table_foreground_.name())); ui_->primaryHighlightLabel->setStyleSheet(QString("background: %1; color: %2").arg(next_color_primary_highlight_.name()).arg(next_color_table_foreground_.name())); ui_->secondaryHighlightLabel->setStyleSheet(QString("background: %1; color: %2").arg(next_color_secondary_highlight_.name()).arg(next_color_table_foreground_.name())); + ui_->cqMessagesLabel->setStyleSheet(QString("background: %1; color: %2").arg(next_color_cq_.name()).arg(next_color_table_foreground_.name())); ui_->labMyCall->setStyleSheet(QString("background: %1; color: %2").arg(next_color_mycall_.name()).arg(next_color_table_foreground_.name())); ui_->rxLabel->setStyleSheet(QString("background: %1; color: %2").arg(color_rx_background_.name()).arg(color_rx_foreground_.name())); @@ -1559,7 +1564,7 @@ void Configuration::impl::read_settings () my_groups_ = settings_->value("MyGroups", QStringList{}).toStringList(); auto_whitelist_ = settings_->value("AutoWhitelist", QStringList{}).toStringList(); auto_blacklist_ = settings_->value("AutoBlacklist", QStringList{}).toStringList(); - primary_highlight_words_ = settings_->value("PrimaryHighlightWords", QStringList{"CQ"}).toStringList(); + primary_highlight_words_ = settings_->value("PrimaryHighlightWords", QStringList{}).toStringList(); secondary_highlight_words_ = settings_->value("SecondaryHighlightWords", QStringList{}).toStringList(); callsign_aging_ = settings_->value ("CallsignAging", 0).toInt (); activity_aging_ = settings_->value ("ActivityAging", 2).toInt (); @@ -1567,7 +1572,8 @@ void Configuration::impl::read_settings () my_info_ = settings_->value("MyInfo", QString {}).toString(); cq_ = settings_->value("CQMessage", QString {"CQ CQ CQ "}).toString(); reply_ = settings_->value("Reply", QString {"HW CPY?"}).toString(); - next_color_primary_highlight_ = color_primary_highlight_ = settings_->value("colorPrimary", settings_->value("colorCQ","#66ff66").toString()).toString(); + next_color_cq_ = color_cq_ = settings_->value("colorCQ","#66ff66").toString(); + next_color_primary_highlight_ = color_primary_highlight_ = settings_->value("colorPrimary", "#f1c40f").toString(); next_color_secondary_highlight_ = color_secondary_highlight_ = settings_->value("colorSecondary","#ffff66").toString(); next_color_mycall_ = color_mycall_ = settings_->value("colorMyCall","#ff6666").toString(); next_color_rx_background_ = color_rx_background_ = settings_->value("color_rx_background","#ffeaa7").toString(); @@ -1837,7 +1843,8 @@ void Configuration::impl::write_settings () settings_->setValue ("Reply", reply_); settings_->setValue ("CallsignAging", callsign_aging_); settings_->setValue ("ActivityAging", activity_aging_); - settings_->setValue("colorCQ",color_primary_highlight_); + settings_->setValue("colorCQ", color_cq_); + settings_->setValue("colorPrimary", color_primary_highlight_); settings_->setValue("colorSecondary",color_secondary_highlight_); settings_->setValue("colorMyCall",color_mycall_); settings_->setValue("color_rx_background",color_rx_background_); @@ -2333,6 +2340,7 @@ void Configuration::impl::accept () color_primary_highlight_ = next_color_primary_highlight_; color_secondary_highlight_ = next_color_secondary_highlight_; + color_cq_ = next_color_cq_; color_mycall_ = next_color_mycall_; color_rx_background_ = next_color_rx_background_; color_rx_foreground_ = next_color_rx_foreground_; @@ -2625,6 +2633,15 @@ QColor getColor(QColor initial, QWidget *parent, QString title){ } } +void Configuration::impl::on_cqMessagesButton_clicked(){ + auto new_color = getColor(next_color_cq_, this, "CQ Messages Color"); + if (new_color.isValid ()) + { + next_color_cq_ = new_color; + ui_->cqMessagesLabel->setStyleSheet(QString("background: %1; color: %2").arg(next_color_cq_.name()).arg(next_color_table_foreground_.name())); + } +} + void Configuration::impl::on_primaryHighlightButton_clicked() { auto new_color = getColor(next_color_primary_highlight_, this, "Primary Highlight Color"); @@ -2687,6 +2704,7 @@ void Configuration::impl::on_tableForegroundButton_clicked() ui_->tableSelectionBackgroundLabel->setStyleSheet(QString("background: %1; color: %2").arg(next_color_table_highlight_.name()).arg(next_color_table_foreground_.name())); ui_->primaryHighlightLabel->setStyleSheet(QString("background: %1; color: %2").arg(next_color_primary_highlight_.name()).arg(next_color_table_foreground_.name())); ui_->secondaryHighlightLabel->setStyleSheet(QString("background: %1; color: %2").arg(next_color_secondary_highlight_.name()).arg(next_color_table_foreground_.name())); + ui_->cqMessagesLabel->setStyleSheet(QString("background: %1; color: %2").arg(next_color_cq_.name()).arg(next_color_table_foreground_.name())); ui_->labMyCall->setStyleSheet(QString("background: %1; color: %2").arg(next_color_mycall_.name()).arg(next_color_table_foreground_.name())); } } diff --git a/Configuration.hpp b/Configuration.hpp index 8368786..75f4b05 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -206,6 +206,7 @@ public: QColor color_table_foreground() const; QColor color_primary_highlight () const; QColor color_secondary_highlight () const; + QColor color_CQ () const; QColor color_MyCall () const; QColor color_rx_background () const; QColor color_rx_foreground () const; diff --git a/Configuration.ui b/Configuration.ui index 1e84eb2..02b4e08 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -23,7 +23,7 @@ Select tab to change configuration parameters. - 0 + 6 @@ -277,8 +277,8 @@ 0 - -355 - 724 + 0 + 615 808 @@ -1022,8 +1022,8 @@ radio interface behave as expected. 0 - -49 - 718 + 0 + 264 435 @@ -1443,7 +1443,7 @@ a few, particularly some Kenwood rigs, require it). 0 - -104 + 0 718 490 @@ -3002,7 +3002,7 @@ QListView::item:hover { - 2 + 0 false @@ -3038,7 +3038,7 @@ QListView::item:hover { 0 0 724 - 387 + 418 @@ -3065,18 +3065,51 @@ QListView::item:hover { 0 - - - - - + + + + + 140 + 0 + + - Font + Primary Highlight Background - - + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + Foreground Color + + + + + + + Highlight these words or callsigns with the primary background color (comma separated): + + + true + + + + + 80 @@ -3084,7 +3117,7 @@ QListView::item:hover { - QLabel{background-color: white}<?xml version="1.0" encoding="UTF-8"?> + QLabel{background-color: #3498db}<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <widget name="__qt_fake_top_level"> <widget class="QLabel" name="labCQ"> @@ -3125,21 +3158,27 @@ QListView::item:hover { - - + + - 140 - 0 + 80 + 20 + + QLabel{background-color: #f1c40f} + - Directed Messages Background + K1ABC + + + Qt::AlignCenter - - + + Qt::Vertical @@ -3151,44 +3190,8 @@ QListView::item:hover { - - - - - 80 - 20 - - - - QLabel{background-color: #66ff66} - - - K1ABC - - - Qt::AlignCenter - - - - - - - Highlight these words or callsigns with the primary background color (comma separated): - - - true - - - - - - - Foreground Color - - - - - + + 140 @@ -3196,10 +3199,13 @@ QListView::item:hover { - Primary Highlight Background + Secondary Highlight Background + + + @@ -3257,54 +3263,8 @@ QListView::item:hover { - - - - Selected Row Background - - - - - - - Qt::Vertical - - - - 20 - 20 - - - - - - - - - 140 - 0 - - - - Secondary Highlight Background - - - - - - - Qt::Vertical - - - - 20 - 20 - - - - - - + + 80 @@ -3312,58 +3272,7 @@ QListView::item:hover { - QLabel{background-color: #ffff66} - - - K1ABC - - - Qt::AlignCenter - - - - - - - - 80 - 20 - - - - QLabel{background-color: #ff6666} - - - K1ABC - - - Qt::AlignCenter - - - - - - - - - - Highlight these words or callsigns with the secondary background color (comma separated): - - - true - - - - - - - - 80 - 20 - - - - QLabel{background-color: #3498db}<?xml version="1.0" encoding="UTF-8"?> + QLabel{background-color: white}<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <widget name="__qt_fake_top_level"> <widget class="QLabel" name="labCQ"> @@ -3404,6 +3313,129 @@ QListView::item:hover { + + + + Font + + + + + + + + 80 + 20 + + + + QLabel{background-color: #66ff66} + + + K1ABC + + + Qt::AlignCenter + + + + + + + + 80 + 20 + + + + QLabel{background-color: #ff6666} + + + K1ABC + + + Qt::AlignCenter + + + + + + + + 140 + 0 + + + + Directed Messages Background + + + + + + + + 140 + 0 + + + + CQ Messages Background + + + + + + + Highlight these words or callsigns with the secondary background color (comma separated): + + + true + + + + + + + + + + Selected Row Background + + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + 80 + 20 + + + + QLabel{background-color: #ffff66} + + + K1ABC + + + Qt::AlignCenter + + + @@ -3458,8 +3490,8 @@ QListView::item:hover { 0 0 - 738 - 378 + 233 + 253 diff --git a/mainwindow.cpp b/mainwindow.cpp index 08e2def..422a1ed 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -11583,6 +11583,12 @@ void MainWindow::displayBandActivity() { if(!text.isEmpty()){ auto words = QSet::fromList(joined.replace(":", " ").replace(">"," ").split(" ")); + if(words.contains("CQ")){ + for(int i = 0; i < ui->tableWidgetRXAll->columnCount(); i++){ + ui->tableWidgetRXAll->item(row, i)->setBackground(QBrush(m_config.color_CQ())); + } + } + auto matchingSecondaryWords = m_config.secondary_highlight_words() & words; if (!matchingSecondaryWords.isEmpty()){ for(int i = 0; i < ui->tableWidgetRXAll->columnCount(); i++){ @@ -11894,6 +11900,12 @@ void MainWindow::displayCallActivity() { } } + if(hasCQ){ + for(int i = 0; i < ui->tableWidgetRXAll->columnCount(); i++){ + ui->tableWidgetCalls->item(row, i)->setBackground(QBrush(m_config.color_CQ())); + } + } + if (m_config.secondary_highlight_words().contains(call)){ for(int i = 0; i < ui->tableWidgetCalls->columnCount(); i++){ ui->tableWidgetCalls->item(row, i)->setBackground(QBrush(m_config.color_secondary_highlight()));