@@ -58,18 +58,19 @@ PinUnblock::PinUnblock(QSmartCardData::PinType type, QSmartCard::PinAction actio
5858 regexpValidateCode = pattern (QSmartCardData::PukType);
5959 ui->line1_text ->setText (tr (" To unblock the certificate you have to enter the PUK code." ));
6060 ui->line2_text ->setText (tr (" You can find your PUK code inside the ID-card codes envelope." ));
61- ui->line3_text ->setText (isPUKReplacable ? tr (" If you have forgotten the PUK code for your ID card, please visit "
62- " <a href=\" https://www.politsei.ee/en/\" >the Police and Border Guard Board service center</a> to obtain new PIN codes." ) :
63- tr (" If you have forgotten the PUK code of your ID-card then you can view it from the Police and Border Guard Board portal. "
64- " <a href=\" https://www.id.ee/en/article/my-pin-is-blocked-locked/\" >Additional information</a>" ));
61+ ui->line3_text ->setText (isPUKReplacable
62+ ? tr (" If you have forgotten the PUK code for your ID card, please visit "
63+ " <a href=\" https://www.politsei.ee/en/\" >the Police and Border Guard Board service center</a> to obtain new PIN codes." )
64+ : tr (" If you have forgotten the PUK code of your ID-card then you can view it from the Police and Border Guard Board portal. "
65+ " <a href=\" https://www.id.ee/en/article/my-pin-is-blocked-locked/\" >Additional information</a>" ));
6566 break ;
6667 case QSmartCard::ActivateWithPuk:
6768 case QSmartCard::ChangeWithPuk:
6869 ui->label ->setText (tr (" %1 code change" ).arg (QSmartCardData::typeString (type)));
6970 regexpValidateCode = pattern (QSmartCardData::PukType);
7071 ui->line1_text ->setText (type == QSmartCardData::Pin2Type
71- ? tr (" PIN2 code is used to digitally sign documents." )
72- : tr (" PIN1 code is used for confirming the identity of a person." ));
72+ ? tr (" PIN2 code is used to digitally sign documents." )
73+ : tr (" PIN1 code is used for confirming the identity of a person." ));
7374 ui->line2_text ->setText (tr (" If you have forgotten PIN%1, but know PUK, then here you can enter new PIN%1." ).arg (type));
7475 ui->line3_text ->setText (tr (" PUK code is written in the envelope, that is given with the ID-card." ));
7576 break ;
@@ -86,8 +87,8 @@ PinUnblock::PinUnblock(QSmartCardData::PinType type, QSmartCard::PinAction actio
8687 break ;
8788 }
8889 ui->line1_text ->setText (type == QSmartCardData::Pin2Type
89- ? tr (" PIN2 code is used to digitally sign documents." )
90- : tr (" PIN1 code is used for confirming the identity of a person." ));
90+ ? tr (" PIN2 code is used to digitally sign documents." )
91+ : tr (" PIN1 code is used for confirming the identity of a person." ));
9192 ui->line2_text ->setText (
9293 tr (" If %1 is inserted incorrectly 3 times the %2 certificate will be blocked and it will be impossible to use ID-card to %3, until it is unblocked via the PUK code." ).arg (
9394 QSmartCardData::typeString (type),
@@ -102,16 +103,16 @@ PinUnblock::PinUnblock(QSmartCardData::PinType type, QSmartCard::PinAction actio
102103 ui->repeat ->setValidator (new QRegularExpressionValidator (regexpNewCode, ui->repeat ));
103104 ui->puk ->setValidator (new QRegularExpressionValidator (regexpValidateCode, ui->puk ));
104105
105- auto setError = [](QLineEdit *input, QLabel *error, const QString &msg) {
106- input->setStyleSheet (msg.isEmpty () ? QString () : QStringLiteral (" border-color: #BE7884 " ));
106+ auto setError = [this ](LineEdit *input, QLabel *error, const QString &msg) {
107+ input->setLabel (msg.isEmpty () ? QString () : QStringLiteral (" error " ));
107108 error->setFocusPolicy (msg.isEmpty () ? Qt::NoFocus : Qt::TabFocus);
108109 error->setText (msg);
109110 error->setHidden (msg.isEmpty ());
110111 };
111112 if (leftAttempts < 3 )
112- setError (ui->puk , ui->errorPuk , action == QSmartCard::ChangeWithPin || action == QSmartCard::ActivateWithPin ?
113- tr (" Remaining attempts: %1" ).arg (leftAttempts) :
114- tr (" PUK remaining attempts: %1" ).arg (leftAttempts));
113+ setError (ui->puk , ui->errorPuk , action == QSmartCard::ChangeWithPin || action == QSmartCard::ActivateWithPin
114+ ? tr (" Remaining attempts: %1" ).arg (leftAttempts)
115+ : tr (" PUK remaining attempts: %1" ).arg (leftAttempts));
115116
116117 for (int i = 1 ; i < 4 ; i++)
117118 {
0 commit comments