Allow opening multiple windows

This commit is contained in:
tobtoht
2021-05-18 18:08:40 +02:00
parent cc01924858
commit f43949a346
110 changed files with 1839 additions and 1903 deletions
+9 -1
View File
@@ -20,6 +20,8 @@ QPointer<WebsocketNotifier> WebsocketNotifier::m_instance(nullptr);
void WebsocketNotifier::onWSMessage(const QJsonObject &msg) {
QString cmd = msg.value("cmd").toString();
m_cache[cmd] = msg;
if (cmd == "blockheights") {
QJsonObject data = msg.value("data").toObject();
int mainnet = data.value("mainnet").toInt();
@@ -84,6 +86,12 @@ void WebsocketNotifier::onWSMessage(const QJsonObject &msg) {
#endif
}
void WebsocketNotifier::emitCache() {
for (const auto &msg : m_cache) {
this->onWSMessage(msg);
}
}
void WebsocketNotifier::onWSNodes(const QJsonArray &nodes) {
// TODO: Refactor, should be filtered client side
@@ -93,7 +101,7 @@ void WebsocketNotifier::onWSNodes(const QJsonArray &nodes) {
auto nettype = obj.value("nettype");
auto type = obj.value("type");
auto networkType = config()->get(Config::networkType).toInt();
auto networkType = constants::networkType;
// filter remote node network types
if(nettype == "mainnet" && networkType != NetworkType::MAINNET)