From 2c6344cdfaed67d49961f3922f56bb2dce9e5b37 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 5 Sep 2018 11:07:27 -0400 Subject: [PATCH] Switch automatically to EU VHF contest messages, with notification to user. --- Configuration.cpp | 8 ++++++++ Configuration.hpp | 1 + mainwindow.cpp | 16 ++++++++++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Configuration.cpp b/Configuration.cpp index 783086721..2296c577c 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -851,6 +851,14 @@ QString Configuration::FieldDayExchange() const return m_->FD_exchange_; } +void Configuration::setEU_VHF_Contest() +{ + m_->bEU_VHF_Contest_ = true; + m_->ui_->rbEU_VHF_Contest->setChecked(m_->bEU_VHF_Contest_); + m_->ui_->cbGenerate77->setChecked(true); + m_->write_settings(); +} + QString Configuration::RTTYExchange() const { return m_->RTTY_exchange_; diff --git a/Configuration.hpp b/Configuration.hpp index 2b6dab9bd..c7372f1b4 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -98,6 +98,7 @@ public: QString my_grid () const; QString FieldDayExchange() const; QString RTTYExchange() const; + void setEU_VHF_Contest(); QFont text_font () const; QFont decoded_text_font () const; qint32 id_interval () const; diff --git a/mainwindow.cpp b/mainwindow.cpp index 6d002e3ed..9c34315f1 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -4291,8 +4291,16 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie } bool bEU_VHF_w2=(nrpt>=520001 and nrpt<=594000); if(bEU_VHF_w2 and m_nContest!=EU_VHF) { - // ### Should be in EU VHF Contest mode ??? ### - MessageBox::information_message (this, tr ("Should you switch to EU VHF Contest mode?")); + // Switch automatically to EU VHF Contest mode + m_config.setEU_VHF_Contest(); + m_nContest=EU_VHF; + if(m_transmitting) m_restart=true; + ui->decodedTextBrowser2->displayQSY (QString{"Enabled EU VHF Contest messages."}); + +// MessageBox::information_message (this, tr ("EU VHF Contest messages enabled.")); + QString t0=" Tx2.0 EU VHF"; + ui->labDXped->setVisible(true); + ui->labDXped->setText(t0); } QStringList t=message.string().split(' ', QString::SkipEmptyParts); int n=t.size(); @@ -4314,8 +4322,8 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie n=w34.toInt(); bool bRTTY = (n>=529 and n<=599); if(bRTTY and m_nContest!=RTTY) { - // ### Should be in ARRL RTTY Roundup mode ??? ### - MessageBox::information_message (this, tr ("Should you switch to ARRL RTTY Roundup mode?")); + // ### Should be in RTTY contest mode ??? ### + MessageBox::information_message (this, tr ("Should you switch to RTTY contest mode?")); } if(message_words.size () > 3 // enough fields for a normal message