Changeset View
Changeset View
Standalone View
Standalone View
src/qt/sendcoinsdialog.cpp
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#if defined(HAVE_CONFIG_H) | |||||
#include <config/bitcoin-config.h> | |||||
#endif | |||||
#include <qt/forms/ui_sendcoinsdialog.h> | #include <qt/forms/ui_sendcoinsdialog.h> | ||||
#include <qt/sendcoinsdialog.h> | #include <qt/sendcoinsdialog.h> | ||||
#include <chainparams.h> | #include <chainparams.h> | ||||
#include <interfaces/node.h> | #include <interfaces/node.h> | ||||
#include <key_io.h> | #include <key_io.h> | ||||
#include <qt/addresstablemodel.h> | #include <qt/addresstablemodel.h> | ||||
#include <qt/bitcoinunits.h> | #include <qt/bitcoinunits.h> | ||||
▲ Show 20 Lines • Show All 291 Lines • ▼ Show 20 Lines | for (const SendCoinsRecipient &rcp : currentTransaction.getRecipients()) { | ||||
// 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 />"; | recipientElement = "<br />"; | ||||
#ifdef ENABLE_BIP70 | |||||
// normal payment | // normal payment | ||||
if (!rcp.paymentRequest.IsInitialized()) { | if (!rcp.paymentRequest.IsInitialized()) | ||||
#endif | |||||
{ | |||||
if (rcp.label.length() > 0) { | if (rcp.label.length() > 0) { | ||||
// label with address | // label with address | ||||
recipientElement.append( | 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.append(tr("%1 to %2").arg(amount, address)); | recipientElement.append(tr("%1 to %2").arg(amount, address)); | ||||
} | } | ||||
} else if (!rcp.authenticatedMerchant.isEmpty()) { | } | ||||
#ifdef ENABLE_BIP70 | |||||
// authenticated payment request | // authenticated payment request | ||||
else if (!rcp.authenticatedMerchant.isEmpty()) { | |||||
recipientElement.append( | 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.append(tr("%1 to %2").arg(amount, address)); | recipientElement.append(tr("%1 to %2").arg(amount, address)); | ||||
} | } | ||||
#endif | |||||
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 /><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><br />%1"); | ||||
▲ Show 20 Lines • Show All 613 Lines • Show Last 20 Lines |