Added JS8NET to disallowed group. Added validation to station add modal
This commit is contained in:
parent
ec5e4f9978
commit
811ecccea3
@ -1010,6 +1010,14 @@ QSet<QString> Configuration::my_groups() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::addGroup(QString const &group){
|
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();
|
QSet<QString> groups = my_groups();
|
||||||
groups.insert(group.trimmed());
|
groups.insert(group.trimmed());
|
||||||
m_->my_groups_ = groups.toList();
|
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)){
|
foreach(auto group, splitGroups(ui_->groups_line_edit->text().toUpper().trimmed(), false)){
|
||||||
if(!Varicode::isGroupAllowed(group)){
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
if(!Varicode::isCompoundCallsign(group)){
|
if(!Varicode::isCompoundCallsign(group)){
|
||||||
|
@ -1278,7 +1278,8 @@ bool Varicode::isCompoundCallsign(const QString &callsign){
|
|||||||
|
|
||||||
bool Varicode::isGroupAllowed(const QString &group){
|
bool Varicode::isGroupAllowed(const QString &group){
|
||||||
const QSet<QString> disallowed = {
|
const QSet<QString> disallowed = {
|
||||||
"@APRSIS"
|
"@APRSIS",
|
||||||
|
"@JS8NET",
|
||||||
};
|
};
|
||||||
return !disallowed.contains(group);
|
return !disallowed.contains(group);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user