Skip to content

Commit fb0507f

Browse files
committed
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.
1 parent af6e093 commit fb0507f

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
@@ -217,12 +217,19 @@ void SendCoinsDialog::on_sendButton_clicked()
217217
questionString.append("</span> ");
218218
questionString.append(tr("added as transaction fee"));
219219
}
220-
if(txFee > 0 || recipients.count() > 1)
220+
221+
// add total amount in all subdivision units
222+
questionString.append("<hr />");
223+
qint64 totalAmount = currentTransaction.getTotalTransactionAmount() + txFee;
224+
QStringList alternativeUnits;
225+
foreach(BitcoinUnits::Unit u, BitcoinUnits::availableUnits())
221226
{
222-
// add total amount string if there are more then one recipients or a fee is required
223-
questionString.append("<hr />");
224-
questionString.append(tr("Total Amount %1").arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), currentTransaction.getTotalTransactionAmount()+txFee)));
227+
if(u != model->getOptionsModel()->getDisplayUnit())
228+
alternativeUnits.append(BitcoinUnits::formatWithUnit(u, totalAmount));
225229
}
230+
questionString.append(tr("Total Amount %1 (= %2)")
231+
.arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount))
232+
.arg(alternativeUnits.join(" "+tr("or")+" ")));
226233

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

0 commit comments

Comments
 (0)