aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-11-17 14:43:23 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2013-11-17 14:43:23 +0100
commitfb0507fe4b3ff733386c8e3580032cfc965eec17 (patch)
tree01af217a814f3c609504c522a385c8704bd844e4 /src
parentaf6e093f062548d850b6eb510240aeb1ff24e2a3 (diff)
qt: show all units in send confirmation
Make users accustomed to the other subdivision units (mBTC, muBTC) by showing the total amount in all units in the confirmation dialog. This was recently raised on the mailing list and could be a preparation for switching over the default unit eventually.
Diffstat (limited to 'src')
-rw-r--r--src/qt/sendcoinsdialog.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index 71a1eb7618..0ec210d181 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -217,12 +217,19 @@ void SendCoinsDialog::on_sendButton_clicked()
questionString.append("</span> ");
questionString.append(tr("added as transaction fee"));
}
- if(txFee > 0 || recipients.count() > 1)
+
+ // add total amount in all subdivision units
+ questionString.append("<hr />");
+ qint64 totalAmount = currentTransaction.getTotalTransactionAmount() + txFee;
+ QStringList alternativeUnits;
+ foreach(BitcoinUnits::Unit u, BitcoinUnits::availableUnits())
{
- // add total amount string if there are more then one recipients or a fee is required
- questionString.append("<hr />");
- questionString.append(tr("Total Amount %1").arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), currentTransaction.getTotalTransactionAmount()+txFee)));
+ if(u != model->getOptionsModel()->getDisplayUnit())
+ alternativeUnits.append(BitcoinUnits::formatWithUnit(u, totalAmount));
}
+ questionString.append(tr("Total Amount %1 (= %2)")
+ .arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount))
+ .arg(alternativeUnits.join(" "+tr("or")+" ")));
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm send coins"),
questionString.arg(formatted.join("<br />")),