Browse Source

Merge pull request #11356 from Chocobo1/banIP

Allow to select multiple entries in "banned IP" dialog
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
475fbfb712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/gui/banlistoptionsdialog.cpp
  2. 3
      src/gui/banlistoptionsdialog.ui

8
src/gui/banlistoptionsdialog.cpp

@ -107,8 +107,12 @@ void BanListOptionsDialog::on_buttonBanIP_clicked() @@ -107,8 +107,12 @@ void BanListOptionsDialog::on_buttonBanIP_clicked()
void BanListOptionsDialog::on_buttonDeleteIP_clicked()
{
const QModelIndexList selection = m_ui->bannedIPList->selectionModel()->selectedIndexes();
for (const auto &i : selection)
QModelIndexList selection = m_ui->bannedIPList->selectionModel()->selectedIndexes();
std::sort(selection.begin(), selection.end(), [](const QModelIndex &left, const QModelIndex &right)
{
return (left.row() > right.row());
});
for (const QModelIndex &i : selection)
m_sortFilter->removeRow(i.row());
m_modified = true;

3
src/gui/banlistoptionsdialog.ui

@ -49,6 +49,9 @@ @@ -49,6 +49,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>

Loading…
Cancel
Save