Browse Source

Add balances warning for syncing

import_zecw
adityapk00 5 years ago
parent
commit
37ab20fef6
  1. 5
      src/mainwindow.cpp
  2. 29
      src/mainwindow.ui
  3. 4
      src/rpc.cpp

5
src/mainwindow.cpp

@ -1018,6 +1018,8 @@ void MainWindow::exportKeys(QString addr) {
void MainWindow::setupBalancesTab() { void MainWindow::setupBalancesTab() {
ui->unconfirmedWarning->setVisible(false); ui->unconfirmedWarning->setVisible(false);
ui->lblSyncWarning->setVisible(false);
ui->lblSyncWarningReceive->setVisible(false);
// Double click on balances table // Double click on balances table
auto fnDoSendFrom = [=](const QString& addr, const QString& to = QString(), bool sendMax = false) { auto fnDoSendFrom = [=](const QString& addr, const QString& to = QString(), bool sendMax = false) {
@ -1275,11 +1277,12 @@ void MainWindow::setupRecieveTab() {
// Connect t-addr radio button // Connect t-addr radio button
QObject::connect(ui->rdioTAddr, &QRadioButton::toggled, [=] (bool checked) { QObject::connect(ui->rdioTAddr, &QRadioButton::toggled, [=] (bool checked) {
// DEPRECATED
// Whenever the t-address is selected, we generate a new address, because we don't // Whenever the t-address is selected, we generate a new address, because we don't
// want to reuse t-addrs // want to reuse t-addrs
if (checked && this->rpc->getUTXOs() != nullptr) { if (checked && this->rpc->getUTXOs() != nullptr) {
updateTAddrCombo(checked); updateTAddrCombo(checked);
addNewTAddr(); //addNewTAddr();
} }
}); });

29
src/mainwindow.ui

@ -161,6 +161,19 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QLabel" name="lblSyncWarning">
<property name="styleSheet">
<string notr="true">color:red;</string>
</property>
<property name="text">
<string>Your node is still syncing, balances may not be updated</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="unconfirmedWarning"> <widget class="QLabel" name="unconfirmedWarning">
<property name="sizePolicy"> <property name="sizePolicy">
@ -346,8 +359,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>920</width> <width>928</width>
<height>301</height> <height>353</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="sendToLayout"> <layout class="QVBoxLayout" name="sendToLayout">
@ -819,6 +832,16 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QLabel" name="lblSyncWarningReceive">
<property name="styleSheet">
<string notr="true">color: red;</string>
</property>
<property name="text">
<string>Your node is still syncing, balances may not be updated</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer_5"> <spacer name="verticalSpacer_5">
<property name="orientation"> <property name="orientation">
@ -1022,7 +1045,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>968</width> <width>968</width>
<height>22</height> <height>19</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">

4
src/rpc.cpp

@ -639,6 +639,10 @@ void RPC::getInfoThenRefresh(bool force) {
")"; ")";
main->statusLabel->setText(statusText); 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); auto zecPrice = Settings::getUSDFormat(1);
QString tooltip; QString tooltip;
if (connections > 0) { if (connections > 0) {

Loading…
Cancel
Save