Skip to content

Commit e50b8dc

Browse files
committed
Make AccordionTitle as QCheckBox and update icons
IB-7966 Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent 16d19c6 commit e50b8dc

19 files changed

+292
-693
lines changed

client/MainWindow.ui

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ background-color: #BFD3E8;
644644
<widget class="QWidget" name="eidPage">
645645
<layout class="QVBoxLayout" name="eidPageLayout">
646646
<property name="spacing">
647-
<number>3</number>
647+
<number>0</number>
648648
</property>
649649
<property name="leftMargin">
650650
<number>0</number>
@@ -659,20 +659,7 @@ background-color: #BFD3E8;
659659
<number>0</number>
660660
</property>
661661
<item>
662-
<widget class="InfoStack" name="infoStack" native="true">
663-
<property name="minimumSize">
664-
<size>
665-
<width>0</width>
666-
<height>172</height>
667-
</size>
668-
</property>
669-
<property name="maximumSize">
670-
<size>
671-
<width>16777215</width>
672-
<height>186</height>
673-
</size>
674-
</property>
675-
</widget>
662+
<widget class="InfoStack" name="infoStack" native="true"/>
676663
</item>
677664
<item>
678665
<widget class="Accordion" name="accordion" native="true"/>

client/dialogs/SignatureDialog.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ SignatureDialog::SignatureDialog(const DigiDocSignature &signature, QWidget *par
3737
d->setupUi( this );
3838
setAttribute(Qt::WA_DeleteOnClose);
3939
setWindowFlags(windowFlags()|Qt::FramelessWindowHint);
40-
d->showErrors->init(false, tr("TECHNICAL INFORMATION"), d->error);
4140
d->showErrors->hide();
42-
d->showRole->init(true, tr("ROLE AND ADDRESS"), d->role);
4341
d->error->hide();
44-
connect(d->showErrors, &AccordionTitle::opened, d->showRole, &AccordionTitle::openSection);
45-
connect(d->showErrors, &AccordionTitle::closed, this, [this] { d->showRole->setSectionOpen(); });
46-
connect(d->showRole, &AccordionTitle::opened, d->showErrors, &AccordionTitle::openSection);
47-
connect(d->showRole, &AccordionTitle::closed, this, [this] { d->showErrors->setSectionOpen(); });
42+
connect(d->showErrors, &AccordionTitle::toggled, d->showRole, [this](bool open) {
43+
d->showRole->setChecked(!open);
44+
d->error->setVisible(open);
45+
});
46+
connect(d->showRole, &AccordionTitle::toggled, d->showErrors, [this](bool open) {
47+
d->showErrors->setChecked(!open);
48+
d->role->setVisible(open);
49+
});
4850

4951
new Overlay(this);
5052

client/dialogs/SignatureDialog.ui

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,17 @@ QTextEdit, #signerCity, #signerCountry, #signerState, #signerZip, #signerRoles {
4646
border: 1px solid #8E969D;
4747
border-radius: 2px;
4848
background-color: #FFFFFF;
49-
}
50-
#lblNotice, #info, #error { margin: 0px 12px 0px 12px; }</string>
49+
}</string>
5150
</property>
5251
<layout class="QVBoxLayout" name="leftPaneLayout" stretch="0,0,0,0,1,0,0,0">
5352
<property name="leftMargin">
54-
<number>0</number>
53+
<number>12</number>
5554
</property>
5655
<property name="topMargin">
5756
<number>12</number>
5857
</property>
5958
<property name="rightMargin">
60-
<number>1</number>
59+
<number>12</number>
6160
</property>
6261
<property name="bottomMargin">
6362
<number>0</number>
@@ -95,9 +94,6 @@ background-color: #FFFFFF;
9594
<property name="focusPolicy">
9695
<enum>Qt::TabFocus</enum>
9796
</property>
98-
<property name="styleSheet">
99-
<string notr="true">border: none;</string>
100-
</property>
10197
<property name="text">
10298
<string>Notice</string>
10399
</property>
@@ -108,9 +104,6 @@ background-color: #FFFFFF;
108104
<property name="focusPolicy">
109105
<enum>Qt::TabFocus</enum>
110106
</property>
111-
<property name="styleSheet">
112-
<string notr="true">border: none;</string>
113-
</property>
114107
<property name="wordWrap">
115108
<bool>true</bool>
116109
</property>
@@ -120,10 +113,19 @@ background-color: #FFFFFF;
120113
</widget>
121114
</item>
122115
<item>
123-
<widget class="AccordionTitle" name="showErrors" native="true">
116+
<widget class="AccordionTitle" name="showErrors">
117+
<property name="minimumSize">
118+
<size>
119+
<width>0</width>
120+
<height>40</height>
121+
</size>
122+
</property>
124123
<property name="cursor">
125124
<cursorShape>PointingHandCursor</cursorShape>
126125
</property>
126+
<property name="text">
127+
<string>Technical information</string>
128+
</property>
127129
</widget>
128130
</item>
129131
<item>
@@ -157,23 +159,35 @@ QScrollBar::sub-line:vertical {
157159
</widget>
158160
</item>
159161
<item>
160-
<widget class="AccordionTitle" name="showRole" native="true">
162+
<widget class="AccordionTitle" name="showRole">
163+
<property name="minimumSize">
164+
<size>
165+
<width>0</width>
166+
<height>40</height>
167+
</size>
168+
</property>
161169
<property name="cursor">
162170
<cursorShape>PointingHandCursor</cursorShape>
171+
</property>
172+
<property name="text">
173+
<string>Role and address</string>
174+
</property>
175+
<property name="checked">
176+
<bool>true</bool>
163177
</property>
164178
</widget>
165179
</item>
166180
<item>
167181
<widget class="QWidget" name="role" native="true">
168182
<layout class="QVBoxLayout" name="roleLayout">
169183
<property name="leftMargin">
170-
<number>12</number>
184+
<number>0</number>
171185
</property>
172186
<property name="topMargin">
173187
<number>0</number>
174188
</property>
175189
<property name="rightMargin">
176-
<number>12</number>
190+
<number>0</number>
177191
</property>
178192
<property name="bottomMargin">
179193
<number>0</number>
@@ -554,7 +568,7 @@ QPushButton:disabled {
554568
<customwidgets>
555569
<customwidget>
556570
<class>AccordionTitle</class>
557-
<extends>QWidget</extends>
571+
<extends>QCheckBox</extends>
558572
<header>widgets/AccordionTitle.h</header>
559573
<container>1</container>
560574
</customwidget>

client/dialogs/WarningDialog.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,14 @@ WarningDialog::WarningDialog(const QString &text, const QString &details, QWidge
3939
ui->buttonBox->layout()->setSpacing(40);
4040
ui->text->setText(text);
4141
ui->details->setText(details);
42-
ui->details->setHidden(details.isEmpty());
42+
ui->details->hide();
4343
ui->showDetails->setHidden(details.isEmpty());
44+
connect(ui->showDetails, &AccordionTitle::toggled, ui->details, &QLabel::setVisible);
4445
cancel = ui->buttonBox->button(QDialogButtonBox::Close);
4546
cancel->setCursor(Qt::PointingHandCursor);
4647
connect(cancel, &QPushButton::clicked, this, &QDialog::reject);
4748
resetCancelStyle(true);
4849

49-
if(!details.isEmpty())
50-
ui->showDetails->init(false, tr("Details"), ui->details);
5150
}
5251

5352
WarningDialog::WarningDialog(const QString &text, QWidget *parent)

client/dialogs/WarningDialog.ui

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ border: none;
119119
</widget>
120120
</item>
121121
<item>
122-
<widget class="AccordionTitle" name="showDetails" native="true">
122+
<widget class="AccordionTitle" name="showDetails">
123123
<property name="minimumSize">
124124
<size>
125125
<width>0</width>
@@ -135,6 +135,12 @@ border: none;
135135
<property name="cursor">
136136
<cursorShape>PointingHandCursor</cursorShape>
137137
</property>
138+
<property name="text">
139+
<string>Details</string>
140+
</property>
141+
<property name="checked">
142+
<bool>false</bool>
143+
</property>
138144
</widget>
139145
</item>
140146
<item>
@@ -177,7 +183,7 @@ border: none;
177183
<customwidgets>
178184
<customwidget>
179185
<class>AccordionTitle</class>
180-
<extends>QWidget</extends>
186+
<extends>QCheckBox</extends>
181187
<header>widgets/AccordionTitle.h</header>
182188
<container>1</container>
183189
</customwidget>
Lines changed: 2 additions & 8 deletions
Loading
Lines changed: 2 additions & 8 deletions
Loading

client/translations/en.ts

Lines changed: 23 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@
33
<TS version="2.1" language="en_US">
44
<context>
55
<name>Accordion</name>
6-
<message>
7-
<source>PIN/PUK CODES AND CERTIFICATES</source>
8-
<translation>PIN/PUK CODES AND CERTIFICATES</translation>
9-
</message>
106
<message>
117
<source>PIN/PUK codes and certificates</source>
12-
<comment>accessible</comment>
138
<translation>PIN/PUK codes and certificates</translation>
149
</message>
1510
</context>
@@ -1047,77 +1042,48 @@
10471042
</context>
10481043
<context>
10491044
<name>InfoStack</name>
1050-
<message>
1051-
<source>CITIZENSHIP</source>
1052-
<translation>CITIZENSHIP</translation>
1053-
</message>
1054-
<message>
1055-
<source>GIVEN NAMES</source>
1056-
<translation>GIVEN NAMES</translation>
1057-
</message>
1058-
<message>
1059-
<source>PERSONAL CODE</source>
1060-
<translation>PERSONAL CODE</translation>
1061-
</message>
1062-
<message>
1063-
<source>DOCUMENT</source>
1064-
<translation>DOCUMENT</translation>
1065-
</message>
1066-
<message>
1067-
<source>SURNAME</source>
1068-
<translation>SURNAME</translation>
1069-
</message>
1070-
<message>
1071-
<source>NAME</source>
1072-
<translation>NAME</translation>
1073-
</message>
1074-
<message>
1075-
<source>SERIAL</source>
1076-
<translation>SERIAL</translation>
1077-
</message>
1078-
<message>
1079-
<source>COUNTRY</source>
1080-
<translation>COUNTRY</translation>
1081-
</message>
10821045
<message>
10831046
<source>You&apos;re using digital identity card</source>
10841047
<translation>You&apos;re using digital identity card</translation>
10851048
</message>
10861049
<message>
1087-
<source>Valid</source>
1088-
<translation>Valid</translation>
1050+
<source>Name</source>
1051+
<translation>Name</translation>
1052+
</message>
1053+
<message>
1054+
<source>Organization</source>
1055+
<translation>Organization</translation>
10891056
</message>
10901057
<message>
1091-
<source> until </source>
1092-
<translation> until </translation>
1058+
<source>Serial</source>
1059+
<translation>Serial</translation>
10931060
</message>
10941061
<message>
1095-
<source>Expired</source>
1096-
<translation>Expired</translation>
1062+
<source>Country</source>
1063+
<translation>Country</translation>
10971064
</message>
10981065
<message>
10991066
<source>Given names</source>
1100-
<extracomment>accessible</extracomment>
11011067
<translation>Given names</translation>
11021068
</message>
11031069
<message>
11041070
<source>Surname</source>
1105-
<extracomment>accessible</extracomment>
11061071
<translation>Surname</translation>
11071072
</message>
11081073
<message>
11091074
<source>Personal code</source>
1110-
<extracomment>accessible</extracomment>
11111075
<translation>Personal code</translation>
11121076
</message>
11131077
<message>
11141078
<source>Citizenship</source>
1115-
<extracomment>accessible</extracomment>
11161079
<translation>Citizenship</translation>
11171080
</message>
1081+
<message>
1082+
<source>Expiry date</source>
1083+
<translation>Expiry date</translation>
1084+
</message>
11181085
<message>
11191086
<source>Document</source>
1120-
<extracomment>accessible</extracomment>
11211087
<translation>Document</translation>
11221088
</message>
11231089
</context>
@@ -2479,7 +2445,7 @@ Additional licenses and components</translation>
24792445
</message>
24802446
<message>
24812447
<source>Name</source>
2482-
<translation type="unfinished"></translation>
2448+
<translation>Name</translation>
24832449
</message>
24842450
<message>
24852451
<source>Fetch URL</source>
@@ -2504,6 +2470,14 @@ Additional licenses and components</translation>
25042470
<source>Signer</source>
25052471
<translation>Signer</translation>
25062472
</message>
2473+
<message>
2474+
<source>Technical information</source>
2475+
<translation>Technical information</translation>
2476+
</message>
2477+
<message>
2478+
<source>Role and address</source>
2479+
<translation>Role and address</translation>
2480+
</message>
25072481
<message>
25082482
<source>City</source>
25092483
<translation>City</translation>
@@ -2532,10 +2506,6 @@ Additional licenses and components</translation>
25322506
<source>Value</source>
25332507
<translation>Value</translation>
25342508
</message>
2535-
<message>
2536-
<source>TECHNICAL INFORMATION</source>
2537-
<translation>TECHNICAL INFORMATION</translation>
2538-
</message>
25392509
<message>
25402510
<source>Timestamp</source>
25412511
<translation>Timestamp</translation>
@@ -2678,10 +2648,6 @@ Additional licenses and components</translation>
26782648
<source>Signing time (UTC)</source>
26792649
<translation>Signing time (UTC)</translation>
26802650
</message>
2681-
<message>
2682-
<source>ROLE AND ADDRESS</source>
2683-
<translation>ROLE AND ADDRESS</translation>
2684-
</message>
26852651
<message>
26862652
<source>The signature is technically correct, but it is based on the currently weak hash algorithm SHA-1, therefore it is not protected against forgery or alteration.</source>
26872653
<translation>The signature is technically correct, but it is based on the currently weak hash algorithm SHA-1, therefore it is not protected against forgery or alteration.</translation>

0 commit comments

Comments
 (0)