Skip to content

Commit

Permalink
Reset errors aftre editing and add tab focus (open-eid#1179)
Browse files Browse the repository at this point in the history
IB-7659, IB-7660

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored Apr 27, 2023
1 parent f4996a0 commit e512bee
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/dialogs/MobileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,16 @@ MobileDialog::MobileDialog(QWidget *parent) :
};
connect(ui->idCode, &QLineEdit::returnPressed, ui->sign, &QPushButton::click);
connect(ui->idCode, &QLineEdit::textEdited, this, saveSettings);
connect(ui->idCode, &QLineEdit::textEdited, ui->errorCode, [this] {
ui->errorCode->clear();
ui->idCode->setStyleSheet({});
});
connect(ui->phoneNo, &QLineEdit::returnPressed, ui->sign, &QPushButton::click);
connect(ui->phoneNo, &QLineEdit::textEdited, this, saveSettings);
connect(ui->phoneNo, &QLineEdit::textEdited, ui->errorPhone, [this] {
ui->errorPhone->clear();
ui->phoneNo->setStyleSheet({});
});
connect(ui->cbRemember, &QCheckBox::clicked, this, saveSettings);
connect(ui->sign, &QPushButton::clicked, this, [this] {
if(!IKValidator::isValid(idCode()))
Expand Down
6 changes: 6 additions & 0 deletions client/dialogs/MobileDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ background-color: #BEDBED;
<pointsize>12</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -200,6 +203,9 @@ background-color: #BEDBED;
<pointsize>12</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
</widget>
</item>
<item>
Expand Down
12 changes: 12 additions & 0 deletions client/dialogs/PinUnblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,20 @@ PinUnblock::PinUnblock(WorkMode mode, QWidget *parent, QSmartCardData::PinType t
connect(ui->cancel, &QPushButton::clicked, this, &PinUnblock::reject);
connect(this, &PinUnblock::finished, this, &PinUnblock::close);
connect(ui->pin, &QLineEdit::returnPressed, ui->change, &QPushButton::click);
connect(ui->pin, &QLineEdit::textEdited, ui->errorPin, [this] {
ui->errorPin->clear();
ui->pin->setStyleSheet({});
});
connect(ui->repeat, &QLineEdit::returnPressed, ui->change, &QPushButton::click);
connect(ui->repeat, &QLineEdit::textEdited, ui->errorRepeat, [this] {
ui->errorRepeat->clear();
ui->repeat->setStyleSheet({});
});
connect(ui->puk, &QLineEdit::returnPressed, ui->change, &QPushButton::click);
connect(ui->puk, &QLineEdit::textEdited, ui->errorPuk, [this] {
ui->errorPuk->clear();
ui->puk->setStyleSheet({});
});
connect(ui->change, &QPushButton::clicked, this, [=] {
const static QString SEQUENCE_ASCENDING = QStringLiteral("1234567890123456789012");
const static QString SEQUENCE_DESCENDING = QStringLiteral("0987654321098765432109");
Expand Down
9 changes: 9 additions & 0 deletions client/dialogs/PinUnblock.ui
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ line-height: 24px;</string>
<pointsize>12</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">color: #c53e3e</string>
</property>
Expand Down Expand Up @@ -410,6 +413,9 @@ line-height: 24px;</string>
<pointsize>12</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">color: #c53e3e</string>
</property>
Expand Down Expand Up @@ -473,6 +479,9 @@ line-height: 24px;</string>
<pointsize>12</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="styleSheet">
<string notr="true">color: #c53e3e</string>
</property>
Expand Down
4 changes: 4 additions & 0 deletions client/dialogs/SmartIDDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ SmartIDDialog::SmartIDDialog(QWidget *parent)
};
connect(ui->idCode, &QLineEdit::returnPressed, ui->sign, &QPushButton::click);
connect(ui->idCode, &QLineEdit::textEdited, this, saveSettings);
connect(ui->idCode, &QLineEdit::textEdited, ui->errorCode, [this] {
ui->errorCode->clear();
ui->idCode->setStyleSheet({});
});
connect(ui->idCountry, &QComboBox::currentTextChanged, this, saveSettings);
connect(ui->cbRemember, &QCheckBox::clicked, this, saveSettings);
connect(ui->cancel, &QPushButton::clicked, this, &QDialog::reject);
Expand Down
3 changes: 3 additions & 0 deletions client/dialogs/SmartIDDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ image: url(:/images/icon_checkbox_check.png);
<pointsize>12</pointsize>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
</widget>
</item>
<item>
Expand Down

0 comments on commit e512bee

Please sign in to comment.