Merge pull request #3273

fb0507f qt: show all units in send confirmation (Wladimir J. van der Laan)
This commit is contained in:
Wladimir J. van der Laan 2013-11-22 05:42:22 +01:00
commit be5d37c597
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -216,12 +216,19 @@ void SendCoinsDialog::on_sendButton_clicked()
questionString.append("</span> "); questionString.append("</span> ");
questionString.append(tr("added as transaction fee")); 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 if(u != model->getOptionsModel()->getDisplayUnit())
questionString.append("<hr />"); alternativeUnits.append(BitcoinUnits::formatWithUnit(u, totalAmount));
questionString.append(tr("Total Amount %1").arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), currentTransaction.getTotalTransactionAmount()+txFee)));
} }
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"), QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm send coins"),
questionString.arg(formatted.join("<br />")), questionString.arg(formatted.join("<br />")),