From e512bee6d4b9e724e59344d94751f4fcd3437006 Mon Sep 17 00:00:00 2001 From: Raul Metsma Date: Thu, 27 Apr 2023 09:45:56 +0300 Subject: [PATCH] Reset errors aftre editing and add tab focus (#1179) IB-7659, IB-7660 Signed-off-by: Raul Metsma --- client/dialogs/MobileDialog.cpp | 8 ++++++++ client/dialogs/MobileDialog.ui | 6 ++++++ client/dialogs/PinUnblock.cpp | 12 ++++++++++++ client/dialogs/PinUnblock.ui | 9 +++++++++ client/dialogs/SmartIDDialog.cpp | 4 ++++ client/dialogs/SmartIDDialog.ui | 3 +++ 6 files changed, 42 insertions(+) diff --git a/client/dialogs/MobileDialog.cpp b/client/dialogs/MobileDialog.cpp index 9665bf096..d218f1d89 100644 --- a/client/dialogs/MobileDialog.cpp +++ b/client/dialogs/MobileDialog.cpp @@ -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())) diff --git a/client/dialogs/MobileDialog.ui b/client/dialogs/MobileDialog.ui index 87ce69c44..ec938a779 100644 --- a/client/dialogs/MobileDialog.ui +++ b/client/dialogs/MobileDialog.ui @@ -162,6 +162,9 @@ background-color: #BEDBED; 12 + + Qt::TabFocus + @@ -200,6 +203,9 @@ background-color: #BEDBED; 12 + + Qt::TabFocus + diff --git a/client/dialogs/PinUnblock.cpp b/client/dialogs/PinUnblock.cpp index c5acb8a36..877714b12 100644 --- a/client/dialogs/PinUnblock.cpp +++ b/client/dialogs/PinUnblock.cpp @@ -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"); diff --git a/client/dialogs/PinUnblock.ui b/client/dialogs/PinUnblock.ui index 8deb034a6..0440567fc 100644 --- a/client/dialogs/PinUnblock.ui +++ b/client/dialogs/PinUnblock.ui @@ -335,6 +335,9 @@ line-height: 24px; 12 + + Qt::TabFocus + color: #c53e3e @@ -410,6 +413,9 @@ line-height: 24px; 12 + + Qt::TabFocus + color: #c53e3e @@ -473,6 +479,9 @@ line-height: 24px; 12 + + Qt::TabFocus + color: #c53e3e diff --git a/client/dialogs/SmartIDDialog.cpp b/client/dialogs/SmartIDDialog.cpp index 9b155f280..4f22b950d 100644 --- a/client/dialogs/SmartIDDialog.cpp +++ b/client/dialogs/SmartIDDialog.cpp @@ -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); diff --git a/client/dialogs/SmartIDDialog.ui b/client/dialogs/SmartIDDialog.ui index c3615f964..11ee14ab4 100644 --- a/client/dialogs/SmartIDDialog.ui +++ b/client/dialogs/SmartIDDialog.ui @@ -223,6 +223,9 @@ image: url(:/images/icon_checkbox_check.png); 12 + + Qt::TabFocus +