Changeset View
Changeset View
Standalone View
Standalone View
src/qt/sendcoinsdialog.cpp
Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | for (const SendCoinsRecipient &rcp : currentTransaction.getRecipients()) { | ||||
} | } | ||||
amount.append("</b>"); | amount.append("</b>"); | ||||
// generate monospace address string | // generate monospace address string | ||||
QString address = | QString address = | ||||
"<span style='font-family: monospace;'>" + rcp.address; | "<span style='font-family: monospace;'>" + rcp.address; | ||||
address.append("</span>"); | address.append("</span>"); | ||||
QString recipientElement; | QString recipientElement; | ||||
recipientElement = "<br />"; | |||||
// normal payment | // normal payment | ||||
if (!rcp.paymentRequest.IsInitialized()) { | if (!rcp.paymentRequest.IsInitialized()) { | ||||
if (rcp.label.length() > 0) { | if (rcp.label.length() > 0) { | ||||
// label with address | // label with address | ||||
recipientElement = | recipientElement.append( | ||||
tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.label)); | tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.label))); | ||||
recipientElement.append(QString(" (%1)").arg(address)); | recipientElement.append(QString(" (%1)").arg(address)); | ||||
} else { | } else { | ||||
// just address | // just address | ||||
recipientElement = tr("%1 to %2").arg(amount, address); | recipientElement.append(tr("%1 to %2").arg(amount, address)); | ||||
} | } | ||||
} else if (!rcp.authenticatedMerchant.isEmpty()) { | } else if (!rcp.authenticatedMerchant.isEmpty()) { | ||||
// authenticated payment request | // authenticated payment request | ||||
recipientElement = | recipientElement.append( | ||||
tr("%1 to %2") | tr("%1 to %2") | ||||
.arg(amount, | .arg(amount, | ||||
GUIUtil::HtmlEscape(rcp.authenticatedMerchant)); | GUIUtil::HtmlEscape(rcp.authenticatedMerchant))); | ||||
} else { | } else { | ||||
// unauthenticated payment request | // unauthenticated payment request | ||||
recipientElement = tr("%1 to %2").arg(amount, address); | recipientElement.append(tr("%1 to %2").arg(amount, address)); | ||||
} | } | ||||
formatted.append(recipientElement); | formatted.append(recipientElement); | ||||
} | } | ||||
QString questionString = tr("Are you sure you want to send?"); | QString questionString = tr("Are you sure you want to send?"); | ||||
questionString.append("<br /><br />%1"); | questionString.append("<br /><span style='font-size:10pt;'>"); | ||||
questionString.append(tr("Please, review your transaction.")); | |||||
questionString.append("</span><br />%1"); | |||||
if (txFee > Amount::zero()) { | if (txFee > Amount::zero()) { | ||||
// append fee string if a fee is required | // append fee string if a fee is required | ||||
questionString.append("<hr /><span style='color:#aa0000;'>"); | questionString.append("<hr /><b>"); | ||||
questionString.append(BitcoinUnits::formatHtmlWithUnit( | questionString.append(tr("Transaction fee")); | ||||
model->getOptionsModel()->getDisplayUnit(), txFee)); | questionString.append("</b>"); | ||||
questionString.append("</span> "); | |||||
questionString.append(tr("added as transaction fee")); | |||||
// append transaction size | // append transaction size | ||||
questionString.append( | questionString.append( | ||||
" (" + | " (" + | ||||
QString::number((double)currentTransaction.getTransactionSize() / | QString::number((double)currentTransaction.getTransactionSize() / | ||||
1000) + | 1000) + | ||||
" kB)"); | " kB): "); | ||||
// append transaction fee value | |||||
questionString.append( | |||||
"<span style='color:#aa0000; font-weight:bold;'>"); | |||||
questionString.append(BitcoinUnits::formatHtmlWithUnit( | |||||
model->getOptionsModel()->getDisplayUnit(), txFee)); | |||||
questionString.append("</span><br />"); | |||||
} | } | ||||
// add total amount in all subdivision units | // add total amount in all subdivision units | ||||
questionString.append("<hr />"); | questionString.append("<hr />"); | ||||
Amount totalAmount = currentTransaction.getTotalTransactionAmount() + txFee; | Amount totalAmount = currentTransaction.getTotalTransactionAmount() + txFee; | ||||
QStringList alternativeUnits; | QStringList alternativeUnits; | ||||
for (BitcoinUnits::Unit u : BitcoinUnits::availableUnits()) { | for (BitcoinUnits::Unit u : BitcoinUnits::availableUnits()) { | ||||
if (u != model->getOptionsModel()->getDisplayUnit()) { | if (u != model->getOptionsModel()->getDisplayUnit()) { | ||||
alternativeUnits.append( | alternativeUnits.append( | ||||
BitcoinUnits::formatHtmlWithUnit(u, totalAmount)); | BitcoinUnits::formatHtmlWithUnit(u, totalAmount)); | ||||
} | } | ||||
} | } | ||||
questionString.append( | questionString.append( | ||||
tr("Total Amount %1") | QString("<b>%1</b>: <b>%2</b>") | ||||
.arg(tr("Total Amount")) | |||||
.arg(BitcoinUnits::formatHtmlWithUnit( | .arg(BitcoinUnits::formatHtmlWithUnit( | ||||
model->getOptionsModel()->getDisplayUnit(), totalAmount))); | model->getOptionsModel()->getDisplayUnit(), totalAmount))); | ||||
questionString.append( | questionString.append( | ||||
QString("<span style='font-size:10pt;font-weight:normal;'><br " | QString("<br /><span style='font-size:10pt; " | ||||
"/>(=%1)</span>") | "font-weight:normal;'>(=%1)</span>") | ||||
.arg(alternativeUnits.join(" " + tr("or") + "<br />"))); | .arg(alternativeUnits.join(" " + tr("or") + " "))); | ||||
SendConfirmationDialog confirmationDialog( | SendConfirmationDialog confirmationDialog( | ||||
tr("Confirm send coins"), questionString.arg(formatted.join("<br />")), | tr("Confirm send coins"), questionString.arg(formatted.join("<br />")), | ||||
SEND_CONFIRM_DELAY, this); | SEND_CONFIRM_DELAY, this); | ||||
confirmationDialog.exec(); | confirmationDialog.exec(); | ||||
QMessageBox::StandardButton retval = | QMessageBox::StandardButton retval = | ||||
static_cast<QMessageBox::StandardButton>(confirmationDialog.result()); | static_cast<QMessageBox::StandardButton>(confirmationDialog.result()); | ||||
▲ Show 20 Lines • Show All 563 Lines • Show Last 20 Lines |