aboutsummaryrefslogtreecommitdiff
path: root/src/qt/sendcoinsdialog.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-11-20 15:49:34 +0100
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2013-12-02 13:32:46 +0100
commit834e14e57f3c163bc898e6a89ce467d850ee4ea2 (patch)
tree12992c842598e6571d0202cd50a2efa38fa58232 /src/qt/sendcoinsdialog.cpp
parent9ab7a0609ee920b1095235bc7460c9c0b60acf29 (diff)
[Qt] coin-control features GUI cleanup 2
- remove monospace labels from sendcoinsdialog also - use a validated line edit for the change address - add a tooltip to change address switch - ensure we have a valid change address in CoinControlDialog::coinControl->destChange or just CNoDestination() - some small ui file changes
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
-rw-r--r--src/qt/sendcoinsdialog.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index 6c3535b2fb..73cfa27c83 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -529,16 +529,17 @@ void SendCoinsDialog::coinControlButtonClicked()
// Coin Control: checkbox custom change address
void SendCoinsDialog::coinControlChangeChecked(int state)
{
- if (model)
+ if (state == Qt::Unchecked)
{
- if (state == Qt::Checked)
- CoinControlDialog::coinControl->destChange = CBitcoinAddress(ui->lineEditCoinControlChange->text().toStdString()).Get();
- else
- CoinControlDialog::coinControl->destChange = CNoDestination();
+ CoinControlDialog::coinControl->destChange = CNoDestination();
+ ui->lineEditCoinControlChange->setValid(true);
+ ui->labelCoinControlChangeLabel->clear();
}
+ else
+ // use this to re-validate an already entered address
+ coinControlChangeEdited(ui->lineEditCoinControlChange->text());
ui->lineEditCoinControlChange->setEnabled((state == Qt::Checked));
- ui->labelCoinControlChangeLabel->setVisible((state == Qt::Checked));
}
// Coin Control: custom change address changed
@@ -554,6 +555,10 @@ void SendCoinsDialog::coinControlChangeEdited(const QString & text)
ui->labelCoinControlChangeLabel->setText("");
else if (!CBitcoinAddress(text.toStdString()).IsValid())
{
+ // invalid change address
+ CoinControlDialog::coinControl->destChange = CNoDestination();
+
+ ui->lineEditCoinControlChange->setValid(false);
ui->labelCoinControlChangeLabel->setStyleSheet("QLabel{color:red;}");
ui->labelCoinControlChangeLabel->setText(tr("Warning: Invalid Bitcoin address"));
}
@@ -571,6 +576,10 @@ void SendCoinsDialog::coinControlChangeEdited(const QString & text)
ui->labelCoinControlChangeLabel->setText(tr("(no label)"));
else
{
+ // unknown change address
+ CoinControlDialog::coinControl->destChange = CNoDestination();
+
+ ui->lineEditCoinControlChange->setValid(false);
ui->labelCoinControlChangeLabel->setStyleSheet("QLabel{color:red;}");
ui->labelCoinControlChangeLabel->setText(tr("Warning: Unknown change address"));
}