5#if defined(HAVE_CONFIG_H)
6#include <config/bitcoin-config.h>
9#include <qt/forms/ui_sendcoinsentry.h>
20#include <QApplication>
26 platformStyle(_platformStyle) {
29 ui->addressBookButton->setIcon(
31 ui->pasteButton->setIcon(
34 ui->deleteButton_is->setIcon(
36 ui->deleteButton_s->setIcon(
39 setCurrentWidget(
ui->SendCoins);
42 ui->payToLayout->setSpacing(4);
53 connect(
ui->checkboxSubtractFeeFromAmount, &QCheckBox::toggled,
this,
55 connect(
ui->deleteButton, &QPushButton::clicked,
this,
57 connect(
ui->deleteButton_is, &QPushButton::clicked,
this,
59 connect(
ui->deleteButton_s, &QPushButton::clicked,
this,
61 connect(
ui->useAvailableBalanceButton, &QPushButton::clicked,
this,
74 ui->payTo->setText(QApplication::clipboard()->text());
86 ui->payAmount->setFocus();
98 ui->messageTextLabel->setToolTip(
99 tr(
"A message that was attached to the %1 URI which will be stored "
100 "with the transaction for your reference. Note: This message "
101 "will not be sent over the Bitcoin network.")
102 .arg(QString::fromStdString(
117 ui->addAsLabel->clear();
118 ui->payAmount->clear();
119 ui->checkboxSubtractFeeFromAmount->setCheckState(Qt::Unchecked);
120 ui->messageTextLabel->clear();
121 ui->messageTextLabel->hide();
122 ui->messageLabel->hide();
124 ui->payTo_is->clear();
125 ui->memoTextLabel_is->clear();
126 ui->payAmount_is->clear();
128 ui->payTo_s->clear();
129 ui->memoTextLabel_s->clear();
130 ui->payAmount_s->clear();
137 ui->checkboxSubtractFeeFromAmount->setChecked(
true);
158 if (
recipient.paymentRequest.IsInitialized()) {
164 ui->payTo->setValid(
false);
168 if (!
ui->payAmount->validate()) {
174 ui->payAmount->setValid(
false);
182 ui->payAmount->setValid(
false);
192 if (
recipient.paymentRequest.IsInitialized()) {
203 (
ui->checkboxSubtractFeeFromAmount->checkState() == Qt::Checked);
209 QWidget::setTabOrder(prev,
ui->payTo);
210 QWidget::setTabOrder(
ui->payTo,
ui->addAsLabel);
211 QWidget *w =
ui->payAmount->setupTabChain(
ui->addAsLabel);
212 QWidget::setTabOrder(w,
ui->checkboxSubtractFeeFromAmount);
213 QWidget::setTabOrder(
ui->checkboxSubtractFeeFromAmount,
214 ui->addressBookButton);
215 QWidget::setTabOrder(
ui->addressBookButton,
ui->pasteButton);
216 QWidget::setTabOrder(
ui->pasteButton,
ui->deleteButton);
217 return ui->deleteButton;
225 if (
recipient.paymentRequest.IsInitialized()) {
231 ui->payAmount_is->setReadOnly(
true);
232 setCurrentWidget(
ui->SendCoins_UnauthenticatedPaymentRequest);
240 ui->payAmount_s->setReadOnly(
true);
241 setCurrentWidget(
ui->SendCoins_AuthenticatedPaymentRequest);
254 ui->addAsLabel->clear();
267 ui->payTo->setText(address);
268 ui->payAmount->setFocus();
272 ui->payAmount->setValue(amount);
276 return ui->payTo->text().isEmpty() &&
ui->payTo_is->text().isEmpty() &&
277 ui->payTo_s->text().isEmpty();
281 ui->payTo->setFocus();
287 ui->payAmount->setDisplayUnit(
289 ui->payAmount_is->setDisplayUnit(
291 ui->payAmount_s->setDisplayUnit(
302 QString associatedLabel =
304 if (!associatedLabel.isEmpty()) {
305 ui->addAsLabel->setText(associatedLabel);
Widget that shows a list of sending or receiving addresses.
@ ForSelection
Open address book to pick address.
void setModel(AddressTableModel *model)
const QString & getReturnValue() const
QString labelForAddress(const QString &address) const
Look up label for address in address book, if not found return empty string.
const std::string & CashAddrPrefix() const
int getDisplayUnit() const
void displayUnitChanged(int unit)
A single entry in the dialog for sending bitcoins.
bool updateLabel(const QString &address)
void setAmount(const Amount amount)
void setAddress(const QString &address)
bool isClear()
Return whether the entry is still empty and unedited.
void subtractFeeFromAmountChanged()
void useAvailableBalance(SendCoinsEntry *entry)
SendCoinsRecipient recipient
void setValue(const SendCoinsRecipient &value)
void on_payTo_textChanged(const QString &address)
void on_pasteButton_clicked()
void setModel(WalletModel *model)
void useAvailableBalanceClicked()
void removeEntry(SendCoinsEntry *entry)
SendCoinsEntry(const PlatformStyle *platformStyle, WalletModel *model, QWidget *parent=nullptr)
QWidget * setupTabChain(QWidget *prev)
Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://...
const PlatformStyle * platformStyle
void on_addressBookButton_clicked()
bool validate(interfaces::Node &node)
void checkSubtractFeeFromAmount()
SendCoinsRecipient getValue()
bool fSubtractFeeFromAmount
QString authenticatedMerchant
Interface to Bitcoin wallet from Qt view code.
bool validateAddress(const QString &address)
const CChainParams & getChainParams() const
AddressTableModel * getAddressTableModel()
OptionsModel * getOptionsModel()
Top-level interface for a bitcoin node (bitcoind process).
bool isDust(interfaces::Node &node, const QString &address, const Amount amount, const CChainParams &chainParams)
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
static constexpr Amount zero() noexcept