diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index 5b30d99e560..fb2fc99bfe8 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -75,6 +75,30 @@ + + + + 3 + + + + + Balance: + + + + + + + 123.456 BTC + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 852d789805e..8954af47425 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -36,6 +36,9 @@ void SendCoinsDialog::setModel(WalletModel *model) entry->setModel(model); } } + + setBalance(model->getBalance(), model->getUnconfirmedBalance()); + connect(model, SIGNAL(balanceChanged(qint64, qint64)), this, SLOT(setBalance(qint64, qint64))); } SendCoinsDialog::~SendCoinsDialog() @@ -241,3 +244,10 @@ void SendCoinsDialog::handleURL(const QUrl *url) } pasteEntry(rv); } + +void SendCoinsDialog::setBalance(qint64 balance, qint64 unconfirmedBalance) +{ + Q_UNUSED(unconfirmedBalance); + int unit = model->getOptionsModel()->getDisplayUnit(); + ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance)); +} diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index 9c56e51811e..a14f99e8b2f 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -37,6 +37,7 @@ public slots: void accept(); SendCoinsEntry *addEntry(); void updateRemoveEnabled(); + void setBalance(qint64 balance, qint64 unconfirmedBalance); private: Ui::SendCoinsDialog *ui;