aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Schnelli <jonas.schnelli@include7.ch>2015-06-20 20:27:28 +0200
committerJonas Schnelli <jonas.schnelli@include7.ch>2015-09-16 16:50:19 +0200
commit5f421329508d6e86c410282c7de39d7e80b0b289 (patch)
tree2e54998588ade08a3325a5eba91dd1c28d53735c
parentad204df1a9077327ab1142fbc9bf41369c1a73d1 (diff)
[Qt] add ui signal for banlist changes
-rw-r--r--src/qt/clientmodel.cpp8
-rw-r--r--src/rpcnet.cpp5
-rw-r--r--src/ui_interface.h3
3 files changed, 16 insertions, 0 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 62c35130f8..7f5dea0ef9 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -243,12 +243,19 @@ static void NotifyAlertChanged(ClientModel *clientmodel, const uint256 &hash, Ch
Q_ARG(int, status));
}
+static void BannedListChanged(ClientModel *clientmodel)
+{
+ qDebug() << "BannedListChanged";
+ QMetaObject::invokeMethod(clientmodel, "updateBanlist", Qt::QueuedConnection);
+}
+
void ClientModel::subscribeToCoreSignals()
{
// Connect signals to client
uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2));
uiInterface.NotifyNumConnectionsChanged.connect(boost::bind(NotifyNumConnectionsChanged, this, _1));
uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this, _1, _2));
+ uiInterface.BannedListChanged.connect(boost::bind(BannedListChanged, this));
}
void ClientModel::unsubscribeFromCoreSignals()
@@ -257,4 +264,5 @@ void ClientModel::unsubscribeFromCoreSignals()
uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2));
uiInterface.NotifyNumConnectionsChanged.disconnect(boost::bind(NotifyNumConnectionsChanged, this, _1));
uiInterface.NotifyAlertChanged.disconnect(boost::bind(NotifyAlertChanged, this, _1, _2));
+ uiInterface.BannedListChanged.disconnect(boost::bind(BannedListChanged, this));
}
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp
index 30d0ed6270..482e2ac47b 100644
--- a/src/rpcnet.cpp
+++ b/src/rpcnet.cpp
@@ -12,6 +12,7 @@
#include "protocol.h"
#include "sync.h"
#include "timedata.h"
+#include "ui_interface.h"
#include "util.h"
#include "utilstrencodings.h"
#include "version.h"
@@ -531,6 +532,8 @@ UniValue setban(const UniValue& params, bool fHelp)
}
DumpBanlist(); //store banlist to disk
+ uiInterface.BannedListChanged();
+
return NullUniValue;
}
@@ -577,6 +580,8 @@ UniValue clearbanned(const UniValue& params, bool fHelp)
CNode::ClearBanned();
DumpBanlist(); //store banlist to disk
+
+ uiInterface.BannedListChanged();
return NullUniValue;
}
diff --git a/src/ui_interface.h b/src/ui_interface.h
index 32a92a4b81..e402479933 100644
--- a/src/ui_interface.h
+++ b/src/ui_interface.h
@@ -95,6 +95,9 @@ public:
/** New block has been accepted */
boost::signals2::signal<void (const uint256& hash)> NotifyBlockTip;
+
+ /** Banlist did change. */
+ boost::signals2::signal<void (void)> BannedListChanged;
};
extern CClientUIInterface uiInterface;