diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-06-20 20:27:03 +0200 |
---|---|---|
committer | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-09-16 16:50:19 +0200 |
commit | ad204df1a9077327ab1142fbc9bf41369c1a73d1 (patch) | |
tree | 40bf9432ae40956dcb6990814832e6b8ceca0158 /src/qt/rpcconsole.cpp | |
parent | 50f090884ccd29e439720aeb83fcd293fae34921 (diff) |
[Qt] add banlist table below peers table
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r-- | src/qt/rpcconsole.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 2a94312be0..c6e70697fb 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -8,6 +8,7 @@ #include "clientmodel.h" #include "guiutil.h" #include "platformstyle.h" +#include "bantablemodel.h" #include "chainparams.h" #include "rpcserver.h" @@ -351,6 +352,9 @@ void RPCConsole::setClientModel(ClientModel *model) ui->peerWidget->setColumnWidth(PeerTableModel::Subversion, SUBVERSION_COLUMN_WIDTH); ui->peerWidget->setColumnWidth(PeerTableModel::Ping, PING_COLUMN_WIDTH); + // set up ban table + ui->banlistWidget->setModel(model->getBanTableModel()); + // create context menu actions QAction* disconnectAction = new QAction(tr("&Disconnect Node"), this); QAction* banAction1h = new QAction(tr("&Ban Node for 1 hour"), this); @@ -395,6 +399,12 @@ void RPCConsole::setClientModel(ClientModel *model) ui->buildDate->setText(model->formatBuildDate()); ui->startupTime->setText(model->formatClientStartupTime()); ui->networkName->setText(QString::fromStdString(Params().NetworkIDString())); + + if (!clientModel->getBanTableModel()->shouldShow()) + { + ui->banlistWidget->hide(); + ui->banHeading->hide(); + } } } @@ -766,6 +776,9 @@ void RPCConsole::banSelectedNode(int bantime) CNode::Ban(CNetAddr(addr), bantime); bannedNode->CloseSocketDisconnect(); clearSelectedNode(); + ui->banlistWidget->setVisible(true); + ui->banHeading->setVisible(true); + clientModel->updateBanlist(); } } |