diff --git a/src/bannedpeerstablemodel.cpp b/src/bannedpeerstablemodel.cpp index c25cae9..0c55e12 100644 --- a/src/bannedpeerstablemodel.cpp +++ b/src/bannedpeerstablemodel.cpp @@ -1,5 +1,6 @@ // Copyright 2019-2021 The Hush developers // Released under the GPLv3 +#include "bannedpeerstablemodel.h" #include "settings.h" #include "rpc.h" diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 29e95d8..e32e7e8 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1453,6 +1453,12 @@ void MainWindow::setupPeersTab() { if(!ip.isEmpty()) { menu.addAction(tr("Unban this peer"), [=] () { + ui->statusBar->showMessage(tr("Unbanning peer...")); + + // Hide single banned peer + ui->bannedPeersTable->hideRow(index.row()); + + // Call setban rpc->setban(ip, "remove", [=] (QJsonValue response){ qDebug() << "setban remove " << response; ui->statusBar->showMessage(tr("Peer unbanned"), 3 * 1000); @@ -1461,6 +1467,14 @@ void MainWindow::setupPeersTab() { }); menu.addAction(tr("Unban all peers"), [=] () { + ui->statusBar->showMessage(tr("Unbanning all peers...")); + + // Hide all banned peers + for (int i=0; i < bannedPeerModel->rowCount(index); i++){ + ui->bannedPeersTable->hideRow(i); + } + + // Call clearBanned rpc->clearBanned([=] (QJsonValue response){ qDebug() << "clearBanned " << response; ui->statusBar->showMessage(tr("All peers unbanned"), 3 * 1000); @@ -1525,6 +1539,12 @@ void MainWindow::setupPeersTab() { } menu.addAction(tr("Ban this peer"), [=] () { + ui->statusBar->showMessage(tr("Banning peer...")); + + // Hide single peer + ui->peersTable->hideRow(index.row()); + + // Call setban rpc->setban(ip, "add", [=] (QJsonValue response){ qDebug() << "setban add " << response; ui->statusBar->showMessage(tr("Peer banned"), 3 * 1000); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 1e7f9b8..092ccdc 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -22,7 +22,7 @@ - 3 + 0 @@ -222,7 +222,7 @@ - + 0 @@ -250,6 +250,9 @@ + + + QAbstractItemView::SingleSelection diff --git a/src/peerstablemodel.cpp b/src/peerstablemodel.cpp index 0be6076..11efde0 100644 --- a/src/peerstablemodel.cpp +++ b/src/peerstablemodel.cpp @@ -1,6 +1,6 @@ // Copyright 2019-2021 The Hush developers // Released under the GPLv3 -#include "txtablemodel.h" +#include "peerstablemodel.h" #include "settings.h" #include "rpc.h" @@ -112,7 +112,7 @@ int PeersTableModel::columnCount(const QModelIndex&) const // If the memo is a Payment URI, then show a payment request icon if (dat.memo.startsWith("hush:")) { QIcon icon(":/icons/res/paymentreq.gif"); - return QVariant(icon.pixmap(16, 16)); + return QVariant(icon.pixmap(16, 16));listtra } else { // Return the info pixmap to indicate memo QIcon icon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation); diff --git a/src/txtablemodel.cpp b/src/txtablemodel.cpp index e2ce779..6a4da88 100644 --- a/src/txtablemodel.cpp +++ b/src/txtablemodel.cpp @@ -72,7 +72,7 @@ bool TxTableModel::exportToCsv(QString fileName) const { return true; } -void TxTableModel::updateAllData() { +void TxTableModel::updateAllData() { auto newmodeldata = new QList(); if (tTrans != nullptr) std::copy( tTrans->begin(), tTrans->end(), std::back_inserter(*newmodeldata));