Skip to content

Commit be5d37c

Browse files
committed
Merge pull request #3273
fb0507f qt: show all units in send confirmation (Wladimir J. van der Laan)
2 parents 76cfa60 + fb0507f commit be5d37c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/qt/sendcoinsdialog.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,19 @@ void SendCoinsDialog::on_sendButton_clicked()
216216
questionString.append("</span> ");
217217
questionString.append(tr("added as transaction fee"));
218218
}
219-
if(txFee > 0 || recipients.count() > 1)
219+
220+
// add total amount in all subdivision units
221+
questionString.append("<hr />");
222+
qint64 totalAmount = currentTransaction.getTotalTransactionAmount() + txFee;
223+
QStringList alternativeUnits;
224+
foreach(BitcoinUnits::Unit u, BitcoinUnits::availableUnits())
220225
{
221-
// add total amount string if there are more then one recipients or a fee is required
222-
questionString.append("<hr />");
223-
questionString.append(tr("Total Amount %1").arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), currentTransaction.getTotalTransactionAmount()+txFee)));
226+
if(u != model->getOptionsModel()->getDisplayUnit())
227+
alternativeUnits.append(BitcoinUnits::formatWithUnit(u, totalAmount));
224228
}
229+
questionString.append(tr("Total Amount %1 (= %2)")
230+
.arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount))
231+
.arg(alternativeUnits.join(" "+tr("or")+" ")));
225232

226233
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm send coins"),
227234
questionString.arg(formatted.join("<br />")),

0 commit comments

Comments
 (0)