Skip to content

Commit f08a385

Browse files
committed
[qt]: changes sendcoinsdialog's box layout for improved readability.
[qt]: extracts html tags from translator. [qt]: removes missed tr() call.
1 parent 6b824c0 commit f08a385

File tree

1 file changed

+29
-22
lines changed

1 file changed

+29
-22
lines changed

src/qt/sendcoinsdialog.cpp

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -288,44 +288,60 @@ void SendCoinsDialog::on_sendButton_clicked()
288288
address.append("</span>");
289289

290290
QString recipientElement;
291+
recipientElement = "<br />";
291292

292293
if (!rcp.paymentRequest.IsInitialized()) // normal payment
293294
{
294295
if(rcp.label.length() > 0) // label with address
295296
{
296-
recipientElement = tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.label));
297+
recipientElement.append(tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.label)));
297298
recipientElement.append(QString(" (%1)").arg(address));
298299
}
299300
else // just address
300301
{
301-
recipientElement = tr("%1 to %2").arg(amount, address);
302+
recipientElement.append(tr("%1 to %2").arg(amount, address));
302303
}
303304
}
304305
else if(!rcp.authenticatedMerchant.isEmpty()) // authenticated payment request
305306
{
306-
recipientElement = tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.authenticatedMerchant));
307+
recipientElement.append(tr("%1 to %2").arg(amount, GUIUtil::HtmlEscape(rcp.authenticatedMerchant)));
307308
}
308309
else // unauthenticated payment request
309310
{
310-
recipientElement = tr("%1 to %2").arg(amount, address);
311+
recipientElement.append(tr("%1 to %2").arg(amount, address));
311312
}
312313

313314
formatted.append(recipientElement);
314315
}
315316

316317
QString questionString = tr("Are you sure you want to send?");
317-
questionString.append("<br /><br />%1");
318+
questionString.append("<br /><span style='font-size:10pt;'>");
319+
questionString.append(tr("Please, review your transaction."));
320+
questionString.append("</span><br />%1");
318321

319322
if(txFee > 0)
320323
{
321324
// append fee string if a fee is required
322-
questionString.append("<hr /><span style='color:#aa0000;'>");
323-
questionString.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
324-
questionString.append("</span> ");
325-
questionString.append(tr("added as transaction fee"));
325+
questionString.append("<hr /><b>");
326+
questionString.append(tr("Transaction fee"));
327+
questionString.append("</b>");
326328

327329
// append transaction size
328-
questionString.append(" (" + QString::number((double)currentTransaction.getTransactionSize() / 1000) + " kB)");
330+
questionString.append(" (" + QString::number((double)currentTransaction.getTransactionSize() / 1000) + " kB): ");
331+
332+
// append transaction fee value
333+
questionString.append("<span style='color:#aa0000; font-weight:bold;'>");
334+
questionString.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
335+
questionString.append("</span><br />");
336+
337+
// append RBF message according to transaction's signalling
338+
questionString.append("<span style='font-size:10pt; font-weight:normal;'>");
339+
if (ui->optInRBF->isChecked()) {
340+
questionString.append(tr("You can increase the fee later (signals Replace-By-Fee, BIP-125)."));
341+
} else {
342+
questionString.append(tr("Not signalling Replace-By-Fee, BIP-125."));
343+
}
344+
questionString.append("</span>");
329345
}
330346

331347
// add total amount in all subdivision units
@@ -337,19 +353,10 @@ void SendCoinsDialog::on_sendButton_clicked()
337353
if(u != model->getOptionsModel()->getDisplayUnit())
338354
alternativeUnits.append(BitcoinUnits::formatHtmlWithUnit(u, totalAmount));
339355
}
340-
questionString.append(tr("Total Amount %1")
356+
questionString.append(QString("<b>%1</b>: <b>%2</b>").arg(tr("Total Amount"))
341357
.arg(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount)));
342-
questionString.append(QString("<span style='font-size:10pt;font-weight:normal;'><br />(=%1)</span>")
343-
.arg(alternativeUnits.join(" " + tr("or") + "<br />")));
344-
345-
questionString.append("<hr /><span>");
346-
if (ui->optInRBF->isChecked()) {
347-
questionString.append(tr("You can increase the fee later (signals Replace-By-Fee, BIP-125)."));
348-
} else {
349-
questionString.append(tr("Not signalling Replace-By-Fee, BIP-125."));
350-
}
351-
questionString.append("</span>");
352-
358+
questionString.append(QString("<br /><span style='font-size:10pt; font-weight:normal;'>(=%1)</span>")
359+
.arg(alternativeUnits.join(" " + tr("or") + " ")));
353360

354361
SendConfirmationDialog confirmationDialog(tr("Confirm send coins"),
355362
questionString.arg(formatted.join("<br />")), SEND_CONFIRM_DELAY, this);

0 commit comments

Comments
 (0)