diff --git a/Configuration.cpp b/Configuration.cpp index 3571262..24acbd7 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -781,6 +781,12 @@ bool Configuration::ppfx() const {return m_->ppfx_;} bool Configuration::clear_callsign () const {return m_->clear_callsign_;} bool Configuration::miles () const {return m_->miles_;} bool Configuration::avoid_allcall () const {return m_->avoid_allcall_;} +bool Configuration::set_avoid_allcall(bool avoid) { + if(m_->avoid_allcall_ != avoid){ + m_->avoid_allcall_ = avoid; + m_->write_settings(); + } +} bool Configuration::spellcheck () const {return m_->spellcheck_;} bool Configuration::quick_call () const {return m_->quick_call_;} bool Configuration::disable_TX_on_73 () const {return m_->disable_TX_on_73_;} diff --git a/Configuration.hpp b/Configuration.hpp index a4a6050..f47ba0b 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -138,6 +138,7 @@ public: bool clear_callsign () const; bool miles () const; bool avoid_allcall () const; + bool set_avoid_allcall (bool avoid); bool spellcheck() const; bool quick_call () const; bool disable_TX_on_73 () const; diff --git a/mainwindow.cpp b/mainwindow.cpp index 2c0a994..995dbcf 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1346,7 +1346,11 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, return; } - if(callsign.startsWith("@")){ + // if we're adding allcall, turn off allcall avoidance + if(callsign == "@ALLCALL"){ + m_config.set_avoid_allcall(false); + } + else if(callsign.startsWith("@")){ if(Varicode::isCompoundCallsign(callsign)){ m_config.addGroup(callsign); } else { @@ -1373,9 +1377,13 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, return; } - if (selectedCall.startsWith("@")){ + if (selectedCall == "@ALLCALL"){ + m_config.set_avoid_allcall(true); + } + else if (selectedCall.startsWith("@")){ m_config.removeGroup(selectedCall); - } else if(m_callActivity.contains(selectedCall)){ + } + else if(m_callActivity.contains(selectedCall)){ m_callActivity.remove(selectedCall); } @@ -1516,7 +1524,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, menu->addSeparator(); menu->addAction(addStation); - removeStation->setDisabled(missingCallsign || isAllCall); + removeStation->setDisabled(missingCallsign); removeStation->setText(selectedCall.startsWith("@") ? "Remove Group" : "Remove Station"); menu->addAction(removeStation);