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
4 changes: 2 additions & 2 deletions client/DigiDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ bool DigiDoc::sign(const QString &city, const QString &state, const QString &zip
return false;
}

QList<DigiDocSignature> DigiDoc::signatures() const
const QList<DigiDocSignature>& DigiDoc::signatures() const
{
return m_signatures;
}
Expand All @@ -733,7 +733,7 @@ ContainerState DigiDoc::state()
return containerState;
}

QList<DigiDocSignature> DigiDoc::timestamps() const
const QList<DigiDocSignature>& DigiDoc::timestamps() const
{
return m_timestamps;
}
4 changes: 2 additions & 2 deletions client/DigiDoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ class DigiDoc: public QObject
const QString &country,
const QString &role,
digidoc::Signer *signer);
QList<DigiDocSignature> signatures() const;
const QList<DigiDocSignature>& signatures() const;
ria::qdigidoc4::ContainerState state();
QList<DigiDocSignature> timestamps() const;
const QList<DigiDocSignature>& timestamps() const;

static QStringList parseException(const digidoc::Exception &e,
digidoc::Exception::ExceptionCode &code);
Expand Down
10 changes: 5 additions & 5 deletions client/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ void MainWindow::navigateToPage( Pages page, const QStringList &files, bool crea
selectPage(page);
}

void MainWindow::onSignAction(int action, const QString &info1, const QString &info2)
void MainWindow::onSignAction(int action, const QString &idCode, const QString &info2)
{
switch(action)
{
Expand All @@ -344,16 +344,16 @@ void MainWindow::onSignAction(int action, const QString &info1, const QString &i
});
break;
case SignatureMobile:
sign([this, info1, info2](const QString &city, const QString &state, const QString &zip, const QString &country, const QString &role) {
sign([this, idCode, info2](const QString &city, const QString &state, const QString &zip, const QString &country, const QString &role) {
MobileProgress m(this);
return m.init(info1, info2) &&
return m.init(idCode, info2) &&
digiDoc->sign(city, state, zip, country, role, &m);
});
break;
case SignatureSmartID:
sign([this, info1, info2](const QString &city, const QString &state, const QString &zip, const QString &country, const QString &role) {
sign([this, idCode, info2](const QString &city, const QString &state, const QString &zip, const QString &country, const QString &role) {
SmartIDProgress s(this);
return s.init(info1, info2, digiDoc->fileName()) &&
return s.init(info2, idCode, digiDoc->fileName()) &&
digiDoc->sign(city, state, zip, country, role, &s);
});
break;
Expand Down
2 changes: 1 addition & 1 deletion client/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class MainWindow final : public QWidget
void moveSignatureContainer();
void navigateToPage( ria::qdigidoc4::Pages page, const QStringList &files = QStringList(), bool create = true );
void onCryptoAction(int action, const QString &id, const QString &phone);
void onSignAction(int action, const QString &info1, const QString &info2);
void onSignAction(int action, const QString &idCode, const QString &info2);
void openContainer(bool signature);
void pageSelected(int page, bool checked = true);
void resetDigiDoc(DigiDoc *doc = nullptr, bool warnOnChange = true);
Expand Down
6 changes: 0 additions & 6 deletions client/Styles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ class FontDatabase
{
switch( font )
{
case Styles::Bold: return bold;
case Styles::Condensed: return condensed;
case Styles::CondensedBold: return condensedBold;
default: return regular;
}
}
Expand Down Expand Up @@ -129,12 +127,8 @@ class FontDatabase
};
#endif

QString bold = QFontDatabase::applicationFontFamilies(
QFontDatabase::addApplicationFont(QStringLiteral(":/fonts/Roboto-Bold.ttf"))).at(0);
QString condensed = QFontDatabase::applicationFontFamilies(
QFontDatabase::addApplicationFont(QStringLiteral(":/fonts/RobotoCondensed-Regular.ttf"))).at(0);
QString condensedBold = QFontDatabase::applicationFontFamilies(
QFontDatabase::addApplicationFont(QStringLiteral(":/fonts/RobotoCondensed-Bold.ttf"))).at(0);
QString regular = QFontDatabase::applicationFontFamilies(
QFontDatabase::addApplicationFont(QStringLiteral(":/fonts/Roboto-Regular.ttf"))).at(0);
#ifndef Q_OS_MAC
Expand Down
2 changes: 0 additions & 2 deletions client/Styles.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ class Styles
{
public:
enum Font {
Bold,
Condensed,
CondensedBold,
Regular
};

Expand Down
2 changes: 1 addition & 1 deletion client/dialogs/AddRecipients.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ AddRecipients::AddRecipients(ItemList* itemList, QWidget *parent)
connect(ldap_corp, &LdapSearch::error, this, &AddRecipients::showError);
connect(this, &AddRecipients::finished, this, &AddRecipients::close);

connect(ui->leftPane, &ItemList::addAll, this, [this] {
connect(ui->leftPane, &ItemList::add, this, [this] {
for(Item *item: ui->leftPane->items)
addRecipientToRightPane(item);
});
Expand Down
18 changes: 11 additions & 7 deletions client/dialogs/CertificateHistory.ui
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,16 @@ background-color: #FFFFFF;
<widget class="QTreeWidget" name="view">
<property name="styleSheet">
<string notr="true">#view {
border:none;
font-family: Roboto, Helvetica;
font-size: 12px;
color: #07142A;
}
QHeaderView::section {
border: 1px solid #D9D9D8;
border-width: 0px 0px 1px 0px;
padding-left: 5px;
height: 28px;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #FFFFFF, stop:1 #FFFFFF);
font-family: Roboto, Helvetica;
font-size: 14px;
border: none;
border-bottom: 1px solid #E7EAEF;
background-color: #FFFFFF;
}
QHeaderView::up-arrow,
QHeaderView::down-arrow {
Expand All @@ -91,6 +92,9 @@ QHeaderView::down-arrow {
padding-right: 5px;
}</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
Expand Down
4 changes: 2 additions & 2 deletions client/dialogs/MobileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ MobileDialog::MobileDialog(QWidget *parent)
Settings::MOBILEID_CODE = checked ? ui->idCode->text() : QString();
Settings::MOBILEID_NUMBER = checked ? ui->phoneNo->text() : QString();
};
auto setError = [](QLineEdit *input, QLabel *error, const QString &msg) {
input->setStyleSheet(msg.isEmpty() ? QString() : QStringLiteral("border-color: #BE7884"));
auto setError = [](LineEdit *input, QLabel *error, const QString &msg) {
input->setLabel(msg.isEmpty() ? QString() : QStringLiteral("error"));
error->setText(msg);
error->setHidden(msg.isEmpty());
};
Expand Down
11 changes: 10 additions & 1 deletion client/dialogs/MobileDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ background-color: white;
placeholder-text-color: #607496;
font-size: 16px;
}
QLineEdit[label=&quot;error&quot;] {
border-color: #BE7884;
}
QCheckBox {
spacing: 8px;
border: none; /*Workaround for right padding*/
border-right: none; /*Workaround for right padding*/
}
QCheckBox:disabled {
color: #C4CBD8;
Expand Down Expand Up @@ -174,6 +177,9 @@ background-color: #82A9D3;
<property name="placeholderText">
<string notr="true">37254321</string>
</property>
<property name="label" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -217,6 +223,9 @@ background-color: #82A9D3;
<property name="placeholderText">
<string notr="true">47101010033</string>
</property>
<property name="label" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item>
Expand Down
15 changes: 14 additions & 1 deletion client/dialogs/PinPopup.ui
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ background-color: white;
placeholder-text-color: #607496;
font-size: 16px;
}
QLineEdit[label=&quot;error&quot;] {
border-color: #BE7884;
}
QPushButton {
padding: 12px 12px;
border-radius: 4px;
Expand Down Expand Up @@ -148,10 +151,13 @@ background-color: #82A9D3;
</widget>
</item>
<item>
<widget class="QLineEdit" name="pin">
<widget class="LineEdit" name="pin">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="label" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -234,6 +240,13 @@ background-color: #82A9D3;
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LineEdit</class>
<extends>QLineEdit</extends>
<header>widgets/LineEdit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
27 changes: 14 additions & 13 deletions client/dialogs/PinUnblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,19 @@ PinUnblock::PinUnblock(QSmartCardData::PinType type, QSmartCard::PinAction actio
regexpValidateCode = pattern(QSmartCardData::PukType);
ui->line1_text->setText(tr("To unblock the certificate you have to enter the PUK code."));
ui->line2_text->setText(tr("You can find your PUK code inside the ID-card codes envelope."));
ui->line3_text->setText(isPUKReplacable ? tr("If you have forgotten the PUK code for your ID card, please visit "
"<a href=\"https://www.politsei.ee/en/\">the Police and Border Guard Board service center</a> to obtain new PIN codes.") :
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. "
"<a href=\"https://www.id.ee/en/article/my-pin-is-blocked-locked/\">Additional information</a>"));
ui->line3_text->setText(isPUKReplacable
? tr("If you have forgotten the PUK code for your ID card, please visit "
"<a href=\"https://www.politsei.ee/en/\">the Police and Border Guard Board service center</a> to obtain new PIN codes.")
: 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. "
"<a href=\"https://www.id.ee/en/article/my-pin-is-blocked-locked/\">Additional information</a>"));
break;
case QSmartCard::ActivateWithPuk:
case QSmartCard::ChangeWithPuk:
ui->label->setText(tr("%1 code change").arg(QSmartCardData::typeString(type)));
regexpValidateCode = pattern(QSmartCardData::PukType);
ui->line1_text->setText(type == QSmartCardData::Pin2Type
? tr("PIN2 code is used to digitally sign documents.")
: tr("PIN1 code is used for confirming the identity of a person."));
? tr("PIN2 code is used to digitally sign documents.")
: tr("PIN1 code is used for confirming the identity of a person."));
ui->line2_text->setText(tr("If you have forgotten PIN%1, but know PUK, then here you can enter new PIN%1.").arg(type));
ui->line3_text->setText(tr("PUK code is written in the envelope, that is given with the ID-card."));
break;
Expand All @@ -86,8 +87,8 @@ PinUnblock::PinUnblock(QSmartCardData::PinType type, QSmartCard::PinAction actio
break;
}
ui->line1_text->setText(type == QSmartCardData::Pin2Type
? tr("PIN2 code is used to digitally sign documents.")
: tr("PIN1 code is used for confirming the identity of a person."));
? tr("PIN2 code is used to digitally sign documents.")
: tr("PIN1 code is used for confirming the identity of a person."));
ui->line2_text->setText(
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(
QSmartCardData::typeString(type),
Expand All @@ -102,16 +103,16 @@ PinUnblock::PinUnblock(QSmartCardData::PinType type, QSmartCard::PinAction actio
ui->repeat->setValidator(new QRegularExpressionValidator(regexpNewCode, ui->repeat));
ui->puk->setValidator(new QRegularExpressionValidator(regexpValidateCode, ui->puk));

auto setError = [](QLineEdit *input, QLabel *error, const QString &msg) {
input->setStyleSheet(msg.isEmpty() ? QString() : QStringLiteral("border-color: #BE7884"));
auto setError = [this](LineEdit *input, QLabel *error, const QString &msg) {
input->setLabel(msg.isEmpty() ? QString() : QStringLiteral("error"));
error->setFocusPolicy(msg.isEmpty() ? Qt::NoFocus : Qt::TabFocus);
error->setText(msg);
error->setHidden(msg.isEmpty());
};
if(leftAttempts < 3)
setError(ui->puk, ui->errorPuk, action == QSmartCard::ChangeWithPin || action == QSmartCard::ActivateWithPin ?
tr("Remaining attempts: %1").arg(leftAttempts) :
tr("PUK remaining attempts: %1").arg(leftAttempts));
setError(ui->puk, ui->errorPuk, action == QSmartCard::ChangeWithPin || action == QSmartCard::ActivateWithPin
? tr("Remaining attempts: %1").arg(leftAttempts)
: tr("PUK remaining attempts: %1").arg(leftAttempts));

for(int i = 1; i < 4; i++)
{
Expand Down
25 changes: 22 additions & 3 deletions client/dialogs/PinUnblock.ui
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ background-color: white;
placeholder-text-color: #607496;
font-size: 16px;
}
QLineEdit[label=&quot;error&quot;] {
border-color: #BE7884;
}
QPushButton {
padding: 12px 12px;
border-radius: 4px;
Expand Down Expand Up @@ -259,10 +262,13 @@ background-color: #82A9D3;
</widget>
</item>
<item>
<widget class="QLineEdit" name="puk">
<widget class="LineEdit" name="puk">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="label" stdset="0">
<string notr="true"/>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -296,10 +302,13 @@ background-color: #82A9D3;
</widget>
</item>
<item>
<widget class="QLineEdit" name="pin">
<widget class="LineEdit" name="pin">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="label" stdset="0">
<string/>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -333,10 +342,13 @@ background-color: #82A9D3;
</widget>
</item>
<item>
<widget class="QLineEdit" name="repeat">
<widget class="LineEdit" name="repeat">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="label" stdset="0">
<string/>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -404,6 +416,13 @@ background-color: #82A9D3;
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LineEdit</class>
<extends>QLineEdit</extends>
<header>widgets/LineEdit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
Loading
Loading