From 8ac86a8042f23e524f1f5245ada9ac7a1c2fc191 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Fri, 17 Jun 2016 16:35:07 +0300 Subject: Balance on UI updated by the signal --- src/libwalletqt/Wallet.cpp | 6 +++++- src/libwalletqt/Wallet.h | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 77901b0c..901075b6 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace { @@ -81,7 +82,10 @@ quint64 Wallet::unlockedBalance() const bool Wallet::refresh() { - return m_walletImpl->refresh(); + bool result = m_walletImpl->refresh(); + if (result) + emit updated(); + return result; } PendingTransaction *Wallet::createTransaction(const QString &dst_addr, quint64 amount) diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index 7d391429..f8263040 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -85,6 +85,9 @@ public: TransactionHistory * history(); // TODO: setListenter() when it implemented in API +signals: + void updated(); + private: Wallet(Bitmonero::Wallet *w, QObject * parent = 0); -- cgit v1.2.3