Fix no connection status on sync

This commit is contained in:
fekt
2022-11-01 22:09:48 -04:00
parent a9ad534241
commit e179e723f5

View File

@@ -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;