From 37ab20fef66b39175915f6b2120e350caa103257 Mon Sep 17 00:00:00 2001 From: adityapk00 Date: Wed, 1 May 2019 21:57:03 -0700 Subject: [PATCH] Add balances warning for syncing --- src/mainwindow.cpp | 5 ++++- src/mainwindow.ui | 29 ++++++++++++++++++++++++++--- src/rpc.cpp | 4 ++++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index cdf790a..54acf14 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1018,6 +1018,8 @@ void MainWindow::exportKeys(QString addr) { void MainWindow::setupBalancesTab() { ui->unconfirmedWarning->setVisible(false); + ui->lblSyncWarning->setVisible(false); + ui->lblSyncWarningReceive->setVisible(false); // Double click on balances table auto fnDoSendFrom = [=](const QString& addr, const QString& to = QString(), bool sendMax = false) { @@ -1275,11 +1277,12 @@ void MainWindow::setupRecieveTab() { // Connect t-addr radio button QObject::connect(ui->rdioTAddr, &QRadioButton::toggled, [=] (bool checked) { + // DEPRECATED // Whenever the t-address is selected, we generate a new address, because we don't // want to reuse t-addrs if (checked && this->rpc->getUTXOs() != nullptr) { updateTAddrCombo(checked); - addNewTAddr(); + //addNewTAddr(); } }); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index e0e7a31..88b9d5e 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -161,6 +161,19 @@ + + + + color:red; + + + Your node is still syncing, balances may not be updated + + + true + + + @@ -346,8 +359,8 @@ 0 0 - 920 - 301 + 928 + 353 @@ -819,6 +832,16 @@ + + + + color: red; + + + Your node is still syncing, balances may not be updated + + + @@ -1022,7 +1045,7 @@ 0 0 968 - 22 + 19 diff --git a/src/rpc.cpp b/src/rpc.cpp index 01f941d..1a4fb33 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -639,6 +639,10 @@ void RPC::getInfoThenRefresh(bool force) { ")"; main->statusLabel->setText(statusText); + // Update the balances view to show a warning if the node is still syncing + ui->lblSyncWarning->setVisible(isSyncing); + ui->lblSyncWarningReceive->setVisible(isSyncing); + auto zecPrice = Settings::getUSDFormat(1); QString tooltip; if (connections > 0) {