Fixed #123: add/remove allcall group like other groups

This commit is contained in:
Jordan Sherer 2019-02-16 10:40:44 -05:00
parent 0b9f75a9c8
commit f1ed44f9e9
3 changed files with 19 additions and 4 deletions

View File

@ -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_;}

View File

@ -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;

View File

@ -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);