Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions client/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,14 @@ void MainWindow::updateMyEid(const QSmartCardData &data)
return;
bool pin1Blocked = data.retryCount(QSmartCardData::Pin1Type) == 0;
bool pin2Blocked = data.retryCount(QSmartCardData::Pin2Type) == 0;
bool pukBlocked = data.retryCount(QSmartCardData::PukType) == 0;
bool pin1Locked = data.pinLocked(QSmartCardData::Pin1Type);
bool pin2Locked = data.pinLocked(QSmartCardData::Pin2Type);
bool isPUKReplacable = data.isPUKReplacable();
ui->myEid->warningIcon(
pin1Blocked || pin1Locked ||
pin2Blocked || pin2Locked ||
data.retryCount(QSmartCardData::PukType) == 0);
pukBlocked);
ui->signContainerPage->cardChanged(data.signCert(), pin2Blocked || pin2Locked);
ui->cryptoContainerPage->cardChanged(data.authCert(), pin1Blocked || pin1Locked);

Expand All @@ -718,13 +720,17 @@ void MainWindow::updateMyEid(const QSmartCardData &data)
ui->warnings->showWarning({LockedCardWarning});
else
{
if(pin1Blocked)
if(pin1Blocked && pukBlocked)
ui->warnings->showWarning({isPUKReplacable ? Pin1PukBlockedResetWarning : Pin1PukBlockedWarning});
else if(pin1Blocked)
ui->warnings->showWarning({UnblockPin1Warning, 0,
[this]{ changePinClicked(QSmartCardData::Pin1Type, QSmartCard::UnblockWithPuk); }});

if(pin2Locked && pin2Blocked)
ui->warnings->showWarning({ActivatePin2WithPUKWarning, 0,
[this]{ changePinClicked(QSmartCardData::Pin2Type, QSmartCard::ActivateWithPuk); }});
else if(pin2Blocked && pukBlocked)
ui->warnings->showWarning({isPUKReplacable ? Pin2PukBlockedResetWarning : Pin2PukBlockedWarning});
else if(pin2Blocked)
ui->warnings->showWarning({UnblockPin2Warning, 0,
[this]{ changePinClicked(QSmartCardData::Pin2Type, QSmartCard::UnblockWithPuk); }});
Expand Down
4 changes: 4 additions & 0 deletions client/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3040,6 +3040,10 @@ Additional licenses and components</translation>
<source>Certificates expire soon!</source>
<translation>Certificates expire soon!</translation>
</message>
<message>
<source>https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/</source>
<translation>https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/</translation>
</message>
<message>
<source>Additional information</source>
<translation>Additional information</translation>
Expand Down
4 changes: 4 additions & 0 deletions client/translations/et.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3040,6 +3040,10 @@ Täiendavad litsentsid ja komponendid</translation>
<source>Certificates have expired!</source>
<translation>Sertifikaadid on aegunud!</translation>
</message>
<message>
<source>https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/</source>
<translation>https://www.politsei.ee/et/juhend/id-kaardi-taotlemine-taeiskasvanule/id-kaardi-kasutaja-meelespea/</translation>
</message>
<message>
<source>Additional information</source>
<translation>Lisainfo</translation>
Expand Down
4 changes: 4 additions & 0 deletions client/translations/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3045,6 +3045,10 @@ Additional licenses and components</source>
<source>Certificates expire soon!</source>
<translation>Срок действия сертификатов скоро истекает!</translation>
</message>
<message>
<source>https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/</source>
<translation>https://www.politsei.ee/ru/instruktsii/hodataystvo-o-vydache-id-karty-vzroslomu/pamyatka-dlya-polzovatelya-id-karti/</translation>
</message>
<message>
<source>Additional information</source>
<translation>Дополнительная информация</translation>
Expand Down
20 changes: 20 additions & 0 deletions client/widgets/WarningItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,26 @@ void WarningItem::lookupWarning()
url = tr("https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/");
_page = MyEid;
break;
case Pin1PukBlockedWarning:
ui->warningText->setText(VerifyCert::tr("PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.").arg(1));
url = tr("https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/");
_page = MyEid;
break;
case Pin1PukBlockedResetWarning:
ui->warningText->setText(VerifyCert::tr("PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.").arg(1));
url = tr("https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/");
_page = MyEid;
break;
case Pin2PukBlockedWarning:
ui->warningText->setText(VerifyCert::tr("PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.").arg(2));
url = tr("https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/");
_page = MyEid;
break;
case Pin2PukBlockedResetWarning:
ui->warningText->setText(VerifyCert::tr("PIN%1 has been blocked because PIN%1 code has been entered incorrectly 3 times.").arg(2));
url = tr("https://www.politsei.ee/en/instructions/applying-for-an-id-card-for-an-adult/reminders-for-id-card-holders/");
_page = MyEid;
break;
case ActivatePin1WithPUKWarning:
case UnblockPin1Warning:
ui->warningText->setText(QStringLiteral("%1 %2").arg(
Expand Down
4 changes: 4 additions & 0 deletions client/widgets/WarningItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ struct WarningText {

CertExpiredError,
CertExpiryWarning,
Pin1PukBlockedWarning,
Pin1PukBlockedResetWarning,
Pin2PukBlockedWarning,
Pin2PukBlockedResetWarning,
UnblockPin1Warning,
UnblockPin2Warning,
ActivatePin2Warning,
Expand Down
Loading