Skip to content

Commit a665ae0

Browse files
committed
Do not mention unblocking if PUK is blocked
IB-8873 Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent 97ff946 commit a665ae0

6 files changed

Lines changed: 44 additions & 2 deletions

File tree

client/MainWindow.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,12 +704,14 @@ void MainWindow::updateMyEid(const QSmartCardData &data)
704704
return;
705705
bool pin1Blocked = data.retryCount(QSmartCardData::Pin1Type) == 0;
706706
bool pin2Blocked = data.retryCount(QSmartCardData::Pin2Type) == 0;
707+
bool pukBlocked = data.retryCount(QSmartCardData::PukType) == 0;
707708
bool pin1Locked = data.pinLocked(QSmartCardData::Pin1Type);
708709
bool pin2Locked = data.pinLocked(QSmartCardData::Pin2Type);
710+
bool isPUKReplacable = data.isPUKReplacable();
709711
ui->myEid->warningIcon(
710712
pin1Blocked || pin1Locked ||
711713
pin2Blocked || pin2Locked ||
712-
data.retryCount(QSmartCardData::PukType) == 0);
714+
pukBlocked);
713715
ui->signContainerPage->cardChanged(data.signCert(), pin2Blocked || pin2Locked);
714716
ui->cryptoContainerPage->cardChanged(data.authCert(), pin1Blocked || pin1Locked);
715717

@@ -718,13 +720,17 @@ void MainWindow::updateMyEid(const QSmartCardData &data)
718720
ui->warnings->showWarning({LockedCardWarning});
719721
else
720722
{
721-
if(pin1Blocked)
723+
if(pin1Blocked && pukBlocked)
724+
ui->warnings->showWarning({isPUKReplacable ? Pin1PukBlockedResetWarning : Pin1PukBlockedWarning});
725+
else if(pin1Blocked)
722726
ui->warnings->showWarning({UnblockPin1Warning, 0,
723727
[this]{ changePinClicked(QSmartCardData::Pin1Type, QSmartCard::UnblockWithPuk); }});
724728

725729
if(pin2Locked && pin2Blocked)
726730
ui->warnings->showWarning({ActivatePin2WithPUKWarning, 0,
727731
[this]{ changePinClicked(QSmartCardData::Pin2Type, QSmartCard::ActivateWithPuk); }});
732+
else if(pin2Blocked && pukBlocked)
733+
ui->warnings->showWarning({isPUKReplacable ? Pin2PukBlockedResetWarning : Pin2PukBlockedWarning});
728734
else if(pin2Blocked)
729735
ui->warnings->showWarning({UnblockPin2Warning, 0,
730736
[this]{ changePinClicked(QSmartCardData::Pin2Type, QSmartCard::UnblockWithPuk); }});

client/translations/en.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,6 +3040,10 @@ Additional licenses and components</translation>
30403040
<source>Certificates expire soon!</source>
30413041
<translation>Certificates expire soon!</translation>
30423042
</message>
3043+
<message>
3044+
<source>https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/</source>
3045+
<translation>https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/</translation>
3046+
</message>
30433047
<message>
30443048
<source>Additional information</source>
30453049
<translation>Additional information</translation>

client/translations/et.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,6 +3040,10 @@ Täiendavad litsentsid ja komponendid</translation>
30403040
<source>Certificates have expired!</source>
30413041
<translation>Sertifikaadid on aegunud!</translation>
30423042
</message>
3043+
<message>
3044+
<source>https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/</source>
3045+
<translation>https://www.politsei.ee/et/juhend/id-kaardi-taotlemine-taeiskasvanule/id-kaardi-kasutaja-meelespea/</translation>
3046+
</message>
30433047
<message>
30443048
<source>Additional information</source>
30453049
<translation>Lisainfo</translation>

client/translations/ru.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,6 +3045,10 @@ Additional licenses and components</source>
30453045
<source>Certificates expire soon!</source>
30463046
<translation>Срок действия сертификатов скоро истекает!</translation>
30473047
</message>
3048+
<message>
3049+
<source>https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/</source>
3050+
<translation>https://www.politsei.ee/ru/instruktsii/hodataystvo-o-vydache-id-karty-vzroslomu/pamyatka-dlya-polzovatelya-id-karti/</translation>
3051+
</message>
30483052
<message>
30493053
<source>Additional information</source>
30503054
<translation>Дополнительная информация</translation>

client/widgets/WarningItem.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,26 @@ void WarningItem::lookupWarning()
8585
url = tr("https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/");
8686
_page = MyEid;
8787
break;
88+
case Pin1PukBlockedWarning:
89+
ui->warningText->setText(VerifyCert::tr("PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.").arg(1));
90+
url = tr("https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/");
91+
_page = MyEid;
92+
break;
93+
case Pin1PukBlockedResetWarning:
94+
ui->warningText->setText(VerifyCert::tr("PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.").arg(1));
95+
url = tr("https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/");
96+
_page = MyEid;
97+
break;
98+
case Pin2PukBlockedWarning:
99+
ui->warningText->setText(VerifyCert::tr("PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.").arg(2));
100+
url = tr("https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/");
101+
_page = MyEid;
102+
break;
103+
case Pin2PukBlockedResetWarning:
104+
ui->warningText->setText(VerifyCert::tr("PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.").arg(2));
105+
url = tr("https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/");
106+
_page = MyEid;
107+
break;
88108
case ActivatePin1WithPUKWarning:
89109
case UnblockPin1Warning:
90110
ui->warningText->setText(QStringLiteral("%1 %2").arg(

client/widgets/WarningItem.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ struct WarningText {
3131

3232
CertExpiredError,
3333
CertExpiryWarning,
34+
Pin1PukBlockedWarning,
35+
Pin1PukBlockedResetWarning,
36+
Pin2PukBlockedWarning,
37+
Pin2PukBlockedResetWarning,
3438
UnblockPin1Warning,
3539
UnblockPin2Warning,
3640
ActivatePin2Warning,

0 commit comments

Comments
 (0)