Added option to blacklist specific stations' HB messages
This commit is contained in:
parent
f54e632d99
commit
3c9bc48f74
@ -580,6 +580,7 @@ private:
|
||||
QStringList my_groups_;
|
||||
QStringList auto_whitelist_;
|
||||
QStringList auto_blacklist_;
|
||||
QStringList hb_blacklist_;
|
||||
QStringList primary_highlight_words_;
|
||||
QStringList secondary_highlight_words_;
|
||||
QString eot_;
|
||||
@ -1004,6 +1005,11 @@ QSet<QString> Configuration::auto_blacklist() const {
|
||||
return QSet<QString>::fromList(m_->auto_blacklist_);
|
||||
}
|
||||
|
||||
|
||||
QSet<QString> Configuration::hb_blacklist() const {
|
||||
return QSet<QString>::fromList(m_->hb_blacklist_);
|
||||
}
|
||||
|
||||
QSet<QString> Configuration::primary_highlight_words() const {
|
||||
return QSet<QString>::fromList(m_->primary_highlight_words_);
|
||||
}
|
||||
@ -1408,6 +1414,7 @@ void Configuration::impl::initialize_models ()
|
||||
ui_->groups_line_edit->setText(my_groups_.join(", "));
|
||||
ui_->auto_whitelist_line_edit->setText(auto_whitelist_.join(", "));
|
||||
ui_->auto_blacklist_line_edit->setText(auto_blacklist_.join(", "));
|
||||
ui_->hb_blacklist_line_edit->setText(hb_blacklist_.join(", "));
|
||||
ui_->primaryHighlightLineEdit->setText(primary_highlight_words_.join(", "));
|
||||
ui_->secondaryHighlightLineEdit->setText(secondary_highlight_words_.join(", "));
|
||||
ui_->eot_line_edit->setText(eot_.trimmed().left(2));
|
||||
@ -1564,6 +1571,7 @@ void Configuration::impl::read_settings ()
|
||||
my_groups_ = settings_->value("MyGroups", QStringList{}).toStringList();
|
||||
auto_whitelist_ = settings_->value("AutoWhitelist", QStringList{}).toStringList();
|
||||
auto_blacklist_ = settings_->value("AutoBlacklist", QStringList{}).toStringList();
|
||||
hb_blacklist_ = settings_->value("HBBlacklist", QStringList{}).toStringList();
|
||||
primary_highlight_words_ = settings_->value("PrimaryHighlightWords", QStringList{}).toStringList();
|
||||
secondary_highlight_words_ = settings_->value("SecondaryHighlightWords", QStringList{}).toStringList();
|
||||
callsign_aging_ = settings_->value ("CallsignAging", 0).toInt ();
|
||||
@ -1835,6 +1843,7 @@ void Configuration::impl::write_settings ()
|
||||
settings_->setValue ("MyGroups", my_groups_);
|
||||
settings_->setValue ("AutoWhitelist", auto_whitelist_);
|
||||
settings_->setValue ("AutoBlacklist", auto_blacklist_);
|
||||
settings_->setValue ("HBBlacklist", hb_blacklist_);
|
||||
settings_->setValue ("PrimaryHighlightWords", primary_highlight_words_);
|
||||
settings_->setValue ("SecondaryHighlightWords", secondary_highlight_words_);
|
||||
settings_->setValue ("EOTCharacter", eot_);
|
||||
@ -2439,6 +2448,7 @@ void Configuration::impl::accept ()
|
||||
my_groups_ = splitGroups(ui_->groups_line_edit->text().toUpper().trimmed(), true);
|
||||
auto_whitelist_ = splitWords(ui_->auto_whitelist_line_edit->text().toUpper().trimmed());
|
||||
auto_blacklist_ = splitWords(ui_->auto_blacklist_line_edit->text().toUpper().trimmed());
|
||||
hb_blacklist_ = splitWords(ui_->hb_blacklist_line_edit->text().toUpper().trimmed());
|
||||
primary_highlight_words_ = splitWords(ui_->primaryHighlightLineEdit->text().toUpper().trimmed());
|
||||
secondary_highlight_words_ = splitWords(ui_->secondaryHighlightLineEdit->text().toUpper().trimmed());
|
||||
cq_ = ui_->cq_message_line_edit->text().toUpper();
|
||||
|
@ -102,6 +102,7 @@ public:
|
||||
void removeGroup(QString const &group);
|
||||
QSet<QString> auto_whitelist() const;
|
||||
QSet<QString> auto_blacklist() const;
|
||||
QSet<QString> hb_blacklist() const;
|
||||
QSet<QString> primary_highlight_words() const;
|
||||
QSet<QString> secondary_highlight_words() const;
|
||||
int activity_aging() const;
|
||||
|
@ -23,7 +23,7 @@
|
||||
<string>Select tab to change configuration parameters.</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>6</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="general_tab">
|
||||
<attribute name="title">
|
||||
@ -277,9 +277,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>615</width>
|
||||
<height>808</height>
|
||||
<y>-266</y>
|
||||
<width>724</width>
|
||||
<height>839</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_26">
|
||||
@ -605,6 +605,16 @@ text message.</string>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="auto_blacklist_line_edit"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_26">
|
||||
<property name="text">
|
||||
<string>Never ACK HBs from these callsigns (comman separated):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="hb_blacklist_line_edit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -3694,8 +3704,8 @@ QListView::item:hover {
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>738</width>
|
||||
<height>378</height>
|
||||
<width>277</width>
|
||||
<height>93</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
|
@ -10777,6 +10777,11 @@ void MainWindow::processCommandActivity() {
|
||||
// if we have auto reply enabled and auto ack enabled and no callsign is selected
|
||||
else if (d.cmd == " HB" && ui->autoReplyButton->isChecked() && m_hbAutoAck && selectedCallsign.isEmpty()){
|
||||
|
||||
// check to make sure this callsign isn't blacklisted
|
||||
if(m_config.hb_blacklist().contains(d.from) || m_config.hb_blacklist().contains(Radio::base_callsign(d.from))){
|
||||
continue;
|
||||
}
|
||||
|
||||
// check to see if we have a message for a station who is heartbeating
|
||||
QString extra;
|
||||
auto mid = getNextMessageIdForCallsign(d.from);
|
||||
|
Loading…
Reference in New Issue
Block a user