Added JS8NET to disallowed group. Added validation to station add modal

This commit is contained in:
Jordan Sherer 2019-11-30 09:45:25 -05:00
parent ec5e4f9978
commit 811ecccea3
2 changed files with 11 additions and 2 deletions

View File

@ -1010,6 +1010,14 @@ QSet<QString> Configuration::my_groups() const {
}
void Configuration::addGroup(QString const &group){
if(!Varicode::isGroupAllowed(group)){
MessageBox::critical_message (m_->window(), QString("%1 is a group that cannot be joined").arg(group));
return;
}
if(!Varicode::isCompoundCallsign(group)){
MessageBox::critical_message (m_->window(), QString("%1 is not a valid group").arg(group));
return;
}
QSet<QString> groups = my_groups();
groups.insert(group.trimmed());
m_->my_groups_ = groups.toList();
@ -2401,7 +2409,7 @@ bool Configuration::impl::validate ()
foreach(auto group, splitGroups(ui_->groups_line_edit->text().toUpper().trimmed(), false)){
if(!Varicode::isGroupAllowed(group)){
MessageBox::critical_message (this, QString("%1 is not an available group").arg(group));
MessageBox::critical_message (this, QString("%1 is a group that cannot be joined").arg(group));
return false;
}
if(!Varicode::isCompoundCallsign(group)){

View File

@ -1278,7 +1278,8 @@ bool Varicode::isCompoundCallsign(const QString &callsign){
bool Varicode::isGroupAllowed(const QString &group){
const QSet<QString> disallowed = {
"@APRSIS"
"@APRSIS",
"@JS8NET",
};
return !disallowed.contains(group);
}