Skip to content

Commit a7bb85d

Browse files
authored
Update PUK messages (#1355)
IB-8375 Signed-off-by: Raul Metsma <[email protected]>
1 parent befc704 commit a7bb85d

File tree

13 files changed

+259
-304
lines changed

13 files changed

+259
-304
lines changed

client/Application.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ Application::Application( int &argc, char **argv )
312312
setWindowIcon(QIcon(QStringLiteral(":/images/Icon.svg")));
313313
if(QFile::exists(QStringLiteral("%1/%2.log").arg(QDir::tempPath(), applicationName())))
314314
qInstallMessageHandler(msgHandler);
315+
QPalette p = palette();
316+
p.setBrush(QPalette::Link, QBrush("#2F70B6"));
317+
p.setBrush(QPalette::LinkVisited, QBrush("#2F70B6"));
318+
setPalette(p);
315319

316320
#if defined(Q_OS_WIN)
317321
AllowSetForegroundWindow( ASFW_ANY );

client/QSmartCard.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ QSmartCard::ErrorType QSmartCard::pinChange(QSmartCardData::PinType type, QWidge
500500
if (!d->t.isPinpad())
501501
{
502502
p.reset(new PinUnblock(PinUnblock::PinChange, parent, type, d->t.retryCount(type), d->t.data(QSmartCardData::BirthDate).toDate(),
503-
d->t.data(QSmartCardData::Id).toString()));
503+
d->t.data(QSmartCardData::Id).toString(), d->t.isPUKReplacable()));
504504
if (!p->exec())
505505
return CancelError;
506506
oldPin = p->firstCodeText().toUtf8();
@@ -524,7 +524,7 @@ QSmartCard::ErrorType QSmartCard::pinUnblock(QSmartCardData::PinType type, bool
524524
if (!d->t.isPinpad())
525525
{
526526
p.reset(new PinUnblock(isForgotPin ? PinUnblock::ChangePinWithPuk : PinUnblock::UnBlockPinWithPuk, parent, type,
527-
d->t.retryCount(QSmartCardData::PukType), d->t.data(QSmartCardData::BirthDate).toDate(), d->t.data(QSmartCardData::Id).toString()));
527+
d->t.retryCount(QSmartCardData::PukType), d->t.data(QSmartCardData::BirthDate).toDate(), d->t.data(QSmartCardData::Id).toString(), d->t.isPUKReplacable()));
528528
if (!p->exec())
529529
return CancelError;
530530
puk = p->firstCodeText().toUtf8();

client/dialogs/PinUnblock.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <QtGui/QRegularExpressionValidator>
2626

2727
PinUnblock::PinUnblock(WorkMode mode, QWidget *parent, QSmartCardData::PinType type,
28-
short leftAttempts, QDate birthDate, const QString &personalCode)
28+
short leftAttempts, QDate birthDate, const QString &personalCode, bool isPUKReplacable)
2929
: QDialog(parent)
3030
, ui(new Ui::PinUnblock)
3131
{
@@ -58,9 +58,10 @@ PinUnblock::PinUnblock(WorkMode mode, QWidget *parent, QSmartCardData::PinType t
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(tr("If you have forgotten the PUK code for your ID card, please visit "
62-
"<a href=\"https://www.politsei.ee/en/\"><span style=\"color: #006EB5; text-decoration: none;\">"
63-
"the Police and Border Guard Board service center</span></a> to obtain new PIN codes."));
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>"));
6465
break;
6566
case PinUnblock::ChangePinWithPuk:
6667
ui->label->setText(tr("%1 code change").arg(QSmartCardData::typeString(type)));
@@ -78,8 +79,8 @@ PinUnblock::PinUnblock(WorkMode mode, QWidget *parent, QSmartCardData::PinType t
7879
if(type == QSmartCardData::PukType)
7980
{
8081
ui->line1_text->setText(tr("PUK code is used for unblocking the certificates, when PIN1 or PIN2 has been entered 3 times incorrectly."));
81-
ui->line2_text->setText(tr("If you forget the PUK code or the certificates remain blocked, you have to visit the <a href=\"https://www.politsei.ee/en/\">"
82-
"<span style=\"color: #006EB5; text-decoration: none;\">service center</span></a> to obtain new codes."));
82+
ui->line2_text->setText(tr("If you forget the PUK code or the certificates remain blocked, you have to visit the "
83+
"<a href=\"https://www.politsei.ee/en/\">service center</a> to obtain new codes."));
8384
break;
8485
}
8586
ui->line1_text->setText(type == QSmartCardData::Pin2Type
@@ -132,7 +133,7 @@ PinUnblock::PinUnblock(WorkMode mode, QWidget *parent, QSmartCardData::PinType t
132133
connect(ui->puk, &QLineEdit::textEdited, ui->errorPuk, [this, setError] {
133134
setError(ui->puk, ui->errorPuk, {});
134135
});
135-
connect(ui->change, &QPushButton::clicked, this, [=,
136+
connect(ui->change, &QPushButton::clicked, this, [=, this,
136137
regexpNewCode = std::move(regexpNewCode),
137138
regexpValidateCode = std::move(regexpValidateCode)] {
138139
const static QString SEQUENCE_ASCENDING = QStringLiteral("1234567890123456789012");

client/dialogs/PinUnblock.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
#include "QSmartCard.h"
2323

24-
#include <QtCore/QRegularExpression>
2524
#include <QDate>
2625
#include <QDialog>
2726

@@ -39,7 +38,7 @@ class PinUnblock final : public QDialog
3938
PinChange,
4039
};
4140
PinUnblock(WorkMode mode, QWidget *parent, QSmartCardData::PinType type,
42-
short leftAttempts, QDate birthDate, const QString &personalCode);
41+
short leftAttempts, QDate birthDate, const QString &personalCode, bool isPUKReplacable);
4342
~PinUnblock() final;
4443

4544
QString firstCodeText() const;

client/dialogs/SettingsDialog.ui

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,7 @@ background: none;
16941694
</property>
16951695
<property name="text">
16961696
<string>&lt;p&gt;Estonian ID-software is released by Information Systems's Authority&lt;br /&gt;
1697-
In case of questions please contact our support via &lt;a href=&quot;https://www.id.ee/en/id-help/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#006eb5;&quot;&gt;id.ee&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
1697+
In case of questions please contact our support via &lt;a href=&quot;https://www.id.ee/en/id-help/&quot;&gt;id.ee&lt;/a&gt;.&lt;/p&gt;
16981698
Additional licenses and components</string>
16991699
</property>
17001700
<property name="alignment">
@@ -1745,16 +1745,16 @@ background: none;
17451745
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
17461746
p, li { white-space: pre-wrap; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; }
17471747
&lt;/style&gt;&lt;/head&gt;&lt;body&gt;
1748-
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;Qt cross-platform application and UI framework&lt;/b&gt;&lt;br /&gt;GNU Lesser General Public License (LGPL) version 3&lt;br /&gt;&lt;a href=&quot;http://doc.qt.io/qt-6/licensing.html&quot; style=&quot; text-decoration: underline; color:#006eb5;&quot;&gt;http://doc.qt.io/qt-6/licensing.html&lt;/a&gt;&lt;/p&gt;
1749-
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;The OpenSSL project&lt;/b&gt;&lt;br /&gt;This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/)&lt;br /&gt;&lt;a href=&quot;https://www.openssl.org/source/apache-license-2.0.txt&quot; style=&quot; text-decoration: underline; color:#006eb5;&quot;&gt;https://www.openssl.org/source/apache-license-2.0.txt&lt;/a&gt; &lt;/p&gt;
1750-
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;OpenLDAP community developed LDAP software&lt;/b&gt;&lt;br /&gt;The OpenLDAP Public License&lt;br /&gt;&lt;a href=&quot;http://www.openldap.org/software/release/license.html&quot; style=&quot; text-decoration: underline; color:#006eb5;&quot;&gt;http://www.openldap.org/software/release/license.html&lt;/a&gt; &lt;/p&gt;
1751-
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;libdigidocpp&lt;/b&gt;&lt;br /&gt;GNU Lesser General Public License (LGPL) version 2.1&lt;br /&gt;&lt;a href=&quot;http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html&quot; style=&quot; text-decoration: underline; color:#006eb5;&quot;&gt;http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html&lt;/a&gt; &lt;/p&gt;
1752-
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;DigiDoc4 Client&lt;/b&gt;&lt;br /&gt;GNU Lesser General Public License (LGPL) version 2.1&lt;br /&gt;&lt;a href=&quot;http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html&quot; style=&quot; text-decoration: underline; color:#006eb5;&quot;&gt;http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html&lt;/a&gt; &lt;/p&gt;
1753-
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;zlib A Massively Spiffy Yet Delicately Unobtrusive Compression Library&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;http://zlib.net/zlib_license.html&quot; style=&quot; text-decoration: underline; color:#006eb5;&quot;&gt;http://zlib.net/zlib_license.html&lt;/a&gt; &lt;/p&gt;
1754-
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;libxml2 is an XML toolkit implemented in C&lt;/b&gt;&lt;br /&gt;MIT License&lt;br /&gt;&lt;a href=&quot;https://gitlab.gnome.org/GNOME/libxml2/-/blob/master/Copyright?ref_type=heads&quot; style=&quot; text-decoration: underline; color:#006eb5;&quot;&gt;https://gitlab.gnome.org/GNOME/libxml2/-/blob/master/Copyright?ref_type=heads&lt;/a&gt; &lt;/p&gt;
1755-
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;XML Security Library is a C library based on LibXML2&lt;/b&gt;&lt;br /&gt;MIT License&lt;br /&gt;&lt;a href=&quot;https://github.com/lsh123/xmlsec/blob/master/Copyright&quot; style=&quot; text-decoration: underline; color:#006eb5;&quot;&gt;https://github.com/lsh123/xmlsec/blob/master/Copyright&lt;/a&gt; &lt;/p&gt;
1756-
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;JSON for Modern C++&lt;/b&gt;&lt;br /&gt;MIT License&lt;br /&gt;&lt;a href=&quot;https://github.com/nlohmann/json/blob/develop/LICENSE.MIT&quot; style=&quot; text-decoration: underline; color:#006eb5;&quot;&gt;https://github.com/nlohmann/json/blob/develop/LICENSE.MIT&lt;/a&gt; &lt;/p&gt;
1757-
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;Roboto: Google’s signature family of fonts&lt;/b&gt;&lt;br /&gt;Apache Software License, Version 2.0&lt;br /&gt;&lt;a href=&quot;https://github.com/google/roboto/blob/master/LICENSE&quot; style=&quot; text-decoration: underline; color:#006eb5;&quot;&gt;https://github.com/google/roboto/blob/master/LICENSE&lt;/a&gt; &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1748+
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;Qt cross-platform application and UI framework&lt;/b&gt;&lt;br /&gt;GNU Lesser General Public License (LGPL) version 3&lt;br /&gt;&lt;a href=&quot;http://doc.qt.io/qt-6/licensing.html&quot;&gt;http://doc.qt.io/qt-6/licensing.html&lt;/a&gt;&lt;/p&gt;
1749+
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;The OpenSSL project&lt;/b&gt;&lt;br /&gt;This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/)&lt;br /&gt;&lt;a href=&quot;https://www.openssl.org/source/apache-license-2.0.txt&quot;&gt;https://www.openssl.org/source/apache-license-2.0.txt&lt;/a&gt; &lt;/p&gt;
1750+
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;OpenLDAP community developed LDAP software&lt;/b&gt;&lt;br /&gt;The OpenLDAP Public License&lt;br /&gt;&lt;a href=&quot;http://www.openldap.org/software/release/license.html&quot;&gt;http://www.openldap.org/software/release/license.html&lt;/a&gt; &lt;/p&gt;
1751+
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;libdigidocpp&lt;/b&gt;&lt;br /&gt;GNU Lesser General Public License (LGPL) version 2.1&lt;br /&gt;&lt;a href=&quot;http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html&quot;&gt;http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html&lt;/a&gt; &lt;/p&gt;
1752+
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;DigiDoc4 Client&lt;/b&gt;&lt;br /&gt;GNU Lesser General Public License (LGPL) version 2.1&lt;br /&gt;&lt;a href=&quot;http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html&quot;&gt;http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html&lt;/a&gt; &lt;/p&gt;
1753+
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;zlib A Massively Spiffy Yet Delicately Unobtrusive Compression Library&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;http://zlib.net/zlib_license.html&quot;&gt;http://zlib.net/zlib_license.html&lt;/a&gt; &lt;/p&gt;
1754+
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;libxml2 is an XML toolkit implemented in C&lt;/b&gt;&lt;br /&gt;MIT License&lt;br /&gt;&lt;a href=&quot;https://gitlab.gnome.org/GNOME/libxml2/-/blob/master/Copyright?ref_type=heads&quot;&gt;https://gitlab.gnome.org/GNOME/libxml2/-/blob/master/Copyright?ref_type=heads&lt;/a&gt; &lt;/p&gt;
1755+
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;XML Security Library is a C library based on LibXML2&lt;/b&gt;&lt;br /&gt;MIT License&lt;br /&gt;&lt;a href=&quot;https://github.com/lsh123/xmlsec/blob/master/Copyright&quot;&gt;https://github.com/lsh123/xmlsec/blob/master/Copyright&lt;/a&gt; &lt;/p&gt;
1756+
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;JSON for Modern C++&lt;/b&gt;&lt;br /&gt;MIT License&lt;br /&gt;&lt;a href=&quot;https://github.com/nlohmann/json/blob/develop/LICENSE.MIT&quot;&gt;https://github.com/nlohmann/json/blob/develop/LICENSE.MIT&lt;/a&gt; &lt;/p&gt;
1757+
&lt;p align=&quot;center&quot;&gt;&lt;b&gt;Roboto: Google’s signature family of fonts&lt;/b&gt;&lt;br /&gt;Apache Software License, Version 2.0&lt;br /&gt;&lt;a href=&quot;https://github.com/google/roboto/blob/master/LICENSE&quot;&gt;https://github.com/google/roboto/blob/master/LICENSE&lt;/a&gt; &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
17581758
</property>
17591759
<property name="textInteractionFlags">
17601760
<set>Qt::TextBrowserInteraction</set>

client/dialogs/SignatureDialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ SignatureDialog::SignatureDialog(const DigiDocSignature &signature, QWidget *par
4141
d->error->hide();
4242
connect(d->showErrors, &AccordionTitle::toggled, d->showRole, [this](bool open) {
4343
d->showRole->setChecked(!open);
44-
d->error->setVisible(open);
44+
d->error->setVisible(open && !d->showErrors->isHidden());
4545
});
4646
connect(d->showRole, &AccordionTitle::toggled, d->showErrors, [this](bool open) {
4747
d->showErrors->setChecked(!open);

0 commit comments

Comments
 (0)