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.
This commit is contained in:
parent
af6e093f06
commit
fb0507fe4b
1 changed files with 11 additions and 4 deletions
|
@ -217,12 +217,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 />")),
|
||||||
|
|
Loading…
Reference in a new issue