diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-11-20 15:56:51 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-01-29 14:15:55 +0100 |
commit | c78bd937017212c89c1c7aab07399cec5b6b3bdd (patch) | |
tree | 92129bb63c2b9bbb724c3a2b4ad643710484e3ea /src/qt/sendcoinsdialog.cpp | |
parent | aab8fc58c6e6dc6e0a104170bd2aa10dc1af5dea (diff) |
[Qt] extend validate line edit and btc address validator
- remove btc address length from address validator
- add an optional btc address check in validated line edit that defaults
to off and is used in GUIUtil::setupAddressWidget()
- an isAcceptable() check is added to validated line edit on focus out
which only kicks in, when a validator is used with that widget
- remove an isAcceptable() check from sendcoinsentry.cpp
- remove obsolete attributes from ui files, which are set by calling
GUIUtil::setupAddressWidget()
- move some more things to GUIUtil::setupAddressWidget() and remove them
from normal code e.g. placeholder text
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index b15f005646..e2d7dc9bd3 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -33,9 +33,8 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) : ui->clearButton->setIcon(QIcon()); ui->sendButton->setIcon(QIcon()); #endif -#if QT_VERSION >= 0x040700 - ui->lineEditCoinControlChange->setPlaceholderText(tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)")); -#endif + + GUIUtil::setupAddressWidget(ui->lineEditCoinControlChange, this); addEntry(); @@ -43,7 +42,6 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) : connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear())); // Coin Control - ui->lineEditCoinControlChange->setFont(GUIUtil::bitcoinAddressFont()); connect(ui->pushButtonCoinControl, SIGNAL(clicked()), this, SLOT(coinControlButtonClicked())); connect(ui->checkBoxCoinControlChange, SIGNAL(stateChanged(int)), this, SLOT(coinControlChangeChecked(int))); connect(ui->lineEditCoinControlChange, SIGNAL(textEdited(const QString &)), this, SLOT(coinControlChangeEdited(const QString &))); @@ -536,7 +534,6 @@ void SendCoinsDialog::coinControlChangeChecked(int state) if (state == Qt::Unchecked) { CoinControlDialog::coinControl->destChange = CNoDestination(); - ui->lineEditCoinControlChange->setValid(true); ui->labelCoinControlChangeLabel->clear(); } else @@ -563,7 +560,6 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text) } else if (!addr.IsValid()) // Invalid address { - ui->lineEditCoinControlChange->setValid(false); ui->labelCoinControlChangeLabel->setText(tr("Warning: Invalid Bitcoin address")); } else // Valid address @@ -573,7 +569,6 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text) addr.GetKeyID(keyid); if (!model->getPubKey(keyid, pubkey)) // Unknown change address { - ui->lineEditCoinControlChange->setValid(false); ui->labelCoinControlChangeLabel->setText(tr("Warning: Unknown change address")); } else // Known change address |