Changeset View
Changeset View
Standalone View
Standalone View
src/qt/sendcoinsentry.cpp
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | #endif | ||||
connect(ui->payAmount, SIGNAL(valueChanged()), this, | connect(ui->payAmount, SIGNAL(valueChanged()), this, | ||||
SIGNAL(payAmountChanged())); | SIGNAL(payAmountChanged())); | ||||
connect(ui->checkboxSubtractFeeFromAmount, SIGNAL(toggled(bool)), this, | connect(ui->checkboxSubtractFeeFromAmount, SIGNAL(toggled(bool)), this, | ||||
SIGNAL(subtractFeeFromAmountChanged())); | SIGNAL(subtractFeeFromAmountChanged())); | ||||
connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked())); | connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked())); | ||||
connect(ui->deleteButton_is, SIGNAL(clicked()), this, | connect(ui->deleteButton_is, SIGNAL(clicked()), this, | ||||
SLOT(deleteClicked())); | SLOT(deleteClicked())); | ||||
connect(ui->deleteButton_s, SIGNAL(clicked()), this, SLOT(deleteClicked())); | connect(ui->deleteButton_s, SIGNAL(clicked()), this, SLOT(deleteClicked())); | ||||
connect(ui->useAvailableBalanceButton, SIGNAL(clicked()), this, | |||||
SLOT(useAvailableBalanceClicked())); | |||||
} | } | ||||
SendCoinsEntry::~SendCoinsEntry() { | SendCoinsEntry::~SendCoinsEntry() { | ||||
delete ui; | delete ui; | ||||
} | } | ||||
void SendCoinsEntry::on_pasteButton_clicked() { | void SendCoinsEntry::on_pasteButton_clicked() { | ||||
// Paste text from clipboard into recipient field | // Paste text from clipboard into recipient field | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | void SendCoinsEntry::clear() { | ||||
ui->payTo_s->clear(); | ui->payTo_s->clear(); | ||||
ui->memoTextLabel_s->clear(); | ui->memoTextLabel_s->clear(); | ||||
ui->payAmount_s->clear(); | ui->payAmount_s->clear(); | ||||
// update the display unit, to not use the default ("BCH") | // update the display unit, to not use the default ("BCH") | ||||
updateDisplayUnit(); | updateDisplayUnit(); | ||||
} | } | ||||
void SendCoinsEntry::checkSubtractFeeFromAmount() { | |||||
ui->checkboxSubtractFeeFromAmount->setChecked(true); | |||||
} | |||||
void SendCoinsEntry::deleteClicked() { | void SendCoinsEntry::deleteClicked() { | ||||
Q_EMIT removeEntry(this); | Q_EMIT removeEntry(this); | ||||
} | } | ||||
void SendCoinsEntry::useAvailableBalanceClicked() { | |||||
Q_EMIT useAvailableBalance(this); | |||||
} | |||||
bool SendCoinsEntry::validate() { | bool SendCoinsEntry::validate() { | ||||
if (!model) return false; | if (!model) { | ||||
return false; | |||||
} | |||||
// Check input validity | // Check input validity | ||||
bool retval = true; | bool retval = true; | ||||
// Skip checks for payment request | // Skip checks for payment request | ||||
if (recipient.paymentRequest.IsInitialized()) return retval; | if (recipient.paymentRequest.IsInitialized()) { | ||||
return retval; | |||||
} | |||||
if (!model->validateAddress(ui->payTo->text())) { | if (!model->validateAddress(ui->payTo->text())) { | ||||
ui->payTo->setValid(false); | ui->payTo->setValid(false); | ||||
retval = false; | retval = false; | ||||
} | } | ||||
if (!ui->payAmount->validate()) { | if (!ui->payAmount->validate()) { | ||||
retval = false; | retval = false; | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | void SendCoinsEntry::setValue(const SendCoinsRecipient &value) { | ||||
} | } | ||||
} | } | ||||
void SendCoinsEntry::setAddress(const QString &address) { | void SendCoinsEntry::setAddress(const QString &address) { | ||||
ui->payTo->setText(address); | ui->payTo->setText(address); | ||||
ui->payAmount->setFocus(); | ui->payAmount->setFocus(); | ||||
} | } | ||||
void SendCoinsEntry::setAmount(const Amount amount) { | |||||
ui->payAmount->setValue(amount); | |||||
} | |||||
bool SendCoinsEntry::isClear() { | bool SendCoinsEntry::isClear() { | ||||
return ui->payTo->text().isEmpty() && ui->payTo_is->text().isEmpty() && | return ui->payTo->text().isEmpty() && ui->payTo_is->text().isEmpty() && | ||||
ui->payTo_s->text().isEmpty(); | ui->payTo_s->text().isEmpty(); | ||||
} | } | ||||
void SendCoinsEntry::setFocus() { | void SendCoinsEntry::setFocus() { | ||||
ui->payTo->setFocus(); | ui->payTo->setFocus(); | ||||
} | } | ||||
Show All 26 Lines |