Browse Source

fix clear() (clear red/invalid status)

miguelfreitas
Wladimir J. van der Laan 14 years ago
parent
commit
73cd5e5212
  1. 6
      src/qt/bitcoinamountfield.cpp
  2. 2
      src/qt/bitcoinamountfield.h
  3. 6
      src/qt/qvalidatedlineedit.cpp
  4. 1
      src/qt/qvalidatedlineedit.h
  5. 2
      src/qt/sendcoinsentry.cpp

6
src/qt/bitcoinamountfield.cpp

@ -55,6 +55,12 @@ void BitcoinAmountField::setText(const QString &text)
} }
} }
void BitcoinAmountField::clear()
{
amount->clear();
decimals->clear();
}
bool BitcoinAmountField::validate() bool BitcoinAmountField::validate()
{ {
bool valid = true; bool valid = true;

2
src/qt/bitcoinamountfield.h

@ -18,6 +18,8 @@ public:
void setText(const QString &text); void setText(const QString &text);
QString text() const; QString text() const;
void clear();
bool validate(); bool validate();
// Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907) // Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907)
// Hence we have to set it up manually // Hence we have to set it up manually

6
src/qt/qvalidatedlineedit.cpp

@ -35,3 +35,9 @@ void QValidatedLineEdit::markValid()
{ {
setValid(true); setValid(true);
} }
void QValidatedLineEdit::clear()
{
setValid(true);
QLineEdit::clear();
}

1
src/qt/qvalidatedlineedit.h

@ -10,6 +10,7 @@ class QValidatedLineEdit : public QLineEdit
Q_OBJECT Q_OBJECT
public: public:
explicit QValidatedLineEdit(QWidget *parent = 0); explicit QValidatedLineEdit(QWidget *parent = 0);
void clear();
protected: protected:
void focusInEvent(QFocusEvent *evt); void focusInEvent(QFocusEvent *evt);

2
src/qt/sendcoinsentry.cpp

@ -68,7 +68,7 @@ void SendCoinsEntry::clear()
{ {
ui->payTo->clear(); ui->payTo->clear();
ui->addAsLabel->clear(); ui->addAsLabel->clear();
ui->payAmount->setText(QString()); ui->payAmount->clear();
ui->payTo->setFocus(); ui->payTo->setFocus();
} }

Loading…
Cancel
Save