Show recipient list as detailedText of QMessageBox

pull/15886/head
Hennadii Stepanov 6 years ago
parent 654e419549
commit 2ee756f041
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

@ -279,18 +279,16 @@ void SendCoinsDialog::on_sendButton_clicked()
QStringList formatted; QStringList formatted;
for (const SendCoinsRecipient &rcp : currentTransaction.getRecipients()) for (const SendCoinsRecipient &rcp : currentTransaction.getRecipients())
{ {
// generate bold amount string with wallet name in case of multiwallet // generate amount string with wallet name in case of multiwallet
QString amount = "<b>" + BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount); QString amount = BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount);
if (model->isMultiwallet()) { if (model->isMultiwallet()) {
amount.append(" <u>"+tr("from wallet %1").arg(GUIUtil::HtmlEscape(model->getWalletName()))+"</u> "); amount.append(tr(" from wallet '%1'").arg(model->getWalletName()));
} }
amount.append("</b>");
// generate monospace address string // generate address string
QString address = "<span style='font-family: monospace;'>" + rcp.address; QString address = rcp.address;
address.append("</span>");
QString recipientElement; QString recipientElement;
recipientElement = "<br />";
#ifdef ENABLE_BIP70 #ifdef ENABLE_BIP70
if (!rcp.paymentRequest.IsInitialized()) // normal payment if (!rcp.paymentRequest.IsInitialized()) // normal payment
@ -298,7 +296,7 @@ void SendCoinsDialog::on_sendButton_clicked()
{ {
if(rcp.label.length() > 0) // label with address if(rcp.label.length() > 0) // label with address
{ {
recipientElement.append(tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.label))); recipientElement.append(tr("%1 to '%2'").arg(amount, rcp.label));
recipientElement.append(QString(" (%1)").arg(address)); recipientElement.append(QString(" (%1)").arg(address));
} }
else // just address else // just address
@ -309,7 +307,7 @@ void SendCoinsDialog::on_sendButton_clicked()
#ifdef ENABLE_BIP70 #ifdef ENABLE_BIP70
else if(!rcp.authenticatedMerchant.isEmpty()) // authenticated payment request else if(!rcp.authenticatedMerchant.isEmpty()) // authenticated payment request
{ {
recipientElement.append(tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.authenticatedMerchant))); recipientElement.append(tr("%1 to '%2'").arg(amount, rcp.authenticatedMerchant));
} }
else // unauthenticated payment request else // unauthenticated payment request
{ {
@ -323,7 +321,7 @@ void SendCoinsDialog::on_sendButton_clicked()
QString questionString = tr("Are you sure you want to send?"); QString questionString = tr("Are you sure you want to send?");
questionString.append("<br /><span style='font-size:10pt;'>"); questionString.append("<br /><span style='font-size:10pt;'>");
questionString.append(tr("Please, review your transaction.")); questionString.append(tr("Please, review your transaction."));
questionString.append("</span><br />%1"); questionString.append("</span>");
if(txFee > 0) if(txFee > 0)
{ {
@ -364,7 +362,7 @@ void SendCoinsDialog::on_sendButton_clicked()
questionString.append(QString("<br /><span style='font-size:10pt; font-weight:normal;'>(=%1)</span>") questionString.append(QString("<br /><span style='font-size:10pt; font-weight:normal;'>(=%1)</span>")
.arg(alternativeUnits.join(" " + tr("or") + " "))); .arg(alternativeUnits.join(" " + tr("or") + " ")));
SendConfirmationDialog confirmationDialog(tr("Confirm send coins"), questionString.arg(formatted.join("<br />")), "", "", SEND_CONFIRM_DELAY, this); SendConfirmationDialog confirmationDialog(tr("Confirm send coins"), questionString, "To review recipient list click \"Show Details...\"", formatted.join("\n\n"), SEND_CONFIRM_DELAY, this);
confirmationDialog.exec(); confirmationDialog.exec();
QMessageBox::StandardButton retval = static_cast<QMessageBox::StandardButton>(confirmationDialog.result()); QMessageBox::StandardButton retval = static_cast<QMessageBox::StandardButton>(confirmationDialog.result());

Loading…
Cancel
Save