Merge lp:~diegosarmentero/ubuntu-sso-client/show-errors into lp:ubuntu-sso-client
- show-errors
- Merge into trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Natalia Bidart | ||||||||
Approved revision: | 900 | ||||||||
Merged at revision: | 893 | ||||||||
Proposed branch: | lp:~diegosarmentero/ubuntu-sso-client/show-errors | ||||||||
Merge into: | lp:ubuntu-sso-client | ||||||||
Diff against target: |
1151 lines (+381/-301) 18 files modified
data/qt/setup_account.ui (+246/-268) data/qt/stylesheet.qss (+9/-1) ubuntu_sso/qt/__init__.py (+1/-1) ubuntu_sso/qt/current_user_sign_in_page.py (+3/-3) ubuntu_sso/qt/email_verification_page.py (+2/-1) ubuntu_sso/qt/enhanced_check_box.py (+1/-1) ubuntu_sso/qt/forgotten_password_page.py (+3/-1) ubuntu_sso/qt/main.py (+4/-0) ubuntu_sso/qt/reset_password_page.py (+2/-3) ubuntu_sso/qt/setup_account_page.py (+4/-5) ubuntu_sso/qt/sso_wizard_page.py (+34/-9) ubuntu_sso/qt/tests/test_current_user_sign_in_page.py (+8/-2) ubuntu_sso/qt/tests/test_email_verification.py (+7/-1) ubuntu_sso/qt/tests/test_forgotten_password.py (+8/-2) ubuntu_sso/qt/tests/test_reset_password.py (+3/-0) ubuntu_sso/qt/tests/test_setup_account.py (+3/-1) ubuntu_sso/qt/tests/test_sso_wizard_page.py (+39/-0) ubuntu_sso/qt/tests/test_ubuntu_sso_wizard.py (+4/-2) |
||||||||
To merge this branch: | bzr merge lp:~diegosarmentero/ubuntu-sso-client/show-errors | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Natalia Bidart (community) | Approve | ||
Review via email: mp+94617@code.launchpad.net |
Description of the change
- 890. By Diego Sarmentero
-
Fixing lint issues
Diego Sarmentero (diegosarmentero) wrote : | # |
> I'm getting all these:
>
> == Python Lint Notices ==
>
> ubuntu_
> 158: [E1121, CurrentUserSign
> arguments for function call
>
> ubuntu_
> 135: [E1121, EmailVerificati
> positional arguments for function call
>
> ubuntu_
> 189: [E1121, ForgottenPasswo
> positional arguments for function call
>
> ubuntu_
> 183: [E1121, ResetPasswordPa
> positional arguments for function call
>
> ubuntu_
> 350: [E1121, SetupAccountPag
> positional arguments for function call
> 391: [E1121, SetupAccountPag
> arguments for function call
>
> nessita@
Fixed, forgot to push that.
Natalia Bidart (nataliabidart) wrote : | # |
Branch looks good!
* One tiny note: in current_
* Instead of using assertTrue(foo >= bar), can you please ise assertGreaterEqual?
* Can you please restore the removed empty line in ubuntu_
Thanks!
- 891. By Diego Sarmentero
-
Fixing some minor details.
- 892. By Diego Sarmentero
-
Changing the style and location of the errors.
Natalia Bidart (nataliabidart) wrote : | # |
Please do not increase the sso dialog size since we're already above the limit (limit is 525).
So, instead, remove the padding a bit, since there is too much white space between the header and the "Name" legend. Do not worry for the padding for the warning label.
Thanks!
- 893. By Diego Sarmentero
-
Fixing size, and adding ellipsis to the error message.
- 894. By Diego Sarmentero
-
Improves in the ui style.
- 895. By Diego Sarmentero
-
Some modifications in the setup_account_
page_ui padding and spaces. - 896. By Diego Sarmentero
-
Conflict resolve
- 897. By Diego Sarmentero
-
Conflict resolved.
- 898. By Diego Sarmentero
-
fixing setup_page
- 899. By Diego Sarmentero
-
improves in setup_account_page
- 900. By Diego Sarmentero
-
Fixing errors reset when the user restart request again some data.
Natalia Bidart (nataliabidart) wrote : | # |
Looks good!
Thanks for working on this.
Preview Diff
1 | === modified file 'data/qt/setup_account.ui' | |||
2 | --- data/qt/setup_account.ui 2012-02-23 20:28:00 +0000 | |||
3 | +++ data/qt/setup_account.ui 2012-03-01 20:49:18 +0000 | |||
4 | @@ -7,7 +7,7 @@ | |||
5 | 7 | <x>0</x> | 7 | <x>0</x> |
6 | 8 | <y>0</y> | 8 | <y>0</y> |
7 | 9 | <width>543</width> | 9 | <width>543</width> |
9 | 10 | <height>514</height> | 10 | <height>476</height> |
10 | 11 | </rect> | 11 | </rect> |
11 | 12 | </property> | 12 | </property> |
12 | 13 | <property name="sizePolicy"> | 13 | <property name="sizePolicy"> |
13 | @@ -39,24 +39,27 @@ | |||
14 | 39 | <number>0</number> | 39 | <number>0</number> |
15 | 40 | </property> | 40 | </property> |
16 | 41 | <item> | 41 | <item> |
18 | 42 | <layout class="QGridLayout" name="gridLayout" columnminimumwidth="310,220"> | 42 | <layout class="QGridLayout" name="gridLayout" columnminimumwidth="310,0"> |
19 | 43 | <property name="sizeConstraint"> | ||
20 | 44 | <enum>QLayout::SetDefaultConstraint</enum> | ||
21 | 45 | </property> | ||
22 | 46 | <item row="1" column="1"> | ||
23 | 47 | <spacer name="verticalSpacer"> | ||
24 | 48 | <property name="orientation"> | ||
25 | 49 | <enum>Qt::Vertical</enum> | ||
26 | 50 | </property> | ||
27 | 51 | <property name="sizeType"> | ||
28 | 52 | <enum>QSizePolicy::Fixed</enum> | ||
29 | 53 | </property> | ||
30 | 54 | <property name="sizeHint" stdset="0"> | ||
31 | 55 | <size> | ||
32 | 56 | <width>20</width> | ||
33 | 57 | <height>15</height> | ||
34 | 58 | </size> | ||
35 | 59 | </property> | ||
36 | 60 | </spacer> | ||
37 | 61 | </item> | ||
38 | 43 | <item row="0" column="0"> | 62 | <item row="0" column="0"> |
39 | 44 | <widget class="QLabel" name="password_info_label"> | ||
40 | 45 | <property name="sizePolicy"> | ||
41 | 46 | <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> | ||
42 | 47 | <horstretch>0</horstretch> | ||
43 | 48 | <verstretch>0</verstretch> | ||
44 | 49 | </sizepolicy> | ||
45 | 50 | </property> | ||
46 | 51 | <property name="text"> | ||
47 | 52 | <string notr="true">password_info_label</string> | ||
48 | 53 | </property> | ||
49 | 54 | <property name="wordWrap"> | ||
50 | 55 | <bool>true</bool> | ||
51 | 56 | </property> | ||
52 | 57 | </widget> | ||
53 | 58 | </item> | ||
54 | 59 | <item row="1" column="0"> | ||
55 | 60 | <layout class="QVBoxLayout" name="verticalLayout"> | 63 | <layout class="QVBoxLayout" name="verticalLayout"> |
56 | 61 | <property name="spacing"> | 64 | <property name="spacing"> |
57 | 62 | <number>3</number> | 65 | <number>3</number> |
58 | @@ -106,7 +109,7 @@ | |||
59 | 106 | </item> | 109 | </item> |
60 | 107 | </layout> | 110 | </layout> |
61 | 108 | </item> | 111 | </item> |
63 | 109 | <item row="3" column="0"> | 112 | <item row="2" column="0"> |
64 | 110 | <layout class="QVBoxLayout" name="verticalLayout"> | 113 | <layout class="QVBoxLayout" name="verticalLayout"> |
65 | 111 | <property name="spacing"> | 114 | <property name="spacing"> |
66 | 112 | <number>3</number> | 115 | <number>3</number> |
67 | @@ -159,7 +162,48 @@ | |||
68 | 159 | </item> | 162 | </item> |
69 | 160 | </layout> | 163 | </layout> |
70 | 161 | </item> | 164 | </item> |
72 | 162 | <item row="4" column="0"> | 165 | <item row="2" column="1"> |
73 | 166 | <layout class="QVBoxLayout" name="verticalLayout_8"> | ||
74 | 167 | <property name="spacing"> | ||
75 | 168 | <number>0</number> | ||
76 | 169 | </property> | ||
77 | 170 | <property name="leftMargin"> | ||
78 | 171 | <number>0</number> | ||
79 | 172 | </property> | ||
80 | 173 | <item> | ||
81 | 174 | <widget class="QLabel" name="email_assistance"> | ||
82 | 175 | <property name="sizePolicy"> | ||
83 | 176 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
84 | 177 | <horstretch>0</horstretch> | ||
85 | 178 | <verstretch>0</verstretch> | ||
86 | 179 | </sizepolicy> | ||
87 | 180 | </property> | ||
88 | 181 | <property name="minimumSize"> | ||
89 | 182 | <size> | ||
90 | 183 | <width>220</width> | ||
91 | 184 | <height>0</height> | ||
92 | 185 | </size> | ||
93 | 186 | </property> | ||
94 | 187 | <property name="maximumSize"> | ||
95 | 188 | <size> | ||
96 | 189 | <width>220</width> | ||
97 | 190 | <height>16777215</height> | ||
98 | 191 | </size> | ||
99 | 192 | </property> | ||
100 | 193 | <property name="text"> | ||
101 | 194 | <string notr="true">email_assistance</string> | ||
102 | 195 | </property> | ||
103 | 196 | <property name="alignment"> | ||
104 | 197 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
105 | 198 | </property> | ||
106 | 199 | <property name="wordWrap"> | ||
107 | 200 | <bool>true</bool> | ||
108 | 201 | </property> | ||
109 | 202 | </widget> | ||
110 | 203 | </item> | ||
111 | 204 | </layout> | ||
112 | 205 | </item> | ||
113 | 206 | <item row="3" column="0"> | ||
114 | 163 | <layout class="QVBoxLayout" name="verticalLayout"> | 207 | <layout class="QVBoxLayout" name="verticalLayout"> |
115 | 164 | <property name="spacing"> | 208 | <property name="spacing"> |
116 | 165 | <number>3</number> | 209 | <number>3</number> |
117 | @@ -212,28 +256,139 @@ | |||
118 | 212 | </item> | 256 | </item> |
119 | 213 | </layout> | 257 | </layout> |
120 | 214 | </item> | 258 | </item> |
122 | 215 | <item row="6" column="0"> | 259 | <item row="3" column="1"> |
123 | 260 | <layout class="QVBoxLayout" name="verticalLayout_9"> | ||
124 | 261 | <property name="spacing"> | ||
125 | 262 | <number>0</number> | ||
126 | 263 | </property> | ||
127 | 264 | <property name="leftMargin"> | ||
128 | 265 | <number>0</number> | ||
129 | 266 | </property> | ||
130 | 267 | <item> | ||
131 | 268 | <widget class="QLabel" name="confirm_email_assistance"> | ||
132 | 269 | <property name="sizePolicy"> | ||
133 | 270 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
134 | 271 | <horstretch>0</horstretch> | ||
135 | 272 | <verstretch>0</verstretch> | ||
136 | 273 | </sizepolicy> | ||
137 | 274 | </property> | ||
138 | 275 | <property name="minimumSize"> | ||
139 | 276 | <size> | ||
140 | 277 | <width>220</width> | ||
141 | 278 | <height>0</height> | ||
142 | 279 | </size> | ||
143 | 280 | </property> | ||
144 | 281 | <property name="maximumSize"> | ||
145 | 282 | <size> | ||
146 | 283 | <width>220</width> | ||
147 | 284 | <height>16777215</height> | ||
148 | 285 | </size> | ||
149 | 286 | </property> | ||
150 | 287 | <property name="text"> | ||
151 | 288 | <string notr="true">confirm_email_assistance</string> | ||
152 | 289 | </property> | ||
153 | 290 | <property name="alignment"> | ||
154 | 291 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
155 | 292 | </property> | ||
156 | 293 | <property name="wordWrap"> | ||
157 | 294 | <bool>true</bool> | ||
158 | 295 | </property> | ||
159 | 296 | <property name="indent"> | ||
160 | 297 | <number>0</number> | ||
161 | 298 | </property> | ||
162 | 299 | </widget> | ||
163 | 300 | </item> | ||
164 | 301 | </layout> | ||
165 | 302 | </item> | ||
166 | 303 | <item row="4" column="1"> | ||
167 | 304 | <spacer name="verticalSpacer_2"> | ||
168 | 305 | <property name="orientation"> | ||
169 | 306 | <enum>Qt::Vertical</enum> | ||
170 | 307 | </property> | ||
171 | 308 | <property name="sizeType"> | ||
172 | 309 | <enum>QSizePolicy::Fixed</enum> | ||
173 | 310 | </property> | ||
174 | 311 | <property name="sizeHint" stdset="0"> | ||
175 | 312 | <size> | ||
176 | 313 | <width>20</width> | ||
177 | 314 | <height>15</height> | ||
178 | 315 | </size> | ||
179 | 316 | </property> | ||
180 | 317 | </spacer> | ||
181 | 318 | </item> | ||
182 | 319 | <item row="9" column="1"> | ||
183 | 320 | <spacer name="verticalSpacer_5"> | ||
184 | 321 | <property name="orientation"> | ||
185 | 322 | <enum>Qt::Vertical</enum> | ||
186 | 323 | </property> | ||
187 | 324 | <property name="sizeType"> | ||
188 | 325 | <enum>QSizePolicy::Fixed</enum> | ||
189 | 326 | </property> | ||
190 | 327 | <property name="sizeHint" stdset="0"> | ||
191 | 328 | <size> | ||
192 | 329 | <width>20</width> | ||
193 | 330 | <height>15</height> | ||
194 | 331 | </size> | ||
195 | 332 | </property> | ||
196 | 333 | </spacer> | ||
197 | 334 | </item> | ||
198 | 335 | <item row="10" column="0" colspan="2"> | ||
199 | 336 | <layout class="QHBoxLayout" name="hlayout_check"> | ||
200 | 337 | <property name="spacing"> | ||
201 | 338 | <number>0</number> | ||
202 | 339 | </property> | ||
203 | 340 | <property name="topMargin"> | ||
204 | 341 | <number>10</number> | ||
205 | 342 | </property> | ||
206 | 343 | </layout> | ||
207 | 344 | </item> | ||
208 | 345 | <item row="0" column="1"> | ||
209 | 346 | <layout class="QVBoxLayout" name="verticalLayout_7"> | ||
210 | 347 | <property name="spacing"> | ||
211 | 348 | <number>0</number> | ||
212 | 349 | </property> | ||
213 | 350 | <property name="leftMargin"> | ||
214 | 351 | <number>0</number> | ||
215 | 352 | </property> | ||
216 | 353 | <item> | ||
217 | 354 | <widget class="QLabel" name="name_assistance"> | ||
218 | 355 | <property name="sizePolicy"> | ||
219 | 356 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
220 | 357 | <horstretch>0</horstretch> | ||
221 | 358 | <verstretch>0</verstretch> | ||
222 | 359 | </sizepolicy> | ||
223 | 360 | </property> | ||
224 | 361 | <property name="minimumSize"> | ||
225 | 362 | <size> | ||
226 | 363 | <width>220</width> | ||
227 | 364 | <height>0</height> | ||
228 | 365 | </size> | ||
229 | 366 | </property> | ||
230 | 367 | <property name="maximumSize"> | ||
231 | 368 | <size> | ||
232 | 369 | <width>220</width> | ||
233 | 370 | <height>16777215</height> | ||
234 | 371 | </size> | ||
235 | 372 | </property> | ||
236 | 373 | <property name="text"> | ||
237 | 374 | <string notr="true">name_assistance</string> | ||
238 | 375 | </property> | ||
239 | 376 | <property name="alignment"> | ||
240 | 377 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
241 | 378 | </property> | ||
242 | 379 | <property name="wordWrap"> | ||
243 | 380 | <bool>true</bool> | ||
244 | 381 | </property> | ||
245 | 382 | </widget> | ||
246 | 383 | </item> | ||
247 | 384 | </layout> | ||
248 | 385 | </item> | ||
249 | 386 | <item row="5" column="0"> | ||
250 | 216 | <layout class="QVBoxLayout" name="verticalLayout"> | 387 | <layout class="QVBoxLayout" name="verticalLayout"> |
251 | 217 | <property name="spacing"> | 388 | <property name="spacing"> |
252 | 218 | <number>3</number> | 389 | <number>3</number> |
253 | 219 | </property> | 390 | </property> |
254 | 220 | <item> | 391 | <item> |
255 | 221 | <spacer name="verticalSpacer_4"> | ||
256 | 222 | <property name="orientation"> | ||
257 | 223 | <enum>Qt::Vertical</enum> | ||
258 | 224 | </property> | ||
259 | 225 | <property name="sizeType"> | ||
260 | 226 | <enum>QSizePolicy::Fixed</enum> | ||
261 | 227 | </property> | ||
262 | 228 | <property name="sizeHint" stdset="0"> | ||
263 | 229 | <size> | ||
264 | 230 | <width>20</width> | ||
265 | 231 | <height>10</height> | ||
266 | 232 | </size> | ||
267 | 233 | </property> | ||
268 | 234 | </spacer> | ||
269 | 235 | </item> | ||
270 | 236 | <item> | ||
271 | 237 | <widget class="QLabel" name="password_label"> | 392 | <widget class="QLabel" name="password_label"> |
272 | 238 | <property name="font"> | 393 | <property name="font"> |
273 | 239 | <font> | 394 | <font> |
274 | @@ -290,28 +445,47 @@ | |||
275 | 290 | </item> | 445 | </item> |
276 | 291 | </layout> | 446 | </layout> |
277 | 292 | </item> | 447 | </item> |
279 | 293 | <item row="7" column="0"> | 448 | <item row="5" column="1" rowspan="2"> |
280 | 449 | <layout class="QHBoxLayout" name="horizontalLayout_3"> | ||
281 | 450 | <item> | ||
282 | 451 | <widget class="QLabel" name="password_assistance"> | ||
283 | 452 | <property name="sizePolicy"> | ||
284 | 453 | <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> | ||
285 | 454 | <horstretch>0</horstretch> | ||
286 | 455 | <verstretch>0</verstretch> | ||
287 | 456 | </sizepolicy> | ||
288 | 457 | </property> | ||
289 | 458 | <property name="minimumSize"> | ||
290 | 459 | <size> | ||
291 | 460 | <width>220</width> | ||
292 | 461 | <height>80</height> | ||
293 | 462 | </size> | ||
294 | 463 | </property> | ||
295 | 464 | <property name="maximumSize"> | ||
296 | 465 | <size> | ||
297 | 466 | <width>220</width> | ||
298 | 467 | <height>16777215</height> | ||
299 | 468 | </size> | ||
300 | 469 | </property> | ||
301 | 470 | <property name="text"> | ||
302 | 471 | <string notr="true">password_assistance</string> | ||
303 | 472 | </property> | ||
304 | 473 | <property name="wordWrap"> | ||
305 | 474 | <bool>true</bool> | ||
306 | 475 | </property> | ||
307 | 476 | <property name="indent"> | ||
308 | 477 | <number>17</number> | ||
309 | 478 | </property> | ||
310 | 479 | </widget> | ||
311 | 480 | </item> | ||
312 | 481 | </layout> | ||
313 | 482 | </item> | ||
314 | 483 | <item row="6" column="0"> | ||
315 | 294 | <layout class="QVBoxLayout" name="verticalLayout"> | 484 | <layout class="QVBoxLayout" name="verticalLayout"> |
316 | 295 | <property name="spacing"> | 485 | <property name="spacing"> |
317 | 296 | <number>3</number> | 486 | <number>3</number> |
318 | 297 | </property> | 487 | </property> |
319 | 298 | <item> | 488 | <item> |
320 | 299 | <spacer name="verticalSpacer_5"> | ||
321 | 300 | <property name="orientation"> | ||
322 | 301 | <enum>Qt::Vertical</enum> | ||
323 | 302 | </property> | ||
324 | 303 | <property name="sizeType"> | ||
325 | 304 | <enum>QSizePolicy::Fixed</enum> | ||
326 | 305 | </property> | ||
327 | 306 | <property name="sizeHint" stdset="0"> | ||
328 | 307 | <size> | ||
329 | 308 | <width>20</width> | ||
330 | 309 | <height>10</height> | ||
331 | 310 | </size> | ||
332 | 311 | </property> | ||
333 | 312 | </spacer> | ||
334 | 313 | </item> | ||
335 | 314 | <item> | ||
336 | 315 | <widget class="QLabel" name="confirm_password_label"> | 489 | <widget class="QLabel" name="confirm_password_label"> |
337 | 316 | <property name="font"> | 490 | <property name="font"> |
338 | 317 | <font> | 491 | <font> |
339 | @@ -362,7 +536,23 @@ | |||
340 | 362 | </item> | 536 | </item> |
341 | 363 | </layout> | 537 | </layout> |
342 | 364 | </item> | 538 | </item> |
344 | 365 | <item row="9" column="0"> | 539 | <item row="7" column="1"> |
345 | 540 | <spacer name="verticalSpacer_3"> | ||
346 | 541 | <property name="orientation"> | ||
347 | 542 | <enum>Qt::Vertical</enum> | ||
348 | 543 | </property> | ||
349 | 544 | <property name="sizeType"> | ||
350 | 545 | <enum>QSizePolicy::Fixed</enum> | ||
351 | 546 | </property> | ||
352 | 547 | <property name="sizeHint" stdset="0"> | ||
353 | 548 | <size> | ||
354 | 549 | <width>20</width> | ||
355 | 550 | <height>15</height> | ||
356 | 551 | </size> | ||
357 | 552 | </property> | ||
358 | 553 | </spacer> | ||
359 | 554 | </item> | ||
360 | 555 | <item row="8" column="0"> | ||
361 | 366 | <layout class="QVBoxLayout" name="verticalLayout"> | 556 | <layout class="QVBoxLayout" name="verticalLayout"> |
362 | 367 | <property name="spacing"> | 557 | <property name="spacing"> |
363 | 368 | <number>3</number> | 558 | <number>3</number> |
364 | @@ -442,7 +632,7 @@ | |||
365 | 442 | </item> | 632 | </item> |
366 | 443 | </layout> | 633 | </layout> |
367 | 444 | </item> | 634 | </item> |
369 | 445 | <item row="9" column="1"> | 635 | <item row="8" column="1"> |
370 | 446 | <widget class="QLabel" name="refresh_label"> | 636 | <widget class="QLabel" name="refresh_label"> |
371 | 447 | <property name="sizePolicy"> | 637 | <property name="sizePolicy"> |
372 | 448 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | 638 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> |
373 | @@ -476,218 +666,6 @@ | |||
374 | 476 | </property> | 666 | </property> |
375 | 477 | </widget> | 667 | </widget> |
376 | 478 | </item> | 668 | </item> |
377 | 479 | <item row="1" column="1"> | ||
378 | 480 | <layout class="QVBoxLayout" name="verticalLayout_7"> | ||
379 | 481 | <property name="spacing"> | ||
380 | 482 | <number>0</number> | ||
381 | 483 | </property> | ||
382 | 484 | <property name="leftMargin"> | ||
383 | 485 | <number>0</number> | ||
384 | 486 | </property> | ||
385 | 487 | <item> | ||
386 | 488 | <widget class="QLabel" name="name_assistance"> | ||
387 | 489 | <property name="sizePolicy"> | ||
388 | 490 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
389 | 491 | <horstretch>0</horstretch> | ||
390 | 492 | <verstretch>0</verstretch> | ||
391 | 493 | </sizepolicy> | ||
392 | 494 | </property> | ||
393 | 495 | <property name="minimumSize"> | ||
394 | 496 | <size> | ||
395 | 497 | <width>220</width> | ||
396 | 498 | <height>0</height> | ||
397 | 499 | </size> | ||
398 | 500 | </property> | ||
399 | 501 | <property name="maximumSize"> | ||
400 | 502 | <size> | ||
401 | 503 | <width>220</width> | ||
402 | 504 | <height>16777215</height> | ||
403 | 505 | </size> | ||
404 | 506 | </property> | ||
405 | 507 | <property name="text"> | ||
406 | 508 | <string notr="true">name_assistance</string> | ||
407 | 509 | </property> | ||
408 | 510 | <property name="alignment"> | ||
409 | 511 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
410 | 512 | </property> | ||
411 | 513 | <property name="wordWrap"> | ||
412 | 514 | <bool>true</bool> | ||
413 | 515 | </property> | ||
414 | 516 | </widget> | ||
415 | 517 | </item> | ||
416 | 518 | </layout> | ||
417 | 519 | </item> | ||
418 | 520 | <item row="3" column="1"> | ||
419 | 521 | <layout class="QVBoxLayout" name="verticalLayout_8"> | ||
420 | 522 | <property name="spacing"> | ||
421 | 523 | <number>0</number> | ||
422 | 524 | </property> | ||
423 | 525 | <property name="leftMargin"> | ||
424 | 526 | <number>0</number> | ||
425 | 527 | </property> | ||
426 | 528 | <item> | ||
427 | 529 | <widget class="QLabel" name="email_assistance"> | ||
428 | 530 | <property name="sizePolicy"> | ||
429 | 531 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
430 | 532 | <horstretch>0</horstretch> | ||
431 | 533 | <verstretch>0</verstretch> | ||
432 | 534 | </sizepolicy> | ||
433 | 535 | </property> | ||
434 | 536 | <property name="minimumSize"> | ||
435 | 537 | <size> | ||
436 | 538 | <width>220</width> | ||
437 | 539 | <height>0</height> | ||
438 | 540 | </size> | ||
439 | 541 | </property> | ||
440 | 542 | <property name="maximumSize"> | ||
441 | 543 | <size> | ||
442 | 544 | <width>220</width> | ||
443 | 545 | <height>16777215</height> | ||
444 | 546 | </size> | ||
445 | 547 | </property> | ||
446 | 548 | <property name="text"> | ||
447 | 549 | <string notr="true">email_assistance</string> | ||
448 | 550 | </property> | ||
449 | 551 | <property name="alignment"> | ||
450 | 552 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
451 | 553 | </property> | ||
452 | 554 | <property name="wordWrap"> | ||
453 | 555 | <bool>true</bool> | ||
454 | 556 | </property> | ||
455 | 557 | </widget> | ||
456 | 558 | </item> | ||
457 | 559 | </layout> | ||
458 | 560 | </item> | ||
459 | 561 | <item row="4" column="1"> | ||
460 | 562 | <layout class="QVBoxLayout" name="verticalLayout_9"> | ||
461 | 563 | <property name="spacing"> | ||
462 | 564 | <number>0</number> | ||
463 | 565 | </property> | ||
464 | 566 | <property name="leftMargin"> | ||
465 | 567 | <number>0</number> | ||
466 | 568 | </property> | ||
467 | 569 | <item> | ||
468 | 570 | <widget class="QLabel" name="confirm_email_assistance"> | ||
469 | 571 | <property name="sizePolicy"> | ||
470 | 572 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | ||
471 | 573 | <horstretch>0</horstretch> | ||
472 | 574 | <verstretch>0</verstretch> | ||
473 | 575 | </sizepolicy> | ||
474 | 576 | </property> | ||
475 | 577 | <property name="minimumSize"> | ||
476 | 578 | <size> | ||
477 | 579 | <width>220</width> | ||
478 | 580 | <height>0</height> | ||
479 | 581 | </size> | ||
480 | 582 | </property> | ||
481 | 583 | <property name="maximumSize"> | ||
482 | 584 | <size> | ||
483 | 585 | <width>220</width> | ||
484 | 586 | <height>16777215</height> | ||
485 | 587 | </size> | ||
486 | 588 | </property> | ||
487 | 589 | <property name="text"> | ||
488 | 590 | <string notr="true">confirm_email_assistance</string> | ||
489 | 591 | </property> | ||
490 | 592 | <property name="alignment"> | ||
491 | 593 | <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> | ||
492 | 594 | </property> | ||
493 | 595 | <property name="wordWrap"> | ||
494 | 596 | <bool>true</bool> | ||
495 | 597 | </property> | ||
496 | 598 | <property name="indent"> | ||
497 | 599 | <number>0</number> | ||
498 | 600 | </property> | ||
499 | 601 | </widget> | ||
500 | 602 | </item> | ||
501 | 603 | </layout> | ||
502 | 604 | </item> | ||
503 | 605 | <item row="6" column="1" rowspan="2"> | ||
504 | 606 | <widget class="QLabel" name="password_assistance"> | ||
505 | 607 | <property name="sizePolicy"> | ||
506 | 608 | <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> | ||
507 | 609 | <horstretch>0</horstretch> | ||
508 | 610 | <verstretch>0</verstretch> | ||
509 | 611 | </sizepolicy> | ||
510 | 612 | </property> | ||
511 | 613 | <property name="minimumSize"> | ||
512 | 614 | <size> | ||
513 | 615 | <width>220</width> | ||
514 | 616 | <height>100</height> | ||
515 | 617 | </size> | ||
516 | 618 | </property> | ||
517 | 619 | <property name="maximumSize"> | ||
518 | 620 | <size> | ||
519 | 621 | <width>220</width> | ||
520 | 622 | <height>16777215</height> | ||
521 | 623 | </size> | ||
522 | 624 | </property> | ||
523 | 625 | <property name="text"> | ||
524 | 626 | <string notr="true">password_assistance</string> | ||
525 | 627 | </property> | ||
526 | 628 | <property name="wordWrap"> | ||
527 | 629 | <bool>true</bool> | ||
528 | 630 | </property> | ||
529 | 631 | <property name="indent"> | ||
530 | 632 | <number>17</number> | ||
531 | 633 | </property> | ||
532 | 634 | </widget> | ||
533 | 635 | </item> | ||
534 | 636 | <item row="2" column="1"> | ||
535 | 637 | <spacer name="verticalSpacer"> | ||
536 | 638 | <property name="orientation"> | ||
537 | 639 | <enum>Qt::Vertical</enum> | ||
538 | 640 | </property> | ||
539 | 641 | <property name="sizeType"> | ||
540 | 642 | <enum>QSizePolicy::Fixed</enum> | ||
541 | 643 | </property> | ||
542 | 644 | <property name="sizeHint" stdset="0"> | ||
543 | 645 | <size> | ||
544 | 646 | <width>20</width> | ||
545 | 647 | <height>15</height> | ||
546 | 648 | </size> | ||
547 | 649 | </property> | ||
548 | 650 | </spacer> | ||
549 | 651 | </item> | ||
550 | 652 | <item row="5" column="1"> | ||
551 | 653 | <spacer name="verticalSpacer_2"> | ||
552 | 654 | <property name="orientation"> | ||
553 | 655 | <enum>Qt::Vertical</enum> | ||
554 | 656 | </property> | ||
555 | 657 | <property name="sizeType"> | ||
556 | 658 | <enum>QSizePolicy::Fixed</enum> | ||
557 | 659 | </property> | ||
558 | 660 | <property name="sizeHint" stdset="0"> | ||
559 | 661 | <size> | ||
560 | 662 | <width>20</width> | ||
561 | 663 | <height>15</height> | ||
562 | 664 | </size> | ||
563 | 665 | </property> | ||
564 | 666 | </spacer> | ||
565 | 667 | </item> | ||
566 | 668 | <item row="8" column="1"> | ||
567 | 669 | <spacer name="verticalSpacer_3"> | ||
568 | 670 | <property name="orientation"> | ||
569 | 671 | <enum>Qt::Vertical</enum> | ||
570 | 672 | </property> | ||
571 | 673 | <property name="sizeType"> | ||
572 | 674 | <enum>QSizePolicy::Fixed</enum> | ||
573 | 675 | </property> | ||
574 | 676 | <property name="sizeHint" stdset="0"> | ||
575 | 677 | <size> | ||
576 | 678 | <width>20</width> | ||
577 | 679 | <height>15</height> | ||
578 | 680 | </size> | ||
579 | 681 | </property> | ||
580 | 682 | </spacer> | ||
581 | 683 | </item> | ||
582 | 684 | </layout> | ||
583 | 685 | </item> | ||
584 | 686 | <item> | ||
585 | 687 | <layout class="QHBoxLayout" name="hlayout_check"> | ||
586 | 688 | <property name="spacing"> | ||
587 | 689 | <number>0</number> | ||
588 | 690 | </property> | ||
589 | 691 | </layout> | 669 | </layout> |
590 | 692 | </item> | 670 | </item> |
591 | 693 | </layout> | 671 | </layout> |
592 | 694 | 672 | ||
593 | === modified file 'data/qt/stylesheet.qss' | |||
594 | --- data/qt/stylesheet.qss 2012-02-29 14:00:12 +0000 | |||
595 | +++ data/qt/stylesheet.qss 2012-03-01 20:49:18 +0000 | |||
596 | @@ -15,6 +15,7 @@ | |||
597 | 15 | 15 | ||
598 | 16 | QLabel#password_assistance { | 16 | QLabel#password_assistance { |
599 | 17 | border-image: url(":/balloon_shape.png"); | 17 | border-image: url(":/balloon_shape.png"); |
600 | 18 | font-size: 12px; | ||
601 | 18 | } | 19 | } |
602 | 19 | 20 | ||
603 | 20 | QLineEdit { | 21 | QLineEdit { |
604 | @@ -98,5 +99,12 @@ | |||
605 | 98 | } | 99 | } |
606 | 99 | 100 | ||
607 | 100 | QFrame#header { | 101 | QFrame#header { |
609 | 101 | padding: 10px; | 102 | padding-top: 1px; |
610 | 103 | padding-bottom: 1px; | ||
611 | 104 | } | ||
612 | 105 | |||
613 | 106 | QLabel#form_errors { | ||
614 | 107 | font: bold 14px; | ||
615 | 108 | color: #df2d1f; | ||
616 | 109 | padding-bottom: 1px; | ||
617 | 102 | } | 110 | } |
618 | 103 | 111 | ||
619 | === modified file 'ubuntu_sso/qt/__init__.py' | |||
620 | --- ubuntu_sso/qt/__init__.py 2012-02-23 20:16:46 +0000 | |||
621 | +++ ubuntu_sso/qt/__init__.py 2012-03-01 20:49:18 +0000 | |||
622 | @@ -21,7 +21,7 @@ | |||
623 | 21 | 21 | ||
624 | 22 | ERROR_ALL = '__all__' | 22 | ERROR_ALL = '__all__' |
625 | 23 | ERROR_MESSAGE = 'message' | 23 | ERROR_MESSAGE = 'message' |
627 | 24 | PREFERED_UI_SIZE = {'width': 550, 'height': 530} | 24 | PREFERED_UI_SIZE = {'width': 550, 'height': 525} |
628 | 25 | 25 | ||
629 | 26 | 26 | ||
630 | 27 | # Based on the gtk implementation | 27 | # Based on the gtk implementation |
631 | 28 | 28 | ||
632 | === modified file 'ubuntu_sso/qt/current_user_sign_in_page.py' | |||
633 | --- ubuntu_sso/qt/current_user_sign_in_page.py 2012-02-29 14:00:12 +0000 | |||
634 | +++ ubuntu_sso/qt/current_user_sign_in_page.py 2012-03-01 20:49:18 +0000 | |||
635 | @@ -91,6 +91,7 @@ | |||
636 | 91 | 91 | ||
637 | 92 | def cleanupPage(self): | 92 | def cleanupPage(self): |
638 | 93 | """Reset the wizard buttons.""" | 93 | """Reset the wizard buttons.""" |
639 | 94 | super(CurrentUserSignInPage, self).cleanupPage() | ||
640 | 94 | self.wizard().setButtonLayout([QtGui.QWizard.Stretch]) | 95 | self.wizard().setButtonLayout([QtGui.QWizard.Stretch]) |
641 | 95 | 96 | ||
642 | 96 | def _set_translated_strings(self): | 97 | def _set_translated_strings(self): |
643 | @@ -134,6 +135,7 @@ | |||
644 | 134 | else: | 135 | else: |
645 | 135 | f = self.backend.login | 136 | f = self.backend.login |
646 | 136 | 137 | ||
647 | 138 | self.hide_error() | ||
648 | 137 | self.show_overlay() | 139 | self.show_overlay() |
649 | 138 | error_handler = partial(self._handle_error, f, self.on_login_error) | 140 | error_handler = partial(self._handle_error, f, self.on_login_error) |
650 | 139 | f(*args, reply_handler=NO_OP, error_handler=error_handler) | 141 | f(*args, reply_handler=NO_OP, error_handler=error_handler) |
651 | @@ -143,9 +145,7 @@ | |||
652 | 143 | # let the user know | 145 | # let the user know |
653 | 144 | logger.error('Got error when login %s, error: %s', | 146 | logger.error('Got error when login %s, error: %s', |
654 | 145 | self.app_name, error) | 147 | self.app_name, error) |
658 | 146 | self.hide_overlay() | 148 | self.show_error(self.app_name, build_general_error_message(error)) |
656 | 147 | self.message_box.critical(self, self.app_name, | ||
657 | 148 | build_general_error_message(error)) | ||
659 | 149 | 149 | ||
660 | 150 | def on_logged_in(self, app_name, result): | 150 | def on_logged_in(self, app_name, result): |
661 | 151 | """We managed to log in.""" | 151 | """We managed to log in.""" |
662 | 152 | 152 | ||
663 | === modified file 'ubuntu_sso/qt/email_verification_page.py' | |||
664 | --- ubuntu_sso/qt/email_verification_page.py 2012-02-29 14:00:12 +0000 | |||
665 | +++ ubuntu_sso/qt/email_verification_page.py 2012-03-01 20:49:18 +0000 | |||
666 | @@ -106,6 +106,7 @@ | |||
667 | 106 | logger.debug('EmailVerificationController.validate_email') | 106 | logger.debug('EmailVerificationController.validate_email') |
668 | 107 | code = unicode(self.ui.verification_code_edit.text()) | 107 | code = unicode(self.ui.verification_code_edit.text()) |
669 | 108 | args = (self.app_name, self.email, self.password, code) | 108 | args = (self.app_name, self.email, self.password, code) |
670 | 109 | self.hide_error() | ||
671 | 109 | if self.ping_url: | 110 | if self.ping_url: |
672 | 110 | f = self.backend.validate_email_and_ping | 111 | f = self.backend.validate_email_and_ping |
673 | 111 | args = args + (self.ping_url,) | 112 | args = args + (self.ping_url,) |
674 | @@ -128,7 +129,7 @@ | |||
675 | 128 | """Signal thrown when there's a problem validating the email.""" | 129 | """Signal thrown when there's a problem validating the email.""" |
676 | 129 | msg = error.pop(ERROR_EMAIL_TOKEN, '') | 130 | msg = error.pop(ERROR_EMAIL_TOKEN, '') |
677 | 130 | msg += build_general_error_message(error) | 131 | msg += build_general_error_message(error) |
679 | 131 | self.message_box.critical(self, self.app_name, msg) | 132 | self.show_error(self.app_name, msg) |
680 | 132 | 133 | ||
681 | 133 | #pylint: disable=C0103 | 134 | #pylint: disable=C0103 |
682 | 134 | def initializePage(self): | 135 | def initializePage(self): |
683 | 135 | 136 | ||
684 | === modified file 'ubuntu_sso/qt/enhanced_check_box.py' | |||
685 | --- ubuntu_sso/qt/enhanced_check_box.py 2012-02-16 18:40:41 +0000 | |||
686 | +++ ubuntu_sso/qt/enhanced_check_box.py 2012-03-01 20:49:18 +0000 | |||
687 | @@ -32,7 +32,7 @@ | |||
688 | 32 | self.text_label.setOpenExternalLinks(True) | 32 | self.text_label.setOpenExternalLinks(True) |
689 | 33 | padding = self.iconSize().width() | 33 | padding = self.iconSize().width() |
690 | 34 | self.text_label.setStyleSheet("margin-top: -3px;" | 34 | self.text_label.setStyleSheet("margin-top: -3px;" |
692 | 35 | "padding-left: {0}px;".format(padding)) | 35 | "padding-left: 2px;") |
693 | 36 | hbox.setContentsMargins(padding, 0, 0, 0) | 36 | hbox.setContentsMargins(padding, 0, 0, 0) |
694 | 37 | hbox.addWidget(self.text_label) | 37 | hbox.addWidget(self.text_label) |
695 | 38 | self.setLayout(hbox) | 38 | self.setLayout(hbox) |
696 | 39 | 39 | ||
697 | === modified file 'ubuntu_sso/qt/forgotten_password_page.py' | |||
698 | --- ubuntu_sso/qt/forgotten_password_page.py 2012-02-29 14:00:12 +0000 | |||
699 | +++ ubuntu_sso/qt/forgotten_password_page.py 2012-03-01 20:49:18 +0000 | |||
700 | @@ -138,6 +138,7 @@ | |||
701 | 138 | 138 | ||
702 | 139 | def request_new_password(self): | 139 | def request_new_password(self): |
703 | 140 | """Send the request password operation.""" | 140 | """Send the request password operation.""" |
704 | 141 | self.hide_error() | ||
705 | 141 | args = (self.app_name, self.email_address) | 142 | args = (self.app_name, self.email_address) |
706 | 142 | f = self.backend.request_password_reset_token | 143 | f = self.backend.request_password_reset_token |
707 | 143 | 144 | ||
708 | @@ -154,6 +155,7 @@ | |||
709 | 154 | 155 | ||
710 | 155 | def on_try_again(self): | 156 | def on_try_again(self): |
711 | 156 | """Set back the widget to the initial state.""" | 157 | """Set back the widget to the initial state.""" |
712 | 158 | self.hide_error() | ||
713 | 157 | self.try_again_widget.setVisible(False) | 159 | self.try_again_widget.setVisible(False) |
714 | 158 | self.email_widget.setVisible(True) | 160 | self.email_widget.setVisible(True) |
715 | 159 | 161 | ||
716 | @@ -177,4 +179,4 @@ | |||
717 | 177 | self.email_widget.setVisible(False) | 179 | self.email_widget.setVisible(False) |
718 | 178 | self.forgotted_password_intro_label.setVisible(False) | 180 | self.forgotted_password_intro_label.setVisible(False) |
719 | 179 | self.try_again_widget.setVisible(True) | 181 | self.try_again_widget.setVisible(True) |
721 | 180 | self.message_box.critical(self, self.app_name, msg) | 182 | self.show_error(self.app_name, msg) |
722 | 181 | 183 | ||
723 | === modified file 'ubuntu_sso/qt/main.py' | |||
724 | --- ubuntu_sso/qt/main.py 2012-02-24 17:22:32 +0000 | |||
725 | +++ ubuntu_sso/qt/main.py 2012-03-01 20:49:18 +0000 | |||
726 | @@ -40,5 +40,9 @@ | |||
727 | 40 | 40 | ||
728 | 41 | # Unused variable 'ui', pylint: disable=W0612 | 41 | # Unused variable 'ui', pylint: disable=W0612 |
729 | 42 | ui = UbuntuSSOClientGUI(close_callback=app.exit, **kwargs) | 42 | ui = UbuntuSSOClientGUI(close_callback=app.exit, **kwargs) |
730 | 43 | style = QtGui.QStyle.alignedRect( | ||
731 | 44 | QtCore.Qt.LeftToRight, QtCore.Qt.AlignCenter, | ||
732 | 45 | ui.size(), app.desktop().availableGeometry()) | ||
733 | 46 | ui.setGeometry(style) | ||
734 | 43 | ui.show() | 47 | ui.show() |
735 | 44 | app.exec_() | 48 | app.exec_() |
736 | 45 | 49 | ||
737 | === modified file 'ubuntu_sso/qt/reset_password_page.py' | |||
738 | --- ubuntu_sso/qt/reset_password_page.py 2012-02-29 14:00:12 +0000 | |||
739 | +++ ubuntu_sso/qt/reset_password_page.py 2012-03-01 20:49:18 +0000 | |||
740 | @@ -166,12 +166,11 @@ | |||
741 | 166 | """Let the user know that there was an error.""" | 166 | """Let the user know that there was an error.""" |
742 | 167 | logger.error('Got error changing password for %s, error: %s', | 167 | logger.error('Got error changing password for %s, error: %s', |
743 | 168 | self.app_name, error) | 168 | self.app_name, error) |
747 | 169 | self.hide_overlay() | 169 | self.show_error(self.app_name, build_general_error_message(error)) |
745 | 170 | self.message_box.critical(self, self.app_name, | ||
746 | 171 | build_general_error_message(error)) | ||
748 | 172 | 170 | ||
749 | 173 | def set_new_password(self): | 171 | def set_new_password(self): |
750 | 174 | """Request a new password to be set.""" | 172 | """Request a new password to be set.""" |
751 | 173 | self.hide_error() | ||
752 | 175 | email = unicode(self.wizard().forgotten.ui.email_line_edit.text()) | 174 | email = unicode(self.wizard().forgotten.ui.email_line_edit.text()) |
753 | 176 | code = unicode(self.ui.reset_code_line_edit.text()) | 175 | code = unicode(self.ui.reset_code_line_edit.text()) |
754 | 177 | password = unicode(self.ui.password_line_edit.text()) | 176 | password = unicode(self.ui.password_line_edit.text()) |
755 | 178 | 177 | ||
756 | === modified file 'ubuntu_sso/qt/setup_account_page.py' | |||
757 | --- ubuntu_sso/qt/setup_account_page.py 2012-03-01 13:33:51 +0000 | |||
758 | +++ ubuntu_sso/qt/setup_account_page.py 2012-03-01 20:49:18 +0000 | |||
759 | @@ -144,7 +144,6 @@ | |||
760 | 144 | self.ui.confirm_email_label.setText(RETYPE_EMAIL) | 144 | self.ui.confirm_email_label.setText(RETYPE_EMAIL) |
761 | 145 | self.ui.password_label.setText(PASSWORD) | 145 | self.ui.password_label.setText(PASSWORD) |
762 | 146 | self.ui.confirm_password_label.setText(RETYPE_PASSWORD) | 146 | self.ui.confirm_password_label.setText(RETYPE_PASSWORD) |
763 | 147 | self.ui.password_info_label.hide() | ||
764 | 148 | 147 | ||
765 | 149 | # Button setup | 148 | # Button setup |
766 | 150 | self.wizard().setButtonLayout([ | 149 | self.wizard().setButtonLayout([ |
767 | @@ -172,7 +171,6 @@ | |||
768 | 172 | self.ui.password_label.setText(PASSWORD1_ENTRY) | 171 | self.ui.password_label.setText(PASSWORD1_ENTRY) |
769 | 173 | self.ui.confirm_password_label.setText(PASSWORD2_ENTRY) | 172 | self.ui.confirm_password_label.setText(PASSWORD2_ENTRY) |
770 | 174 | self.ui.password_edit.setToolTip(PASSWORD_HELP) | 173 | self.ui.password_edit.setToolTip(PASSWORD_HELP) |
771 | 175 | self.ui.password_info_label.setText(PASSWORD_HELP) | ||
772 | 176 | self.ui.captcha_solution_edit.setPlaceholderText( | 174 | self.ui.captcha_solution_edit.setPlaceholderText( |
773 | 177 | CAPTCHA_SOLUTION_ENTRY) | 175 | CAPTCHA_SOLUTION_ENTRY) |
774 | 178 | link = CAPTCHA_RELOAD_LINK % {'reload_text': CAPTCHA_RELOAD_TEXT} | 176 | link = CAPTCHA_RELOAD_LINK % {'reload_text': CAPTCHA_RELOAD_TEXT} |
775 | @@ -332,7 +330,7 @@ | |||
776 | 332 | def on_captcha_generation_error(self, error, *args, **kwargs): | 330 | def on_captcha_generation_error(self, error, *args, **kwargs): |
777 | 333 | """An error ocurred.""" | 331 | """An error ocurred.""" |
778 | 334 | logger.debug('SetUpAccountPage.on_captcha_generation_error') | 332 | logger.debug('SetUpAccountPage.on_captcha_generation_error') |
780 | 335 | self.message_box.critical(self, self.app_name, CAPTCHA_LOAD_ERROR) | 333 | self.show_error(self.app_name, CAPTCHA_LOAD_ERROR) |
781 | 336 | self.on_captcha_refresh_complete() | 334 | self.on_captcha_refresh_complete() |
782 | 337 | 335 | ||
783 | 338 | def on_user_registration_error(self, app_name, error): | 336 | def on_user_registration_error(self, app_name, error): |
784 | @@ -344,7 +342,7 @@ | |||
785 | 344 | self.set_error_message(self.ui.email_assistance, msg) | 342 | self.set_error_message(self.ui.email_assistance, msg) |
786 | 345 | error_msg = build_general_error_message(error) | 343 | error_msg = build_general_error_message(error) |
787 | 346 | if error_msg: | 344 | if error_msg: |
789 | 347 | self.message_box.critical(self, self.app_name, error_msg) | 345 | self.show_error(self.app_name, error_msg) |
790 | 348 | self._refresh_captcha() | 346 | self._refresh_captcha() |
791 | 349 | 347 | ||
792 | 350 | def on_user_registered(self, app_name, result): | 348 | def on_user_registered(self, app_name, result): |
793 | @@ -385,7 +383,7 @@ | |||
794 | 385 | messages.append(CAPTCHA_REQUIRED_ERROR) | 383 | messages.append(CAPTCHA_REQUIRED_ERROR) |
795 | 386 | if len(messages) > 0: | 384 | if len(messages) > 0: |
796 | 387 | condition = False | 385 | condition = False |
798 | 388 | self.message_box.critical(self, self.app_name, '\n'.join(messages)) | 386 | self.show_error(self.app_name, '\n'.join(messages)) |
799 | 389 | return condition | 387 | return condition |
800 | 390 | 388 | ||
801 | 391 | def set_next_validation(self): | 389 | def set_next_validation(self): |
802 | @@ -399,6 +397,7 @@ | |||
803 | 399 | # validate the current info of the form, try to perform the action | 397 | # validate the current info of the form, try to perform the action |
804 | 400 | # to register the user, and then move foward | 398 | # to register the user, and then move foward |
805 | 401 | if self.validate_form(): | 399 | if self.validate_form(): |
806 | 400 | self.hide_error() | ||
807 | 402 | args = (self.app_name, email, password, name, captcha_id, | 401 | args = (self.app_name, email, password, name, captcha_id, |
808 | 403 | captcha_solution) | 402 | captcha_solution) |
809 | 404 | f = self.backend.register_user | 403 | f = self.backend.register_user |
810 | 405 | 404 | ||
811 | === modified file 'ubuntu_sso/qt/sso_wizard_page.py' | |||
812 | --- ubuntu_sso/qt/sso_wizard_page.py 2012-02-29 14:31:45 +0000 | |||
813 | +++ ubuntu_sso/qt/sso_wizard_page.py 2012-03-01 20:49:18 +0000 | |||
814 | @@ -26,7 +26,6 @@ | |||
815 | 26 | QFontMetrics, | 26 | QFontMetrics, |
816 | 27 | QHBoxLayout, | 27 | QHBoxLayout, |
817 | 28 | QVBoxLayout, | 28 | QVBoxLayout, |
818 | 29 | QMessageBox, | ||
819 | 30 | QStyle, | 29 | QStyle, |
820 | 31 | QWizardPage, | 30 | QWizardPage, |
821 | 32 | QLabel, | 31 | QLabel, |
822 | @@ -50,7 +49,7 @@ | |||
823 | 50 | super(Header, self).__init__() | 49 | super(Header, self).__init__() |
824 | 51 | self.setObjectName('header') | 50 | self.setObjectName('header') |
825 | 52 | vbox = QVBoxLayout(self) | 51 | vbox = QVBoxLayout(self) |
827 | 53 | vbox.setContentsMargins(0, 0, 0, 10) | 52 | vbox.setContentsMargins(0, 0, 0, 0) |
828 | 54 | self.title_label = QLabel() | 53 | self.title_label = QLabel() |
829 | 55 | self.title_label.setWordWrap(True) | 54 | self.title_label.setWordWrap(True) |
830 | 56 | self.title_label.setObjectName('title_label') | 55 | self.title_label.setObjectName('title_label') |
831 | @@ -113,27 +112,48 @@ | |||
832 | 113 | self.policy_url = kwargs.get('policy_url', '') | 112 | self.policy_url = kwargs.get('policy_url', '') |
833 | 114 | self.help_text = kwargs.get('help_text', '') | 113 | self.help_text = kwargs.get('help_text', '') |
834 | 115 | 114 | ||
835 | 115 | # Set the error area | ||
836 | 116 | self.form_errors_label = QLabel(' ') | ||
837 | 117 | self.form_errors_label.setObjectName('form_errors') | ||
838 | 118 | self.form_errors_label.setAlignment(Qt.AlignBottom) | ||
839 | 119 | self.layout().insertWidget(0, self.form_errors_label) | ||
840 | 120 | # Set the header | ||
841 | 116 | self.header = Header() | 121 | self.header = Header() |
842 | 117 | self.header.set_title(title='') | 122 | self.header.set_title(title='') |
843 | 118 | self.header.set_subtitle(subtitle='') | 123 | self.header.set_subtitle(subtitle='') |
844 | 119 | self.layout().insertWidget(0, self.header) | 124 | self.layout().insertWidget(0, self.header) |
845 | 120 | |||
846 | 121 | self.message_box = QMessageBox | ||
847 | 122 | self._signals_receivers = {} | 125 | self._signals_receivers = {} |
848 | 123 | self.backend = None | 126 | self.backend = None |
849 | 124 | 127 | ||
850 | 128 | self.layout().setAlignment(Qt.AlignLeft) | ||
851 | 129 | |||
852 | 125 | self.setup_page() | 130 | self.setup_page() |
853 | 126 | 131 | ||
854 | 132 | def show_error(self, app_name, message): | ||
855 | 133 | """Show an error message inside the page.""" | ||
856 | 134 | self.hide_overlay() | ||
857 | 135 | fm = QFontMetrics(self.form_errors_label.font()) | ||
858 | 136 | width = PREFERED_UI_SIZE['width'] * 0.95 | ||
859 | 137 | elided_text = fm.elidedText(message, Qt.ElideRight, width) | ||
860 | 138 | self.form_errors_label.setText(elided_text) | ||
861 | 139 | self.form_errors_label.setToolTip(message) | ||
862 | 140 | |||
863 | 141 | def hide_error(self): | ||
864 | 142 | """Hide the label errors in the current page.""" | ||
865 | 143 | # We actually want the label with one chat, because if it is an | ||
866 | 144 | # empty string, the height of the label is 0 | ||
867 | 145 | self.form_errors_label.setText(' ') | ||
868 | 146 | |||
869 | 147 | def hide_overlay(self): | ||
870 | 148 | """Emit the signal to notify the upper container that ends loading.""" | ||
871 | 149 | self.setEnabled(True) | ||
872 | 150 | self.processingFinished.emit() | ||
873 | 151 | |||
874 | 127 | def show_overlay(self): | 152 | def show_overlay(self): |
875 | 128 | """Emit the signal to notify the upper container that is loading.""" | 153 | """Emit the signal to notify the upper container that is loading.""" |
876 | 129 | self.setEnabled(False) | 154 | self.setEnabled(False) |
877 | 130 | self.processingStarted.emit() | 155 | self.processingStarted.emit() |
878 | 131 | 156 | ||
879 | 132 | def hide_overlay(self): | ||
880 | 133 | """Emit the signal to notify the upper container that ends loading.""" | ||
881 | 134 | self.setEnabled(True) | ||
882 | 135 | self.processingFinished.emit() | ||
883 | 136 | |||
884 | 137 | @defer.inlineCallbacks | 157 | @defer.inlineCallbacks |
885 | 138 | def setup_page(self): | 158 | def setup_page(self): |
886 | 139 | """Setup the widget components.""" | 159 | """Setup the widget components.""" |
887 | @@ -145,6 +165,11 @@ | |||
888 | 145 | self._connect_ui() | 165 | self._connect_ui() |
889 | 146 | 166 | ||
890 | 147 | # pylint: disable=C0103 | 167 | # pylint: disable=C0103 |
891 | 168 | |||
892 | 169 | def cleanupPage(self): | ||
893 | 170 | """Hide the errors.""" | ||
894 | 171 | self.hide_error() | ||
895 | 172 | |||
896 | 148 | def setTitle(self, title=''): | 173 | def setTitle(self, title=''): |
897 | 149 | """Set the Wizard Page Title.""" | 174 | """Set the Wizard Page Title.""" |
898 | 150 | self.header.set_title(title) | 175 | self.header.set_title(title) |
899 | 151 | 176 | ||
900 | === modified file 'ubuntu_sso/qt/tests/test_current_user_sign_in_page.py' | |||
901 | --- ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-02-29 14:00:12 +0000 | |||
902 | +++ ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-03-01 20:49:18 +0000 | |||
903 | @@ -111,6 +111,7 @@ | |||
904 | 111 | 111 | ||
905 | 112 | def test_login_with_ping(self): | 112 | def test_login_with_ping(self): |
906 | 113 | """Test the login method.""" | 113 | """Test the login method.""" |
907 | 114 | self.patch(self.ui, "hide_error", self._set_called) | ||
908 | 114 | email = 'valid@email' | 115 | email = 'valid@email' |
909 | 115 | password = '123456' | 116 | password = '123456' |
910 | 116 | self.ui.ui.email_edit.setText(email) | 117 | self.ui.ui.email_edit.setText(email) |
911 | @@ -120,9 +121,12 @@ | |||
912 | 120 | self.assertFalse(self.ui.isEnabled()) | 121 | self.assertFalse(self.ui.isEnabled()) |
913 | 121 | self.assert_backend_called('login_and_ping', | 122 | self.assert_backend_called('login_and_ping', |
914 | 122 | self.app_name, email, password, self.ping_url) | 123 | self.app_name, email, password, self.ping_url) |
915 | 124 | expected = ((), {}) | ||
916 | 125 | self.assertEqual(expected, self._called) | ||
917 | 123 | 126 | ||
918 | 124 | def test_login_without_ping(self): | 127 | def test_login_without_ping(self): |
919 | 125 | """Test the login method.""" | 128 | """Test the login method.""" |
920 | 129 | self.patch(self.ui, "hide_error", self._set_called) | ||
921 | 126 | self.ui.ping_url = '' | 130 | self.ui.ping_url = '' |
922 | 127 | email = 'valid@email' | 131 | email = 'valid@email' |
923 | 128 | password = '123456' | 132 | password = '123456' |
924 | @@ -133,15 +137,17 @@ | |||
925 | 133 | self.assertFalse(self.ui.isEnabled()) | 137 | self.assertFalse(self.ui.isEnabled()) |
926 | 134 | self.assert_backend_called('login', | 138 | self.assert_backend_called('login', |
927 | 135 | self.app_name, email, password) | 139 | self.app_name, email, password) |
928 | 140 | expected = ((), {}) | ||
929 | 141 | self.assertEqual(expected, self._called) | ||
930 | 136 | 142 | ||
931 | 137 | def test_on_login_error(self): | 143 | def test_on_login_error(self): |
932 | 138 | """Test the on_login_error method.""" | 144 | """Test the on_login_error method.""" |
934 | 139 | self.patch(self.ui.message_box, "critical", self._set_called) | 145 | self.patch(self.ui, "show_error", self._set_called) |
935 | 140 | app_name = 'my_app' | 146 | app_name = 'my_app' |
936 | 141 | self.ui.app_name = app_name | 147 | self.ui.app_name = app_name |
937 | 142 | error = {'errtype': 'UserNotValidated'} | 148 | error = {'errtype': 'UserNotValidated'} |
938 | 143 | self.ui.on_login_error(app_name, error) | 149 | self.ui.on_login_error(app_name, error) |
940 | 144 | self.assertEqual(self._overlay_hide_counter, 1) | 150 | self.assertEqual(self._overlay_hide_counter, 0) |
941 | 145 | self.assertTrue(self.ui.isEnabled()) | 151 | self.assertTrue(self.ui.isEnabled()) |
942 | 146 | expected = ((self.ui, 'my_app', ''), {}) | 152 | expected = ((self.ui, 'my_app', ''), {}) |
943 | 147 | self.assertTrue(expected, self._called) | 153 | self.assertTrue(expected, self._called) |
944 | 148 | 154 | ||
945 | === modified file 'ubuntu_sso/qt/tests/test_email_verification.py' | |||
946 | --- ubuntu_sso/qt/tests/test_email_verification.py 2012-02-29 14:00:12 +0000 | |||
947 | +++ ubuntu_sso/qt/tests/test_email_verification.py 2012-03-01 20:49:18 +0000 | |||
948 | @@ -99,7 +99,7 @@ | |||
949 | 99 | 99 | ||
950 | 100 | def test_on_email_validation_error(self): | 100 | def test_on_email_validation_error(self): |
951 | 101 | """Test the validate_email method.""" | 101 | """Test the validate_email method.""" |
953 | 102 | self.patch(self.ui.message_box, "critical", self._set_called) | 102 | self.patch(self.ui, "show_error", self._set_called) |
954 | 103 | app_name = 'my_app' | 103 | app_name = 'my_app' |
955 | 104 | error = {email_verification_page: 'error in email_verification_page'} | 104 | error = {email_verification_page: 'error in email_verification_page'} |
956 | 105 | self.ui.on_email_validation_error(app_name, error) | 105 | self.ui.on_email_validation_error(app_name, error) |
957 | @@ -122,6 +122,7 @@ | |||
958 | 122 | 122 | ||
959 | 123 | def test_validate_email_with_ping(self): | 123 | def test_validate_email_with_ping(self): |
960 | 124 | """Test the login method.""" | 124 | """Test the login method.""" |
961 | 125 | self.patch(self.ui, "hide_error", self._set_called) | ||
962 | 125 | email = 'email@example.com' | 126 | email = 'email@example.com' |
963 | 126 | password = 'password' | 127 | password = 'password' |
964 | 127 | code = 'code' | 128 | code = 'code' |
965 | @@ -133,9 +134,12 @@ | |||
966 | 133 | 134 | ||
967 | 134 | self.assert_backend_called('validate_email_and_ping', | 135 | self.assert_backend_called('validate_email_and_ping', |
968 | 135 | self.app_name, email, password, code, self.ping_url) | 136 | self.app_name, email, password, code, self.ping_url) |
969 | 137 | expected = ((), {}) | ||
970 | 138 | self.assertEqual(expected, self._called) | ||
971 | 136 | 139 | ||
972 | 137 | def test_validate_email_without_ping(self): | 140 | def test_validate_email_without_ping(self): |
973 | 138 | """Test the login method.""" | 141 | """Test the login method.""" |
974 | 142 | self.patch(self.ui, "hide_error", self._set_called) | ||
975 | 139 | self.ui.ping_url = '' | 143 | self.ui.ping_url = '' |
976 | 140 | email = 'email@example.com' | 144 | email = 'email@example.com' |
977 | 141 | password = 'password' | 145 | password = 'password' |
978 | @@ -148,3 +152,5 @@ | |||
979 | 148 | 152 | ||
980 | 149 | self.assert_backend_called('validate_email', | 153 | self.assert_backend_called('validate_email', |
981 | 150 | self.app_name, email, password, code) | 154 | self.app_name, email, password, code) |
982 | 155 | expected = ((), {}) | ||
983 | 156 | self.assertEqual(expected, self._called) | ||
984 | 151 | 157 | ||
985 | === modified file 'ubuntu_sso/qt/tests/test_forgotten_password.py' | |||
986 | --- ubuntu_sso/qt/tests/test_forgotten_password.py 2012-02-29 14:00:12 +0000 | |||
987 | +++ ubuntu_sso/qt/tests/test_forgotten_password.py 2012-03-01 20:49:18 +0000 | |||
988 | @@ -85,9 +85,12 @@ | |||
989 | 85 | 85 | ||
990 | 86 | def test_send_button_clicked(self): | 86 | def test_send_button_clicked(self): |
991 | 87 | """Test the send_button property.""" | 87 | """Test the send_button property.""" |
992 | 88 | self.patch(self.ui, "hide_error", self._set_called) | ||
993 | 88 | self.ui.send_button.clicked.emit(True) | 89 | self.ui.send_button.clicked.emit(True) |
994 | 89 | self.assert_backend_called('request_password_reset_token', | 90 | self.assert_backend_called('request_password_reset_token', |
995 | 90 | self.app_name, '') | 91 | self.app_name, '') |
996 | 92 | expected = ((), {}) | ||
997 | 93 | self.assertEqual(expected, self._called) | ||
998 | 91 | 94 | ||
999 | 92 | def test_try_again_widget(self): | 95 | def test_try_again_widget(self): |
1000 | 93 | """Test the try_again_widget property.""" | 96 | """Test the try_again_widget property.""" |
1001 | @@ -157,11 +160,14 @@ | |||
1002 | 157 | 160 | ||
1003 | 158 | def test_on_try_again(self): | 161 | def test_on_try_again(self): |
1004 | 159 | """Test on_try_again method.""" | 162 | """Test on_try_again method.""" |
1005 | 163 | self.patch(self.ui, "hide_error", self._set_called) | ||
1006 | 160 | self.ui.show() | 164 | self.ui.show() |
1007 | 161 | self.addCleanup(self.ui.hide) | 165 | self.addCleanup(self.ui.hide) |
1008 | 162 | self.ui.on_try_again() | 166 | self.ui.on_try_again() |
1009 | 163 | self.assertTrue(self.ui.email_widget.isVisible()) | 167 | self.assertTrue(self.ui.email_widget.isVisible()) |
1010 | 164 | self.assertFalse(self.ui.try_again_widget.isVisible()) | 168 | self.assertFalse(self.ui.try_again_widget.isVisible()) |
1011 | 169 | expected = ((), {}) | ||
1012 | 170 | self.assertEqual(expected, self._called) | ||
1013 | 165 | 171 | ||
1014 | 166 | def test_on_password_reset_token_sent(self): | 172 | def test_on_password_reset_token_sent(self): |
1015 | 167 | """Test on_password_reset_token_sent method.""" | 173 | """Test on_password_reset_token_sent method.""" |
1016 | @@ -177,7 +183,7 @@ | |||
1017 | 177 | 183 | ||
1018 | 178 | def test_on_password_reset_error(self): | 184 | def test_on_password_reset_error(self): |
1019 | 179 | """Test on_password_reset_error method.""" | 185 | """Test on_password_reset_error method.""" |
1021 | 180 | self.patch(self.ui.message_box, "critical", self._set_called) | 186 | self.patch(self.ui, "show_error", self._set_called) |
1022 | 181 | app_name = 'my_app' | 187 | app_name = 'my_app' |
1023 | 182 | error = {'errtype': 'AnotherError'} | 188 | error = {'errtype': 'AnotherError'} |
1024 | 183 | self.ui.show() | 189 | self.ui.show() |
1025 | @@ -194,7 +200,7 @@ | |||
1026 | 194 | 200 | ||
1027 | 195 | def test_on_password_reset_error_with_token_error(self): | 201 | def test_on_password_reset_error_with_token_error(self): |
1028 | 196 | """Test on_password_reset_error method.""" | 202 | """Test on_password_reset_error method.""" |
1030 | 197 | self.patch(self.ui.message_box, "critical", self._set_called) | 203 | self.patch(self.ui, "show_error", self._set_called) |
1031 | 198 | app_name = 'my_app' | 204 | app_name = 'my_app' |
1032 | 199 | error = {'errtype': 'ResetPasswordTokenError'} | 205 | error = {'errtype': 'ResetPasswordTokenError'} |
1033 | 200 | self.ui.on_password_reset_error(app_name, error) | 206 | self.ui.on_password_reset_error(app_name, error) |
1034 | 201 | 207 | ||
1035 | === modified file 'ubuntu_sso/qt/tests/test_reset_password.py' | |||
1036 | --- ubuntu_sso/qt/tests/test_reset_password.py 2012-02-23 19:49:02 +0000 | |||
1037 | +++ ubuntu_sso/qt/tests/test_reset_password.py 2012-03-01 20:49:18 +0000 | |||
1038 | @@ -128,6 +128,7 @@ | |||
1039 | 128 | 128 | ||
1040 | 129 | def test_set_new_password(self): | 129 | def test_set_new_password(self): |
1041 | 130 | """Test set_new_password method.""" | 130 | """Test set_new_password method.""" |
1042 | 131 | self.patch(self.ui, "hide_error", self._set_called) | ||
1043 | 131 | email = 'email@example.com' | 132 | email = 'email@example.com' |
1044 | 132 | code = 'code' | 133 | code = 'code' |
1045 | 133 | password = 'password' | 134 | password = 'password' |
1046 | @@ -141,3 +142,5 @@ | |||
1047 | 141 | 142 | ||
1048 | 142 | self.assert_backend_called('set_new_password', | 143 | self.assert_backend_called('set_new_password', |
1049 | 143 | self.app_name, email, code, password) | 144 | self.app_name, email, code, password) |
1050 | 145 | expected = ((), {}) | ||
1051 | 146 | self.assertEqual(expected, self._called) | ||
1052 | 144 | 147 | ||
1053 | === modified file 'ubuntu_sso/qt/tests/test_setup_account.py' | |||
1054 | --- ubuntu_sso/qt/tests/test_setup_account.py 2012-02-29 14:00:12 +0000 | |||
1055 | +++ ubuntu_sso/qt/tests/test_setup_account.py 2012-03-01 20:49:18 +0000 | |||
1056 | @@ -152,6 +152,7 @@ | |||
1057 | 152 | def test_on_user_registered(self): | 152 | def test_on_user_registered(self): |
1058 | 153 | """Test on_user_registered method.""" | 153 | """Test on_user_registered method.""" |
1059 | 154 | self.patch(self.ui, "validate_form", lambda: True) | 154 | self.patch(self.ui, "validate_form", lambda: True) |
1060 | 155 | self.patch(self.ui, "hide_error", self._set_called) | ||
1061 | 155 | 156 | ||
1062 | 156 | email = 'email@example' | 157 | email = 'email@example' |
1063 | 157 | password = 'password' | 158 | password = 'password' |
1064 | @@ -176,6 +177,8 @@ | |||
1065 | 176 | self.assert_backend_called('register_user', | 177 | self.assert_backend_called('register_user', |
1066 | 177 | self.app_name, email, password, name, captcha_id, | 178 | self.app_name, email, password, name, captcha_id, |
1067 | 178 | captcha_solution) | 179 | captcha_solution) |
1068 | 180 | expected = ((), {}) | ||
1069 | 181 | self.assertEqual(expected, self._called) | ||
1070 | 179 | 182 | ||
1071 | 180 | def test_set_next_validation(self): | 183 | def test_set_next_validation(self): |
1072 | 181 | """Test on_user_registered method.""" | 184 | """Test on_user_registered method.""" |
1073 | @@ -238,7 +241,6 @@ | |||
1074 | 238 | setup_account_page.PASSWORD) | 241 | setup_account_page.PASSWORD) |
1075 | 239 | self.assertEqual(self.ui.ui.confirm_password_label.text(), | 242 | self.assertEqual(self.ui.ui.confirm_password_label.text(), |
1076 | 240 | setup_account_page.RETYPE_PASSWORD) | 243 | setup_account_page.RETYPE_PASSWORD) |
1077 | 241 | self.assertFalse(self.ui.ui.password_info_label.isVisible()) | ||
1078 | 242 | 244 | ||
1079 | 243 | # assistants | 245 | # assistants |
1080 | 244 | self.assertFalse(self.ui.ui.name_assistance.isVisible()) | 246 | self.assertFalse(self.ui.ui.name_assistance.isVisible()) |
1081 | 245 | 247 | ||
1082 | === modified file 'ubuntu_sso/qt/tests/test_sso_wizard_page.py' | |||
1083 | --- ubuntu_sso/qt/tests/test_sso_wizard_page.py 2012-02-24 15:52:33 +0000 | |||
1084 | +++ ubuntu_sso/qt/tests/test_sso_wizard_page.py 2012-03-01 20:49:18 +0000 | |||
1085 | @@ -19,6 +19,7 @@ | |||
1086 | 19 | from twisted.internet import defer | 19 | from twisted.internet import defer |
1087 | 20 | 20 | ||
1088 | 21 | from ubuntu_sso.qt import PREFERED_UI_SIZE | 21 | from ubuntu_sso.qt import PREFERED_UI_SIZE |
1089 | 22 | from ubuntu_sso.qt.setup_account_page import SetupAccountPage | ||
1090 | 22 | from ubuntu_sso.qt.sso_wizard_page import Header | 23 | from ubuntu_sso.qt.sso_wizard_page import Header |
1091 | 23 | from ubuntu_sso.qt.tests import BaseTestCase | 24 | from ubuntu_sso.qt.tests import BaseTestCase |
1092 | 24 | 25 | ||
1093 | @@ -81,3 +82,41 @@ | |||
1094 | 81 | """Check if the widget is hidden for empty subtitle.""" | 82 | """Check if the widget is hidden for empty subtitle.""" |
1095 | 82 | self.header.set_title('') | 83 | self.header.set_title('') |
1096 | 83 | self.assertFalse(self.header.title_label.isVisible()) | 84 | self.assertFalse(self.header.title_label.isVisible()) |
1097 | 85 | |||
1098 | 86 | |||
1099 | 87 | class SSOWizardPageTest(BaseTestCase): | ||
1100 | 88 | |||
1101 | 89 | """Tests for SSOWizardPage.""" | ||
1102 | 90 | |||
1103 | 91 | @defer.inlineCallbacks | ||
1104 | 92 | def setUp(self): | ||
1105 | 93 | yield super(SSOWizardPageTest, self).setUp() | ||
1106 | 94 | self.app_name = 'app_name' | ||
1107 | 95 | # We need to choose some specific page to test SSOWizardPage, | ||
1108 | 96 | # because the __init__ of SSOWizardPage fails by its own. | ||
1109 | 97 | self.sso_wizard_page = SetupAccountPage(self.app_name) | ||
1110 | 98 | |||
1111 | 99 | def test_show_error(self): | ||
1112 | 100 | """Test show_error with a normal length string.""" | ||
1113 | 101 | message = 'error-message' | ||
1114 | 102 | self.sso_wizard_page.show_error(self.app_name, message) | ||
1115 | 103 | self.assertEqual( | ||
1116 | 104 | self.sso_wizard_page.form_errors_label.toolTip(), message) | ||
1117 | 105 | expected = unicode(self.sso_wizard_page.form_errors_label.text()) | ||
1118 | 106 | self.assertEqual(expected, message) | ||
1119 | 107 | |||
1120 | 108 | def test_show_error_long_text(self): | ||
1121 | 109 | """Test show_error with a long length string.""" | ||
1122 | 110 | message = 'a' * int(PREFERED_UI_SIZE['width'] * 0.95) + 'a' | ||
1123 | 111 | self.sso_wizard_page.show_error(self.app_name, message) | ||
1124 | 112 | self.assertEqual( | ||
1125 | 113 | self.sso_wizard_page.form_errors_label.toolTip(), message) | ||
1126 | 114 | expected = unicode(self.sso_wizard_page.form_errors_label.text()) | ||
1127 | 115 | self.assertTrue(expected.endswith(u'\u2026')) | ||
1128 | 116 | |||
1129 | 117 | def test_hide_error(self): | ||
1130 | 118 | """Test show_error with a long length string.""" | ||
1131 | 119 | message = ' ' | ||
1132 | 120 | self.sso_wizard_page.hide_error() | ||
1133 | 121 | self.assertEqual( | ||
1134 | 122 | self.sso_wizard_page.form_errors_label.text(), message) | ||
1135 | 84 | 123 | ||
1136 | === modified file 'ubuntu_sso/qt/tests/test_ubuntu_sso_wizard.py' | |||
1137 | --- ubuntu_sso/qt/tests/test_ubuntu_sso_wizard.py 2012-02-29 17:33:56 +0000 | |||
1138 | +++ ubuntu_sso/qt/tests/test_ubuntu_sso_wizard.py 2012-03-01 20:49:18 +0000 | |||
1139 | @@ -105,8 +105,10 @@ | |||
1140 | 105 | self.ui.show() | 105 | self.ui.show() |
1141 | 106 | self.addCleanup(self.ui.hide) | 106 | self.addCleanup(self.ui.hide) |
1142 | 107 | size = self.ui.size() | 107 | size = self.ui.size() |
1145 | 108 | self.assertTrue(size.height() >= PREFERED_UI_SIZE['height']) | 108 | # pylint: disable=E1101 |
1146 | 109 | self.assertEqual(size.width(), PREFERED_UI_SIZE['width']) | 109 | self.assertGreaterEqual(size.height(), PREFERED_UI_SIZE['height']) |
1147 | 110 | self.assertGreaterEqual(size.width(), PREFERED_UI_SIZE['width']) | ||
1148 | 111 | # pylint: enable=E1101 | ||
1149 | 110 | 112 | ||
1150 | 111 | def test_move_to_success_page_state(self): | 113 | def test_move_to_success_page_state(self): |
1151 | 112 | """Test _move_to_success_page method.""" | 114 | """Test _move_to_success_page method.""" |
I'm getting all these:
== Python Lint Notices ==
ubuntu_ sso/qt/ current_ user_sign_ in_page. py: InPage. on_login_ error] Too many positional arguments for function call
158: [E1121, CurrentUserSign
ubuntu_ sso/qt/ email_verificat ion_page. py: onPage. on_email_ validation_ error] Too many positional arguments for function call
135: [E1121, EmailVerificati
ubuntu_ sso/qt/ forgotten_ password_ page.py: rdPage. on_password_ reset_error] Too many positional arguments for function call
189: [E1121, ForgottenPasswo
ubuntu_ sso/qt/ reset_password_ page.py: ge.on_password_ change_ error] Too many positional arguments for function call
183: [E1121, ResetPasswordPa
ubuntu_ sso/qt/ setup_account_ page.py: e.on_user_ registration_ error] Too many positional arguments for function call e.validate_ form] Too many positional arguments for function call
350: [E1121, SetupAccountPag
391: [E1121, SetupAccountPag
nessita@ dali:~/ canonical/ ussoc/review_ show-errors$