Skip to content

Commit f96821b

Browse files
committed
Update text fields with new UI guidlines
IB-7972 Signed-off-by: Raul Metsma <[email protected]>
1 parent 941e90b commit f96821b

33 files changed

+356
-410
lines changed

client/MainWindow.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ void MainWindow::navigateToPage( Pages page, const QStringList &files, bool crea
333333
selectPage(page);
334334
}
335335

336-
void MainWindow::onSignAction(int action, const QString &info1, const QString &info2)
336+
void MainWindow::onSignAction(int action, const QString &idCode, const QString &info2)
337337
{
338338
switch(action)
339339
{
@@ -344,16 +344,16 @@ void MainWindow::onSignAction(int action, const QString &info1, const QString &i
344344
});
345345
break;
346346
case SignatureMobile:
347-
sign([this, info1, info2](const QString &city, const QString &state, const QString &zip, const QString &country, const QString &role) {
347+
sign([this, idCode, info2](const QString &city, const QString &state, const QString &zip, const QString &country, const QString &role) {
348348
MobileProgress m(this);
349-
return m.init(info1, info2) &&
349+
return m.init(idCode, info2) &&
350350
digiDoc->sign(city, state, zip, country, role, &m);
351351
});
352352
break;
353353
case SignatureSmartID:
354-
sign([this, info1, info2](const QString &city, const QString &state, const QString &zip, const QString &country, const QString &role) {
354+
sign([this, idCode, info2](const QString &city, const QString &state, const QString &zip, const QString &country, const QString &role) {
355355
SmartIDProgress s(this);
356-
return s.init(info1, info2, digiDoc->fileName()) &&
356+
return s.init(info2, idCode, digiDoc->fileName()) &&
357357
digiDoc->sign(city, state, zip, country, role, &s);
358358
});
359359
break;

client/MainWindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class MainWindow final : public QWidget
7070
void moveSignatureContainer();
7171
void navigateToPage( ria::qdigidoc4::Pages page, const QStringList &files = QStringList(), bool create = true );
7272
void onCryptoAction(int action, const QString &id, const QString &phone);
73-
void onSignAction(int action, const QString &info1, const QString &info2);
73+
void onSignAction(int action, const QString &idCode, const QString &info2);
7474
void openContainer(bool signature);
7575
void pageSelected(int page, bool checked = true);
7676
void resetDigiDoc(DigiDoc *doc = nullptr, bool warnOnChange = true);

client/Styles.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ class FontDatabase
8282
{
8383
switch( font )
8484
{
85-
case Styles::Bold: return bold;
8685
case Styles::Condensed: return condensed;
87-
case Styles::CondensedBold: return condensedBold;
8886
default: return regular;
8987
}
9088
}
@@ -129,12 +127,8 @@ class FontDatabase
129127
};
130128
#endif
131129

132-
QString bold = QFontDatabase::applicationFontFamilies(
133-
QFontDatabase::addApplicationFont(QStringLiteral(":/fonts/Roboto-Bold.ttf"))).at(0);
134130
QString condensed = QFontDatabase::applicationFontFamilies(
135131
QFontDatabase::addApplicationFont(QStringLiteral(":/fonts/RobotoCondensed-Regular.ttf"))).at(0);
136-
QString condensedBold = QFontDatabase::applicationFontFamilies(
137-
QFontDatabase::addApplicationFont(QStringLiteral(":/fonts/RobotoCondensed-Bold.ttf"))).at(0);
138132
QString regular = QFontDatabase::applicationFontFamilies(
139133
QFontDatabase::addApplicationFont(QStringLiteral(":/fonts/Roboto-Regular.ttf"))).at(0);
140134
#ifndef Q_OS_MAC

client/Styles.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ class Styles
2525
{
2626
public:
2727
enum Font {
28-
Bold,
2928
Condensed,
30-
CondensedBold,
3129
Regular
3230
};
3331

client/dialogs/AddRecipients.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ AddRecipients::AddRecipients(ItemList* itemList, QWidget *parent)
7777
connect(ldap_corp, &LdapSearch::error, this, &AddRecipients::showError);
7878
connect(this, &AddRecipients::finished, this, &AddRecipients::close);
7979

80-
connect(ui->leftPane, &ItemList::addAll, this, [this] {
80+
connect(ui->leftPane, &ItemList::add, this, [this] {
8181
for(Item *item: ui->leftPane->items)
8282
addRecipientToRightPane(item);
8383
});

client/dialogs/MobileDialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ MobileDialog::MobileDialog(QWidget *parent)
5555
Settings::MOBILEID_CODE = checked ? ui->idCode->text() : QString();
5656
Settings::MOBILEID_NUMBER = checked ? ui->phoneNo->text() : QString();
5757
};
58-
auto setError = [](QLineEdit *input, QLabel *error, const QString &msg) {
59-
input->setStyleSheet(msg.isEmpty() ? QString() : QStringLiteral("border-color: #BE7884"));
58+
auto setError = [](LineEdit *input, QLabel *error, const QString &msg) {
59+
input->setLabel(msg.isEmpty() ? QString() : QStringLiteral("error"));
6060
error->setText(msg);
6161
error->setHidden(msg.isEmpty());
6262
};

client/dialogs/MobileDialog.ui

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ background-color: white;
4242
placeholder-text-color: #607496;
4343
font-size: 16px;
4444
}
45+
QLineEdit[label=&quot;error&quot;] {
46+
border-color: #BE7884;
47+
}
4548
QCheckBox {
4649
spacing: 8px;
47-
border: none; /*Workaround for right padding*/
50+
border-right: none; /*Workaround for right padding*/
4851
}
4952
QCheckBox:disabled {
5053
color: #C4CBD8;
@@ -174,6 +177,9 @@ background-color: #82A9D3;
174177
<property name="placeholderText">
175178
<string notr="true">37254321</string>
176179
</property>
180+
<property name="label" stdset="0">
181+
<string notr="true"/>
182+
</property>
177183
</widget>
178184
</item>
179185
<item>
@@ -217,6 +223,9 @@ background-color: #82A9D3;
217223
<property name="placeholderText">
218224
<string notr="true">47101010033</string>
219225
</property>
226+
<property name="label" stdset="0">
227+
<string notr="true"/>
228+
</property>
220229
</widget>
221230
</item>
222231
<item>

client/dialogs/PinPopup.ui

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ background-color: white;
3939
placeholder-text-color: #607496;
4040
font-size: 16px;
4141
}
42+
QLineEdit[label=&quot;error&quot;] {
43+
border-color: #BE7884;
44+
}
4245
QPushButton {
4346
padding: 12px 12px;
4447
border-radius: 4px;
@@ -148,10 +151,13 @@ background-color: #82A9D3;
148151
</widget>
149152
</item>
150153
<item>
151-
<widget class="QLineEdit" name="pin">
154+
<widget class="LineEdit" name="pin">
152155
<property name="echoMode">
153156
<enum>QLineEdit::Password</enum>
154157
</property>
158+
<property name="label" stdset="0">
159+
<string notr="true"/>
160+
</property>
155161
</widget>
156162
</item>
157163
<item>
@@ -234,6 +240,13 @@ background-color: #82A9D3;
234240
</item>
235241
</layout>
236242
</widget>
243+
<customwidgets>
244+
<customwidget>
245+
<class>LineEdit</class>
246+
<extends>QLineEdit</extends>
247+
<header>widgets/LineEdit.h</header>
248+
</customwidget>
249+
</customwidgets>
237250
<resources/>
238251
<connections/>
239252
</ui>

client/dialogs/PinUnblock.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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
{

client/dialogs/PinUnblock.ui

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ background-color: white;
3939
placeholder-text-color: #607496;
4040
font-size: 16px;
4141
}
42+
QLineEdit[label=&quot;error&quot;] {
43+
border-color: #BE7884;
44+
}
4245
QPushButton {
4346
padding: 12px 12px;
4447
border-radius: 4px;
@@ -259,10 +262,13 @@ background-color: #82A9D3;
259262
</widget>
260263
</item>
261264
<item>
262-
<widget class="QLineEdit" name="puk">
265+
<widget class="LineEdit" name="puk">
263266
<property name="echoMode">
264267
<enum>QLineEdit::Password</enum>
265268
</property>
269+
<property name="label" stdset="0">
270+
<string notr="true"/>
271+
</property>
266272
</widget>
267273
</item>
268274
<item>
@@ -296,10 +302,13 @@ background-color: #82A9D3;
296302
</widget>
297303
</item>
298304
<item>
299-
<widget class="QLineEdit" name="pin">
305+
<widget class="LineEdit" name="pin">
300306
<property name="echoMode">
301307
<enum>QLineEdit::Password</enum>
302308
</property>
309+
<property name="label" stdset="0">
310+
<string/>
311+
</property>
303312
</widget>
304313
</item>
305314
<item>
@@ -333,10 +342,13 @@ background-color: #82A9D3;
333342
</widget>
334343
</item>
335344
<item>
336-
<widget class="QLineEdit" name="repeat">
345+
<widget class="LineEdit" name="repeat">
337346
<property name="echoMode">
338347
<enum>QLineEdit::Password</enum>
339348
</property>
349+
<property name="label" stdset="0">
350+
<string/>
351+
</property>
340352
</widget>
341353
</item>
342354
<item>
@@ -404,6 +416,13 @@ background-color: #82A9D3;
404416
</item>
405417
</layout>
406418
</widget>
419+
<customwidgets>
420+
<customwidget>
421+
<class>LineEdit</class>
422+
<extends>QLineEdit</extends>
423+
<header>widgets/LineEdit.h</header>
424+
</customwidget>
425+
</customwidgets>
407426
<resources/>
408427
<connections/>
409428
</ui>

0 commit comments

Comments
 (0)