From e179e723f5d6243e74a432273da7ea73893fe174 Mon Sep 17 00:00:00 2001 From: fekt Date: Tue, 1 Nov 2022 22:09:48 -0400 Subject: [PATCH] Fix no connection status on sync --- src/controller.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/controller.cpp b/src/controller.cpp index 81badcb..920338d 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -242,6 +242,7 @@ void Controller::fillTxJsonParams(json& allRecepients, Tx tx) void Controller::noConnection() { + qDebug()<< __func__; QIcon i = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical); main->statusIcon->setPixmap(i.pixmap(16, 16)); main->statusIcon->setToolTip(""); @@ -272,8 +273,9 @@ void Controller::noConnection() /// This will refresh all the balance data from hushd void Controller::refresh(bool force) { + qDebug()<< __func__; if (!zrpc->haveConnection()) - return noConnection(); + return; getInfoThenRefresh(force); } @@ -298,6 +300,7 @@ void Controller::processInfo(const json& info) void Controller::getInfoThenRefresh(bool force) { + qDebug()<< __func__; if (!zrpc->haveConnection()) return noConnection(); @@ -624,6 +627,7 @@ void Controller::setLag(int lag) void Controller::refreshAddresses() { + qDebug()<< __func__; if (!zrpc->haveConnection()) return noConnection(); @@ -876,6 +880,7 @@ void Controller::updateUIBalances() void Controller::refreshBalances() { + qDebug()<< __func__; if (!zrpc->haveConnection()) return noConnection(); @@ -929,6 +934,7 @@ void Controller::refreshBalances() } void Controller::refreshTransactions() { + qDebug()<< __func__; if (!zrpc->haveConnection()) return noConnection(); @@ -1544,6 +1550,7 @@ void Controller::executeTransaction(Tx tx, void Controller::checkForUpdate(bool silent) { + qDebug()<< __func__; // No checking for updates, needs testing with Gitea return; if (!zrpc->haveConnection()) @@ -1634,10 +1641,11 @@ void Controller::checkForUpdate(bool silent) // Get the hush->USD price from coinmarketcap using their API void Controller::refreshHUSHPrice() { + qDebug()<< __func__; if (!zrpc->haveConnection()) - return noConnection(); + return; - // TODO: use/render all this data + // TODO: use/render all this data QUrl cmcURL("https://api.coingecko.com/api/v3/simple/price?ids=hush&vs_currencies=btc%2Cusd%2Ceur%2Ceth%2Cgbp%2Ccny%2Cjpy%2Crub%2Ccad%2Csgd%2Cchf%2Cinr%2Caud%2Cinr&include_market_cap=true&include_24hr_vol=true&include_24hr_change=true"); QNetworkRequest req;