aboutsummaryrefslogtreecommitdiff
path: root/src/qt/rpcconsole.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <jonas.schnelli@include7.ch>2015-06-21 10:44:48 +0200
committerJonas Schnelli <jonas.schnelli@include7.ch>2015-09-16 16:50:19 +0200
commit53caec66cc43e1f16ba26e16147b77f5cfba22bb (patch)
tree13ec0315c209b5aa494c535e868ff76d2a729214 /src/qt/rpcconsole.cpp
parentf0bcbc4c8a9918e5d240ba2736286cede76155f5 (diff)
downloadbitcoin-53caec66cc43e1f16ba26e16147b77f5cfba22bb.tar.xz
[Qt] bantable overhaul
- some code cleanups - fix date formatting - reduce header includes
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r--src/qt/rpcconsole.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 3f20f67f24..9271df9535 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -356,10 +356,10 @@ void RPCConsole::setClientModel(ClientModel *model)
// create context menu actions
QAction* disconnectAction = new QAction(tr("&Disconnect Node"), this);
- QAction* banAction1h = new QAction(tr("&Ban Node for 1 hour"), this);
- QAction* banAction24h = new QAction(tr("&Ban Node for 24 hours"), this);
- QAction* banAction7d = new QAction(tr("&Ban Node for 7 days"), this);
- QAction* banAction365d = new QAction(tr("&Ban Node for 1 year"), this);
+ QAction* banAction1h = new QAction(tr("&Ban Node for") + " " + tr("&1 hour"), this);
+ QAction* banAction24h = new QAction(tr("&Ban Node for") + " " + tr("&24 hours"), this);
+ QAction* banAction7d = new QAction(tr("&Ban Node for") + " " + tr("&7 days"), this);
+ QAction* banAction365d = new QAction(tr("&Ban Node for") + " " + tr("&1 year"), this);
// create context menu
peersTableContextMenu = new QMenu();
@@ -798,7 +798,8 @@ void RPCConsole::banSelectedNode(int bantime)
SplitHostPort(nStr, port, addr);
CNode::Ban(CNetAddr(addr), bantime);
- bannedNode->CloseSocketDisconnect();
+ bannedNode->fDisconnect = true;
+
clearSelectedNode();
ui->banlistWidget->setVisible(true);
ui->banHeading->setVisible(true);
@@ -830,6 +831,9 @@ void RPCConsole::clearSelectedNode()
void RPCConsole::showOrHideBanTableIfRequired()
{
+ if (!clientModel)
+ return;
+
bool visible = clientModel->getBanTableModel()->shouldShow();
ui->banlistWidget->setVisible(visible);
ui->banHeading->setVisible(visible);