Ubuntu Single Sign On Client

Merge lp:~nataliabidart/ubuntu-sso-client/login-titles into lp:ubuntu-sso-client

Proposed by Natalia Bidart on 2012-03-05
Status: Merged
Approved by: Natalia Bidart on 2012-03-06
Approved revision: 907
Merged at revision: 901
Proposed branch: lp:~nataliabidart/ubuntu-sso-client/login-titles
Merge into: lp:ubuntu-sso-client
Diff against target: 2960 lines (+814/-1096) 25 files modified
To merge this branch: bzr merge lp:~nataliabidart/ubuntu-sso-client/login-titles
Reviewer Review Type Date Requested Status
Roberto Alsina Approve on 2012-03-06
Diego Sarmentero 2012-03-05 Approve on 2012-03-05
Review via email: mp+95991@code.launchpad.net

Commit Message

- Add proper titles and subtitles for the Login and Forgot password pages
  (LP: #945061).
- Made UI modules to setup the gui logging logger (LP: #947469).

To post a comment you must log in.
905. By Natalia Bidart on 2012-03-05

Wrong order!

906. By Natalia Bidart on 2012-03-05

- Attach bug number.

Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
907. By Natalia Bidart on 2012-03-05

Setup account xml cleanup.

Roberto Alsina (ralsina) wrote :

+1

review: Approve

Preview Diff

1=== modified file 'data/qt/current_user_sign_in.ui'
2--- data/qt/current_user_sign_in.ui 2012-02-22 16:58:08 +0000
3+++ data/qt/current_user_sign_in.ui 2012-03-05 21:55:21 +0000
4@@ -6,147 +6,100 @@
5 <rect>
6 <x>0</x>
7 <y>0</y>
8- <width>399</width>
9- <height>309</height>
10+ <width>302</width>
11+ <height>244</height>
12 </rect>
13 </property>
14- <layout class="QVBoxLayout" name="verticalLayout_4">
15- <property name="topMargin">
16+ <layout class="QVBoxLayout" name="verticalLayout_2">
17+ <property name="spacing">
18+ <number>15</number>
19+ </property>
20+ <property name="margin">
21 <number>0</number>
22 </property>
23 <item>
24- <layout class="QHBoxLayout" name="horizontalLayout_3">
25- <item>
26- <layout class="QVBoxLayout" name="verticalLayout">
27- <item>
28- <spacer name="verticalSpacer_3">
29- <property name="orientation">
30- <enum>Qt::Vertical</enum>
31- </property>
32- <property name="sizeHint" stdset="0">
33- <size>
34- <width>20</width>
35- <height>40</height>
36- </size>
37- </property>
38- </spacer>
39- </item>
40- <item>
41- <widget class="QFrame" name="_signInFrame">
42- <property name="frameShape">
43- <enum>QFrame::NoFrame</enum>
44- </property>
45- <layout class="QVBoxLayout" name="verticalLayout_3">
46- <item>
47- <layout class="QVBoxLayout" name="verticalLayout_2">
48- <item>
49- <widget class="QLabel" name="email_label">
50- <property name="text">
51- <string notr="true">&amp;Email</string>
52- </property>
53- <property name="buddy">
54- <cstring>email_edit</cstring>
55- </property>
56- </widget>
57- </item>
58- <item>
59- <widget class="QLineEdit" name="email_edit">
60- <property name="placeholderText">
61- <string/>
62- </property>
63- </widget>
64- </item>
65- <item>
66- <widget class="QLabel" name="password_label">
67- <property name="text">
68- <string notr="true">&amp;Password</string>
69- </property>
70- <property name="buddy">
71- <cstring>password_edit</cstring>
72- </property>
73- </widget>
74- </item>
75- <item>
76- <widget class="QLineEdit" name="password_edit">
77- <property name="echoMode">
78- <enum>QLineEdit::Password</enum>
79- </property>
80- <property name="placeholderText">
81- <string/>
82- </property>
83- </widget>
84- </item>
85- <item>
86- <widget class="QLabel" name="forgot_password_label">
87- <property name="sizePolicy">
88- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
89- <horstretch>0</horstretch>
90- <verstretch>0</verstretch>
91- </sizepolicy>
92- </property>
93- <property name="text">
94- <string notr="true">Forgot password?</string>
95- </property>
96- </widget>
97- </item>
98- <item>
99- <layout class="QHBoxLayout" name="horizontalLayout_4">
100- <item>
101- <spacer name="horizontalSpacer_3">
102- <property name="orientation">
103- <enum>Qt::Horizontal</enum>
104- </property>
105- <property name="sizeHint" stdset="0">
106- <size>
107- <width>40</width>
108- <height>20</height>
109- </size>
110- </property>
111- </spacer>
112- </item>
113- <item>
114- <widget class="QPushButton" name="sign_in_button">
115- <property name="enabled">
116- <bool>false</bool>
117- </property>
118- <property name="text">
119- <string notr="true">Sign In</string>
120- </property>
121- <property name="default">
122- <bool>true</bool>
123- </property>
124- </widget>
125- </item>
126- </layout>
127- </item>
128- </layout>
129- </item>
130- </layout>
131- </widget>
132- </item>
133- <item>
134- <spacer name="verticalSpacer_2">
135- <property name="orientation">
136- <enum>Qt::Vertical</enum>
137- </property>
138- <property name="sizeHint" stdset="0">
139- <size>
140- <width>20</width>
141- <height>40</height>
142- </size>
143- </property>
144- </spacer>
145- </item>
146- </layout>
147- </item>
148- <item>
149- <spacer name="horizontalSpacer">
150+ <layout class="QVBoxLayout" name="verticalLayout">
151+ <property name="spacing">
152+ <number>3</number>
153+ </property>
154+ <item>
155+ <widget class="QLabel" name="email_label">
156+ <property name="text">
157+ <string notr="true">&amp;Email</string>
158+ </property>
159+ <property name="buddy">
160+ <cstring>email_edit</cstring>
161+ </property>
162+ </widget>
163+ </item>
164+ <item>
165+ <widget class="QLineEdit" name="email_edit">
166+ <property name="minimumSize">
167+ <size>
168+ <width>300</width>
169+ <height>0</height>
170+ </size>
171+ </property>
172+ <property name="placeholderText">
173+ <string/>
174+ </property>
175+ </widget>
176+ </item>
177+ </layout>
178+ </item>
179+ <item>
180+ <layout class="QVBoxLayout" name="verticalLayout_3">
181+ <property name="spacing">
182+ <number>3</number>
183+ </property>
184+ <item>
185+ <widget class="QLabel" name="password_label">
186+ <property name="text">
187+ <string notr="true">&amp;Password</string>
188+ </property>
189+ <property name="buddy">
190+ <cstring>password_edit</cstring>
191+ </property>
192+ </widget>
193+ </item>
194+ <item>
195+ <widget class="QLineEdit" name="password_edit">
196+ <property name="minimumSize">
197+ <size>
198+ <width>300</width>
199+ <height>0</height>
200+ </size>
201+ </property>
202+ <property name="echoMode">
203+ <enum>QLineEdit::Password</enum>
204+ </property>
205+ <property name="placeholderText">
206+ <string/>
207+ </property>
208+ </widget>
209+ </item>
210+ </layout>
211+ </item>
212+ <item>
213+ <widget class="QLabel" name="forgot_password_label">
214+ <property name="sizePolicy">
215+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
216+ <horstretch>0</horstretch>
217+ <verstretch>0</verstretch>
218+ </sizepolicy>
219+ </property>
220+ <property name="text">
221+ <string notr="true">Forgot password?</string>
222+ </property>
223+ </widget>
224+ </item>
225+ <item>
226+ <layout class="QHBoxLayout" name="horizontalLayout_4">
227+ <item>
228+ <spacer name="horizontalSpacer_3">
229 <property name="orientation">
230 <enum>Qt::Horizontal</enum>
231 </property>
232- <property name="sizeType">
233- <enum>QSizePolicy::Fixed</enum>
234- </property>
235 <property name="sizeHint" stdset="0">
236 <size>
237 <width>40</width>
238@@ -155,9 +108,38 @@
239 </property>
240 </spacer>
241 </item>
242+ <item>
243+ <widget class="QPushButton" name="sign_in_button">
244+ <property name="enabled">
245+ <bool>false</bool>
246+ </property>
247+ <property name="text">
248+ <string notr="true">Sign In</string>
249+ </property>
250+ <property name="default">
251+ <bool>true</bool>
252+ </property>
253+ </widget>
254+ </item>
255 </layout>
256 </item>
257+ <item>
258+ <spacer name="verticalSpacer">
259+ <property name="orientation">
260+ <enum>Qt::Vertical</enum>
261+ </property>
262+ <property name="sizeHint" stdset="0">
263+ <size>
264+ <width>20</width>
265+ <height>40</height>
266+ </size>
267+ </property>
268+ </spacer>
269+ </item>
270 </layout>
271+ <zorder>verticalSpacer</zorder>
272+ <zorder>forgot_password_label</zorder>
273+ <zorder></zorder>
274 </widget>
275 <resources/>
276 <connections>
277
278=== modified file 'data/qt/email_verification.ui'
279--- data/qt/email_verification.ui 2012-02-22 16:58:08 +0000
280+++ data/qt/email_verification.ui 2012-03-05 21:55:21 +0000
281@@ -6,79 +6,51 @@
282 <rect>
283 <x>0</x>
284 <y>0</y>
285- <width>400</width>
286- <height>300</height>
287+ <width>300</width>
288+ <height>148</height>
289 </rect>
290 </property>
291+ <property name="minimumSize">
292+ <size>
293+ <width>300</width>
294+ <height>0</height>
295+ </size>
296+ </property>
297 <layout class="QVBoxLayout" name="verticalLayout_2">
298- <property name="topMargin">
299+ <property name="spacing">
300+ <number>15</number>
301+ </property>
302+ <property name="margin">
303 <number>0</number>
304 </property>
305 <item>
306- <layout class="QHBoxLayout" name="horizontalLayout_3">
307- <item>
308- <layout class="QVBoxLayout" name="verticalLayout">
309- <item>
310- <widget class="QLabel" name="label">
311- <property name="text">
312- <string notr="true">Verification code</string>
313- </property>
314- </widget>
315- </item>
316- <item>
317- <widget class="QLineEdit" name="verification_code_edit">
318- <property name="placeholderText">
319- <string/>
320- </property>
321- </widget>
322- </item>
323- <item>
324- <layout class="QHBoxLayout" name="horizontalLayout_2">
325- <item>
326- <spacer name="horizontalSpacer_3">
327- <property name="orientation">
328- <enum>Qt::Horizontal</enum>
329- </property>
330- <property name="sizeHint" stdset="0">
331- <size>
332- <width>40</width>
333- <height>20</height>
334- </size>
335- </property>
336- </spacer>
337- </item>
338- <item>
339- <widget class="QPushButton" name="next_button">
340- <property name="text">
341- <string notr="true">Next</string>
342- </property>
343- </widget>
344- </item>
345- </layout>
346- </item>
347- <item>
348- <spacer name="verticalSpacer_2">
349- <property name="orientation">
350- <enum>Qt::Vertical</enum>
351- </property>
352- <property name="sizeHint" stdset="0">
353- <size>
354- <width>20</width>
355- <height>40</height>
356- </size>
357- </property>
358- </spacer>
359- </item>
360- </layout>
361- </item>
362- <item>
363- <spacer name="horizontalSpacer">
364+ <layout class="QVBoxLayout" name="verticalLayout">
365+ <property name="spacing">
366+ <number>3</number>
367+ </property>
368+ <item>
369+ <widget class="QLabel" name="label">
370+ <property name="text">
371+ <string notr="true">Verification code</string>
372+ </property>
373+ </widget>
374+ </item>
375+ <item>
376+ <widget class="QLineEdit" name="verification_code_edit">
377+ <property name="placeholderText">
378+ <string/>
379+ </property>
380+ </widget>
381+ </item>
382+ </layout>
383+ </item>
384+ <item>
385+ <layout class="QHBoxLayout" name="horizontalLayout_2">
386+ <item>
387+ <spacer name="horizontalSpacer_3">
388 <property name="orientation">
389 <enum>Qt::Horizontal</enum>
390 </property>
391- <property name="sizeType">
392- <enum>QSizePolicy::Fixed</enum>
393- </property>
394 <property name="sizeHint" stdset="0">
395 <size>
396 <width>40</width>
397@@ -87,8 +59,28 @@
398 </property>
399 </spacer>
400 </item>
401+ <item>
402+ <widget class="QPushButton" name="next_button">
403+ <property name="text">
404+ <string notr="true">Next</string>
405+ </property>
406+ </widget>
407+ </item>
408 </layout>
409 </item>
410+ <item>
411+ <spacer name="verticalSpacer_2">
412+ <property name="orientation">
413+ <enum>Qt::Vertical</enum>
414+ </property>
415+ <property name="sizeHint" stdset="0">
416+ <size>
417+ <width>20</width>
418+ <height>40</height>
419+ </size>
420+ </property>
421+ </spacer>
422+ </item>
423 </layout>
424 </widget>
425 <resources/>
426
427=== modified file 'data/qt/forgotten_password.ui'
428--- data/qt/forgotten_password.ui 2012-02-22 16:58:08 +0000
429+++ data/qt/forgotten_password.ui 2012-03-05 21:55:21 +0000
430@@ -6,65 +6,46 @@
431 <rect>
432 <x>0</x>
433 <y>0</y>
434- <width>230</width>
435- <height>234</height>
436+ <width>148</width>
437+ <height>148</height>
438 </rect>
439 </property>
440 <layout class="QVBoxLayout" name="verticalLayout_2">
441- <property name="topMargin">
442+ <property name="spacing">
443+ <number>15</number>
444+ </property>
445+ <property name="margin">
446 <number>0</number>
447 </property>
448 <item>
449- <widget class="QLabel" name="forgotted_password_intro_label">
450- <property name="text">
451- <string notr="true"/>
452- </property>
453- <property name="wordWrap">
454- <bool>true</bool>
455- </property>
456- </widget>
457- </item>
458- <item>
459- <widget class="QWidget" name="email_widget" native="true">
460- <layout class="QHBoxLayout" name="horizontalLayout_2">
461- <item>
462- <layout class="QVBoxLayout" name="verticalLayout">
463- <item>
464- <widget class="QLabel" name="email_address_label">
465- <property name="sizePolicy">
466- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
467- <horstretch>0</horstretch>
468- <verstretch>0</verstretch>
469- </sizepolicy>
470- </property>
471- <property name="text">
472- <string notr="true"/>
473- </property>
474- </widget>
475- </item>
476- <item>
477- <widget class="QLineEdit" name="email_line_edit"/>
478- </item>
479- </layout>
480- </item>
481- <item>
482- <spacer name="horizontalSpacer_3">
483- <property name="orientation">
484- <enum>Qt::Horizontal</enum>
485- </property>
486- <property name="sizeType">
487- <enum>QSizePolicy::Fixed</enum>
488- </property>
489- <property name="sizeHint" stdset="0">
490- <size>
491- <width>40</width>
492- <height>20</height>
493- </size>
494- </property>
495- </spacer>
496- </item>
497- </layout>
498- </widget>
499+ <layout class="QVBoxLayout" name="verticalLayout">
500+ <property name="spacing">
501+ <number>3</number>
502+ </property>
503+ <item>
504+ <widget class="QLabel" name="email_address_label">
505+ <property name="sizePolicy">
506+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
507+ <horstretch>0</horstretch>
508+ <verstretch>0</verstretch>
509+ </sizepolicy>
510+ </property>
511+ <property name="text">
512+ <string notr="true"/>
513+ </property>
514+ </widget>
515+ </item>
516+ <item>
517+ <widget class="QLineEdit" name="email_line_edit">
518+ <property name="minimumSize">
519+ <size>
520+ <width>300</width>
521+ <height>0</height>
522+ </size>
523+ </property>
524+ </widget>
525+ </item>
526+ </layout>
527 </item>
528 <item>
529 <layout class="QHBoxLayout" name="horizontalLayout">
530@@ -91,64 +72,9 @@
531 </property>
532 </widget>
533 </item>
534- <item>
535- <spacer name="horizontalSpacer_4">
536- <property name="orientation">
537- <enum>Qt::Horizontal</enum>
538- </property>
539- <property name="sizeType">
540- <enum>QSizePolicy::Fixed</enum>
541- </property>
542- <property name="sizeHint" stdset="0">
543- <size>
544- <width>40</width>
545- <height>20</height>
546- </size>
547- </property>
548- </spacer>
549- </item>
550 </layout>
551 </item>
552 <item>
553- <widget class="QWidget" name="try_again_widget" native="true">
554- <layout class="QHBoxLayout" name="horizontalLayout_3">
555- <item>
556- <spacer name="horizontalSpacer_5">
557- <property name="orientation">
558- <enum>Qt::Horizontal</enum>
559- </property>
560- <property name="sizeHint" stdset="0">
561- <size>
562- <width>40</width>
563- <height>20</height>
564- </size>
565- </property>
566- </spacer>
567- </item>
568- <item>
569- <widget class="QPushButton" name="try_again_button">
570- <property name="text">
571- <string notr="true"/>
572- </property>
573- </widget>
574- </item>
575- <item>
576- <spacer name="horizontalSpacer_6">
577- <property name="orientation">
578- <enum>Qt::Horizontal</enum>
579- </property>
580- <property name="sizeHint" stdset="0">
581- <size>
582- <width>40</width>
583- <height>20</height>
584- </size>
585- </property>
586- </spacer>
587- </item>
588- </layout>
589- </widget>
590- </item>
591- <item>
592 <spacer name="verticalSpacer">
593 <property name="orientation">
594 <enum>Qt::Vertical</enum>
595
596=== modified file 'data/qt/reset_password.ui'
597--- data/qt/reset_password.ui 2012-02-22 16:58:08 +0000
598+++ data/qt/reset_password.ui 2012-03-05 21:55:21 +0000
599@@ -6,232 +6,217 @@
600 <rect>
601 <x>0</x>
602 <y>0</y>
603- <width>542</width>
604- <height>437</height>
605+ <width>544</width>
606+ <height>280</height>
607 </rect>
608 </property>
609 <property name="layoutDirection">
610 <enum>Qt::LeftToRight</enum>
611 </property>
612- <layout class="QVBoxLayout" name="verticalLayout">
613+ <layout class="QVBoxLayout" name="verticalLayout_6">
614 <property name="spacing">
615- <number>6</number>
616+ <number>15</number>
617 </property>
618 <property name="margin">
619 <number>0</number>
620 </property>
621 <item>
622 <layout class="QHBoxLayout" name="horizontalLayout">
623+ <property name="spacing">
624+ <number>0</number>
625+ </property>
626 <item>
627- <layout class="QVBoxLayout" name="verticalLayout_2">
628- <item>
629- <widget class="QLabel" name="reset_code">
630- <property name="sizePolicy">
631- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
632- <horstretch>0</horstretch>
633- <verstretch>0</verstretch>
634- </sizepolicy>
635- </property>
636- <property name="minimumSize">
637- <size>
638- <width>310</width>
639- <height>0</height>
640- </size>
641- </property>
642- <property name="maximumSize">
643- <size>
644- <width>16777215</width>
645- <height>16777215</height>
646- </size>
647- </property>
648- <property name="font">
649- <font>
650- <weight>75</weight>
651- <bold>true</bold>
652- </font>
653- </property>
654- <property name="text">
655- <string notr="true">reset_code</string>
656- </property>
657- </widget>
658- </item>
659- <item>
660- <widget class="QLineEdit" name="reset_code_line_edit">
661- <property name="sizePolicy">
662- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
663- <horstretch>0</horstretch>
664- <verstretch>0</verstretch>
665- </sizepolicy>
666- </property>
667- <property name="minimumSize">
668- <size>
669- <width>300</width>
670- <height>0</height>
671- </size>
672- </property>
673- <property name="maximumSize">
674- <size>
675- <width>300</width>
676- <height>16777215</height>
677- </size>
678- </property>
679- </widget>
680- </item>
681- <item>
682- <widget class="QLabel" name="password_label">
683- <property name="sizePolicy">
684- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
685- <horstretch>0</horstretch>
686- <verstretch>0</verstretch>
687- </sizepolicy>
688- </property>
689- <property name="minimumSize">
690- <size>
691- <width>310</width>
692- <height>0</height>
693- </size>
694- </property>
695- <property name="maximumSize">
696- <size>
697- <width>16777215</width>
698- <height>16777215</height>
699- </size>
700- </property>
701- <property name="font">
702- <font>
703- <weight>75</weight>
704- <bold>true</bold>
705- </font>
706- </property>
707- <property name="text">
708- <string notr="true">password_label</string>
709- </property>
710- </widget>
711- </item>
712- <item>
713- <widget class="QLineEdit" name="password_line_edit">
714- <property name="sizePolicy">
715- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
716- <horstretch>0</horstretch>
717- <verstretch>0</verstretch>
718- </sizepolicy>
719- </property>
720- <property name="minimumSize">
721- <size>
722- <width>300</width>
723- <height>0</height>
724- </size>
725- </property>
726- <property name="maximumSize">
727- <size>
728- <width>300</width>
729- <height>16777215</height>
730- </size>
731- </property>
732- <property name="echoMode">
733- <enum>QLineEdit::Password</enum>
734- </property>
735- </widget>
736- </item>
737- <item>
738- <widget class="QLabel" name="confirm_password_label">
739- <property name="sizePolicy">
740- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
741- <horstretch>0</horstretch>
742- <verstretch>0</verstretch>
743- </sizepolicy>
744- </property>
745- <property name="minimumSize">
746- <size>
747- <width>310</width>
748- <height>0</height>
749- </size>
750- </property>
751- <property name="font">
752- <font>
753- <weight>75</weight>
754- <bold>true</bold>
755- </font>
756- </property>
757- <property name="text">
758- <string notr="true">confirm_password_label</string>
759- </property>
760- </widget>
761- </item>
762- <item>
763- <widget class="QLineEdit" name="confirm_password_line_edit">
764- <property name="sizePolicy">
765- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
766- <horstretch>0</horstretch>
767- <verstretch>0</verstretch>
768- </sizepolicy>
769- </property>
770- <property name="minimumSize">
771- <size>
772- <width>300</width>
773- <height>0</height>
774- </size>
775- </property>
776- <property name="maximumSize">
777- <size>
778- <width>300</width>
779- <height>16777215</height>
780- </size>
781- </property>
782- <property name="echoMode">
783- <enum>QLineEdit::Password</enum>
784- </property>
785- </widget>
786- </item>
787- <item>
788- <spacer name="verticalSpacer">
789- <property name="orientation">
790- <enum>Qt::Vertical</enum>
791- </property>
792- <property name="sizeHint" stdset="0">
793- <size>
794- <width>300</width>
795- <height>222</height>
796- </size>
797- </property>
798- </spacer>
799- </item>
800- <item>
801- <spacer name="horizontalSpacer_2">
802- <property name="orientation">
803- <enum>Qt::Horizontal</enum>
804- </property>
805- <property name="sizeType">
806- <enum>QSizePolicy::Fixed</enum>
807- </property>
808- <property name="sizeHint" stdset="0">
809- <size>
810- <width>300</width>
811- <height>0</height>
812- </size>
813- </property>
814- </spacer>
815+ <layout class="QVBoxLayout" name="verticalLayout_5">
816+ <property name="spacing">
817+ <number>15</number>
818+ </property>
819+ <item>
820+ <layout class="QVBoxLayout" name="verticalLayout_4">
821+ <property name="spacing">
822+ <number>3</number>
823+ </property>
824+ <item>
825+ <widget class="QLabel" name="reset_code">
826+ <property name="sizePolicy">
827+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
828+ <horstretch>0</horstretch>
829+ <verstretch>0</verstretch>
830+ </sizepolicy>
831+ </property>
832+ <property name="minimumSize">
833+ <size>
834+ <width>310</width>
835+ <height>0</height>
836+ </size>
837+ </property>
838+ <property name="maximumSize">
839+ <size>
840+ <width>16777215</width>
841+ <height>16777215</height>
842+ </size>
843+ </property>
844+ <property name="font">
845+ <font>
846+ <weight>75</weight>
847+ <bold>true</bold>
848+ </font>
849+ </property>
850+ <property name="text">
851+ <string notr="true">reset_code</string>
852+ </property>
853+ </widget>
854+ </item>
855+ <item>
856+ <widget class="QLineEdit" name="reset_code_line_edit">
857+ <property name="sizePolicy">
858+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
859+ <horstretch>0</horstretch>
860+ <verstretch>0</verstretch>
861+ </sizepolicy>
862+ </property>
863+ <property name="minimumSize">
864+ <size>
865+ <width>300</width>
866+ <height>0</height>
867+ </size>
868+ </property>
869+ <property name="maximumSize">
870+ <size>
871+ <width>300</width>
872+ <height>16777215</height>
873+ </size>
874+ </property>
875+ </widget>
876+ </item>
877+ </layout>
878+ </item>
879+ <item>
880+ <layout class="QVBoxLayout" name="verticalLayout">
881+ <property name="spacing">
882+ <number>3</number>
883+ </property>
884+ <item>
885+ <widget class="QLabel" name="password_label">
886+ <property name="sizePolicy">
887+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
888+ <horstretch>0</horstretch>
889+ <verstretch>0</verstretch>
890+ </sizepolicy>
891+ </property>
892+ <property name="minimumSize">
893+ <size>
894+ <width>310</width>
895+ <height>0</height>
896+ </size>
897+ </property>
898+ <property name="maximumSize">
899+ <size>
900+ <width>16777215</width>
901+ <height>16777215</height>
902+ </size>
903+ </property>
904+ <property name="font">
905+ <font>
906+ <weight>75</weight>
907+ <bold>true</bold>
908+ </font>
909+ </property>
910+ <property name="text">
911+ <string notr="true">password_label</string>
912+ </property>
913+ </widget>
914+ </item>
915+ <item>
916+ <widget class="QLineEdit" name="password_line_edit">
917+ <property name="sizePolicy">
918+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
919+ <horstretch>0</horstretch>
920+ <verstretch>0</verstretch>
921+ </sizepolicy>
922+ </property>
923+ <property name="minimumSize">
924+ <size>
925+ <width>300</width>
926+ <height>0</height>
927+ </size>
928+ </property>
929+ <property name="maximumSize">
930+ <size>
931+ <width>300</width>
932+ <height>16777215</height>
933+ </size>
934+ </property>
935+ <property name="echoMode">
936+ <enum>QLineEdit::Password</enum>
937+ </property>
938+ </widget>
939+ </item>
940+ </layout>
941+ </item>
942+ <item>
943+ <layout class="QVBoxLayout" name="verticalLayout_2">
944+ <property name="spacing">
945+ <number>3</number>
946+ </property>
947+ <item>
948+ <widget class="QLabel" name="confirm_password_label">
949+ <property name="sizePolicy">
950+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
951+ <horstretch>0</horstretch>
952+ <verstretch>0</verstretch>
953+ </sizepolicy>
954+ </property>
955+ <property name="minimumSize">
956+ <size>
957+ <width>310</width>
958+ <height>0</height>
959+ </size>
960+ </property>
961+ <property name="font">
962+ <font>
963+ <weight>75</weight>
964+ <bold>true</bold>
965+ </font>
966+ </property>
967+ <property name="text">
968+ <string notr="true">confirm_password_label</string>
969+ </property>
970+ </widget>
971+ </item>
972+ <item>
973+ <widget class="QLineEdit" name="confirm_password_line_edit">
974+ <property name="sizePolicy">
975+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
976+ <horstretch>0</horstretch>
977+ <verstretch>0</verstretch>
978+ </sizepolicy>
979+ </property>
980+ <property name="minimumSize">
981+ <size>
982+ <width>300</width>
983+ <height>0</height>
984+ </size>
985+ </property>
986+ <property name="maximumSize">
987+ <size>
988+ <width>300</width>
989+ <height>16777215</height>
990+ </size>
991+ </property>
992+ <property name="echoMode">
993+ <enum>QLineEdit::Password</enum>
994+ </property>
995+ </widget>
996+ </item>
997+ </layout>
998 </item>
999 </layout>
1000 </item>
1001 <item>
1002 <layout class="QVBoxLayout" name="verticalLayout_3">
1003- <item>
1004- <spacer name="verticalSpacer_3">
1005- <property name="orientation">
1006- <enum>Qt::Vertical</enum>
1007- </property>
1008- <property name="sizeType">
1009- <enum>QSizePolicy::Fixed</enum>
1010- </property>
1011- <property name="sizeHint" stdset="0">
1012- <size>
1013- <width>20</width>
1014- <height>55</height>
1015- </size>
1016- </property>
1017- </spacer>
1018- </item>
1019+ <property name="spacing">
1020+ <number>0</number>
1021+ </property>
1022 <item>
1023 <widget class="QLabel" name="password_assistance">
1024 <property name="sizePolicy">
1025@@ -294,42 +279,51 @@
1026 </layout>
1027 </item>
1028 <item>
1029- <layout class="QHBoxLayout" name="horizontalLayout_2">
1030- <item>
1031- <layout class="QHBoxLayout" name="horizontalLayout_3">
1032- <property name="rightMargin">
1033- <number>0</number>
1034- </property>
1035- <item>
1036- <spacer name="horizontalSpacer_4">
1037- <property name="orientation">
1038- <enum>Qt::Horizontal</enum>
1039- </property>
1040- <property name="sizeType">
1041- <enum>QSizePolicy::Expanding</enum>
1042- </property>
1043- <property name="sizeHint" stdset="0">
1044- <size>
1045- <width>40</width>
1046- <height>20</height>
1047- </size>
1048- </property>
1049- </spacer>
1050- </item>
1051- <item>
1052- <widget class="QPushButton" name="reset_password_button">
1053- <property name="enabled">
1054- <bool>false</bool>
1055- </property>
1056- <property name="text">
1057- <string notr="true"/>
1058- </property>
1059- </widget>
1060- </item>
1061- </layout>
1062+ <layout class="QHBoxLayout" name="horizontalLayout_3">
1063+ <property name="rightMargin">
1064+ <number>0</number>
1065+ </property>
1066+ <item>
1067+ <spacer name="horizontalSpacer_4">
1068+ <property name="orientation">
1069+ <enum>Qt::Horizontal</enum>
1070+ </property>
1071+ <property name="sizeType">
1072+ <enum>QSizePolicy::Expanding</enum>
1073+ </property>
1074+ <property name="sizeHint" stdset="0">
1075+ <size>
1076+ <width>40</width>
1077+ <height>20</height>
1078+ </size>
1079+ </property>
1080+ </spacer>
1081+ </item>
1082+ <item>
1083+ <widget class="QPushButton" name="reset_password_button">
1084+ <property name="enabled">
1085+ <bool>false</bool>
1086+ </property>
1087+ <property name="text">
1088+ <string notr="true"/>
1089+ </property>
1090+ </widget>
1091 </item>
1092 </layout>
1093 </item>
1094+ <item>
1095+ <spacer name="verticalSpacer">
1096+ <property name="orientation">
1097+ <enum>Qt::Vertical</enum>
1098+ </property>
1099+ <property name="sizeHint" stdset="0">
1100+ <size>
1101+ <width>20</width>
1102+ <height>40</height>
1103+ </size>
1104+ </property>
1105+ </spacer>
1106+ </item>
1107 </layout>
1108 </widget>
1109 <resources/>
1110
1111=== modified file 'data/qt/setup_account.ui'
1112--- data/qt/setup_account.ui 2012-03-01 20:13:02 +0000
1113+++ data/qt/setup_account.ui 2012-03-05 21:55:21 +0000
1114@@ -6,8 +6,8 @@
1115 <rect>
1116 <x>0</x>
1117 <y>0</y>
1118- <width>543</width>
1119- <height>476</height>
1120+ <width>532</width>
1121+ <height>438</height>
1122 </rect>
1123 </property>
1124 <property name="sizePolicy">
1125@@ -26,16 +26,7 @@
1126 <property name="spacing">
1127 <number>0</number>
1128 </property>
1129- <property name="leftMargin">
1130- <number>0</number>
1131- </property>
1132- <property name="topMargin">
1133- <number>0</number>
1134- </property>
1135- <property name="rightMargin">
1136- <number>3</number>
1137- </property>
1138- <property name="bottomMargin">
1139+ <property name="margin">
1140 <number>0</number>
1141 </property>
1142 <item>
1143@@ -43,24 +34,50 @@
1144 <property name="sizeConstraint">
1145 <enum>QLayout::SetDefaultConstraint</enum>
1146 </property>
1147- <item row="1" column="1">
1148- <spacer name="verticalSpacer">
1149- <property name="orientation">
1150- <enum>Qt::Vertical</enum>
1151- </property>
1152- <property name="sizeType">
1153- <enum>QSizePolicy::Fixed</enum>
1154- </property>
1155- <property name="sizeHint" stdset="0">
1156- <size>
1157- <width>20</width>
1158- <height>15</height>
1159+ <property name="verticalSpacing">
1160+ <number>6</number>
1161+ </property>
1162+ <item row="4" column="0" colspan="2">
1163+ <spacer name="verticalSpacer_2">
1164+ <property name="orientation">
1165+ <enum>Qt::Vertical</enum>
1166+ </property>
1167+ <property name="sizeHint" stdset="0">
1168+ <size>
1169+ <width>20</width>
1170+ <height>10</height>
1171+ </size>
1172+ </property>
1173+ </spacer>
1174+ </item>
1175+ <item row="10" column="0" colspan="2">
1176+ <spacer name="verticalSpacer_3">
1177+ <property name="orientation">
1178+ <enum>Qt::Vertical</enum>
1179+ </property>
1180+ <property name="sizeHint" stdset="0">
1181+ <size>
1182+ <width>20</width>
1183+ <height>10</height>
1184+ </size>
1185+ </property>
1186+ </spacer>
1187+ </item>
1188+ <item row="7" column="0" colspan="2">
1189+ <spacer name="verticalSpacer_4">
1190+ <property name="orientation">
1191+ <enum>Qt::Vertical</enum>
1192+ </property>
1193+ <property name="sizeHint" stdset="0">
1194+ <size>
1195+ <width>20</width>
1196+ <height>10</height>
1197 </size>
1198 </property>
1199 </spacer>
1200 </item>
1201 <item row="0" column="0">
1202- <layout class="QVBoxLayout" name="verticalLayout">
1203+ <layout class="QVBoxLayout" name="verticalLayout_5">
1204 <property name="spacing">
1205 <number>3</number>
1206 </property>
1207@@ -110,7 +127,7 @@
1208 </layout>
1209 </item>
1210 <item row="2" column="0">
1211- <layout class="QVBoxLayout" name="verticalLayout">
1212+ <layout class="QVBoxLayout" name="verticalLayout_6">
1213 <property name="spacing">
1214 <number>3</number>
1215 </property>
1216@@ -204,7 +221,7 @@
1217 </layout>
1218 </item>
1219 <item row="3" column="0">
1220- <layout class="QVBoxLayout" name="verticalLayout">
1221+ <layout class="QVBoxLayout" name="verticalLayout_10">
1222 <property name="spacing">
1223 <number>3</number>
1224 </property>
1225@@ -300,45 +317,13 @@
1226 </item>
1227 </layout>
1228 </item>
1229- <item row="4" column="1">
1230- <spacer name="verticalSpacer_2">
1231- <property name="orientation">
1232- <enum>Qt::Vertical</enum>
1233- </property>
1234- <property name="sizeType">
1235- <enum>QSizePolicy::Fixed</enum>
1236- </property>
1237- <property name="sizeHint" stdset="0">
1238- <size>
1239- <width>20</width>
1240- <height>15</height>
1241- </size>
1242- </property>
1243- </spacer>
1244- </item>
1245- <item row="9" column="1">
1246- <spacer name="verticalSpacer_5">
1247- <property name="orientation">
1248- <enum>Qt::Vertical</enum>
1249- </property>
1250- <property name="sizeType">
1251- <enum>QSizePolicy::Fixed</enum>
1252- </property>
1253- <property name="sizeHint" stdset="0">
1254- <size>
1255- <width>20</width>
1256- <height>15</height>
1257- </size>
1258- </property>
1259- </spacer>
1260- </item>
1261- <item row="10" column="0" colspan="2">
1262+ <item row="11" column="0" colspan="2">
1263 <layout class="QHBoxLayout" name="hlayout_check">
1264 <property name="spacing">
1265- <number>0</number>
1266+ <number>6</number>
1267 </property>
1268 <property name="topMargin">
1269- <number>10</number>
1270+ <number>0</number>
1271 </property>
1272 </layout>
1273 </item>
1274@@ -384,7 +369,7 @@
1275 </layout>
1276 </item>
1277 <item row="5" column="0">
1278- <layout class="QVBoxLayout" name="verticalLayout">
1279+ <layout class="QVBoxLayout" name="verticalLayout_3">
1280 <property name="spacing">
1281 <number>3</number>
1282 </property>
1283@@ -447,6 +432,9 @@
1284 </item>
1285 <item row="5" column="1" rowspan="2">
1286 <layout class="QHBoxLayout" name="horizontalLayout_3">
1287+ <property name="spacing">
1288+ <number>0</number>
1289+ </property>
1290 <item>
1291 <widget class="QLabel" name="password_assistance">
1292 <property name="sizePolicy">
1293@@ -481,7 +469,7 @@
1294 </layout>
1295 </item>
1296 <item row="6" column="0">
1297- <layout class="QVBoxLayout" name="verticalLayout">
1298+ <layout class="QVBoxLayout" name="verticalLayout_2">
1299 <property name="spacing">
1300 <number>3</number>
1301 </property>
1302@@ -536,31 +524,15 @@
1303 </item>
1304 </layout>
1305 </item>
1306- <item row="7" column="1">
1307- <spacer name="verticalSpacer_3">
1308- <property name="orientation">
1309- <enum>Qt::Vertical</enum>
1310- </property>
1311- <property name="sizeType">
1312- <enum>QSizePolicy::Fixed</enum>
1313- </property>
1314- <property name="sizeHint" stdset="0">
1315- <size>
1316- <width>20</width>
1317- <height>15</height>
1318- </size>
1319- </property>
1320- </spacer>
1321- </item>
1322 <item row="8" column="0">
1323- <layout class="QVBoxLayout" name="verticalLayout">
1324+ <layout class="QVBoxLayout" name="verticalLayout_4">
1325 <property name="spacing">
1326 <number>3</number>
1327 </property>
1328 <item>
1329 <widget class="QLabel" name="captcha_view">
1330 <property name="sizePolicy">
1331- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
1332+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
1333 <horstretch>0</horstretch>
1334 <verstretch>0</verstretch>
1335 </sizepolicy>
1336@@ -574,7 +546,7 @@
1337 <property name="maximumSize">
1338 <size>
1339 <width>300</width>
1340- <height>16777215</height>
1341+ <height>57</height>
1342 </size>
1343 </property>
1344 <property name="styleSheet">
1345@@ -632,39 +604,53 @@
1346 </item>
1347 </layout>
1348 </item>
1349+ <item row="1" column="0" colspan="2">
1350+ <spacer name="verticalSpacer">
1351+ <property name="orientation">
1352+ <enum>Qt::Vertical</enum>
1353+ </property>
1354+ <property name="sizeHint" stdset="0">
1355+ <size>
1356+ <width>20</width>
1357+ <height>10</height>
1358+ </size>
1359+ </property>
1360+ </spacer>
1361+ </item>
1362 <item row="8" column="1">
1363- <widget class="QLabel" name="refresh_label">
1364- <property name="sizePolicy">
1365- <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
1366- <horstretch>0</horstretch>
1367- <verstretch>0</verstretch>
1368- </sizepolicy>
1369- </property>
1370- <property name="minimumSize">
1371- <size>
1372- <width>220</width>
1373- <height>0</height>
1374- </size>
1375- </property>
1376- <property name="maximumSize">
1377- <size>
1378- <width>220</width>
1379- <height>16777215</height>
1380- </size>
1381- </property>
1382- <property name="locale">
1383- <locale language="English" country="UnitedStates"/>
1384- </property>
1385- <property name="text">
1386- <string notr="true">If you can't read this then &lt;a href=&quot;example.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#dd4814;&quot;&gt;refresh&lt;/span&gt;&lt;/a&gt; this page&lt;/span&gt;</string>
1387- </property>
1388- <property name="wordWrap">
1389- <bool>true</bool>
1390- </property>
1391- <property name="indent">
1392+ <layout class="QVBoxLayout" name="verticalLayout_13">
1393+ <property name="rightMargin">
1394 <number>0</number>
1395 </property>
1396- </widget>
1397+ <item>
1398+ <widget class="QLabel" name="refresh_label">
1399+ <property name="minimumSize">
1400+ <size>
1401+ <width>220</width>
1402+ <height>0</height>
1403+ </size>
1404+ </property>
1405+ <property name="maximumSize">
1406+ <size>
1407+ <width>220</width>
1408+ <height>16777215</height>
1409+ </size>
1410+ </property>
1411+ <property name="locale">
1412+ <locale language="English" country="UnitedStates"/>
1413+ </property>
1414+ <property name="text">
1415+ <string notr="true">If you can't read this then refresh this page</string>
1416+ </property>
1417+ <property name="wordWrap">
1418+ <bool>true</bool>
1419+ </property>
1420+ <property name="indent">
1421+ <number>0</number>
1422+ </property>
1423+ </widget>
1424+ </item>
1425+ </layout>
1426 </item>
1427 </layout>
1428 </item>
1429
1430=== modified file 'data/qt/stylesheet.qss'
1431--- data/qt/stylesheet.qss 2012-03-01 20:13:02 +0000
1432+++ data/qt/stylesheet.qss 2012-03-05 21:55:21 +0000
1433@@ -6,6 +6,7 @@
1434 QFrame#ubuntussoframe {
1435 background-color: white;
1436 padding-left: 30px;
1437+ padding-right: 30px;
1438 }
1439
1440 QWizard,
1441
1442=== modified file 'ubuntu_sso/qt/__init__.py'
1443--- ubuntu_sso/qt/__init__.py 2012-03-01 12:30:13 +0000
1444+++ ubuntu_sso/qt/__init__.py 2012-03-05 21:55:21 +0000
1445@@ -19,9 +19,13 @@
1446 import collections
1447
1448
1449+LINK_STYLE = ('<a href="{link_url}">'
1450+ '<span style="color:#df2d1f;">{link_text}</span></a>')
1451 ERROR_ALL = '__all__'
1452+ERROR_STYLE = u'<font color="#df2d1f"><b>%s</b></font>'
1453 ERROR_MESSAGE = 'message'
1454 PREFERED_UI_SIZE = {'width': 550, 'height': 525}
1455+TITLE_STYLE = u'<span style="font-size:24px">%s</span>'
1456
1457
1458 # Based on the gtk implementation
1459
1460=== modified file 'ubuntu_sso/qt/current_user_sign_in_page.py'
1461--- ubuntu_sso/qt/current_user_sign_in_page.py 2012-03-05 12:07:21 +0000
1462+++ ubuntu_sso/qt/current_user_sign_in_page.py 2012-03-05 21:55:21 +0000
1463@@ -21,8 +21,8 @@
1464 from PyQt4 import QtGui, QtCore
1465
1466 from ubuntu_sso import NO_OP
1467-from ubuntu_sso.logger import setup_logging
1468-from ubuntu_sso.qt import build_general_error_message
1469+from ubuntu_sso.logger import setup_gui_logging
1470+from ubuntu_sso.qt import LINK_STYLE, build_general_error_message
1471 from ubuntu_sso.qt.sso_wizard_page import SSOWizardPage
1472 from ubuntu_sso.qt.ui.current_user_sign_in_ui import Ui_CurrentUserSignInPage
1473 from ubuntu_sso.utils.ui import (
1474@@ -31,24 +31,22 @@
1475 FORGOTTEN_PASSWORD_BUTTON,
1476 is_correct_email,
1477 LOGIN_PASSWORD_LABEL,
1478+ LOGIN_TITLE,
1479+ LOGIN_SUBTITLE,
1480 SIGN_IN_BUTTON,
1481 )
1482
1483
1484-FORGOTTEN_PASSWORD_LINK_STYLE = ('<a href="#" style="color:#dd4814;">'
1485- '{forgotten_text}</a>')
1486-
1487-
1488-logger = setup_logging('ubuntu_sso.current_user_sign_in_page')
1489+logger = setup_gui_logging('ubuntu_sso.current_user_sign_in_page')
1490
1491
1492 class CurrentUserSignInPage(SSOWizardPage):
1493 """Wizard Page that lets a current user Sign into Ubuntu Single Sign On."""
1494
1495 ui_class = Ui_CurrentUserSignInPage
1496- userLoggedIn = QtCore.pyqtSignal('QString', 'QString')
1497+ userLoggedIn = QtCore.pyqtSignal(unicode)
1498 passwordForgotten = QtCore.pyqtSignal()
1499- userNotValidated = QtCore.pyqtSignal('QString', 'QString')
1500+ userNotValidated = QtCore.pyqtSignal(unicode)
1501
1502 @property
1503 def _signals(self):
1504@@ -63,12 +61,11 @@
1505 }
1506 return result
1507
1508- def on_user_not_validated(self, *args):
1509+ def on_user_not_validated(self, app_name, email):
1510 """Show the validate email page."""
1511 self.hide_overlay()
1512 email = unicode(self.ui.email_edit.text())
1513- password = unicode(self.ui.password_edit.text())
1514- self.userNotValidated.emit(email, password)
1515+ self.userNotValidated.emit(email)
1516
1517 # Invalid names of Qt-inherited methods
1518 # pylint: disable=C0103
1519@@ -98,10 +95,13 @@
1520 def _set_translated_strings(self):
1521 """Set the translated strings."""
1522 logger.debug('CurrentUserSignInPage._set_translated_strings')
1523+ self.setTitle(LOGIN_TITLE.format(app_name=self.app_name))
1524+ self.setSubTitle(LOGIN_SUBTITLE % {'app_name': self.app_name})
1525+
1526 self.ui.email_label.setText(EMAIL_LABEL)
1527 self.ui.password_label.setText(LOGIN_PASSWORD_LABEL)
1528- forgotten_text = FORGOTTEN_PASSWORD_LINK_STYLE.format(
1529- forgotten_text=FORGOTTEN_PASSWORD_BUTTON)
1530+ forgotten_text = LINK_STYLE.format(link_url='#',
1531+ link_text=FORGOTTEN_PASSWORD_BUTTON)
1532 self.ui.forgot_password_label.setText(forgotten_text)
1533 self.ui.sign_in_button.setText(SIGN_IN_BUTTON)
1534
1535@@ -153,10 +153,11 @@
1536 logger.info('Logged in for %s', app_name)
1537 self.hide_overlay()
1538 email = unicode(self.ui.email_edit.text())
1539- self.userLoggedIn.emit(app_name, email)
1540+ self.userLoggedIn.emit(email)
1541 logger.debug('Wizard.loginSuccess emitted.')
1542
1543- def on_forgotten_password(self):
1544+ def on_forgotten_password(self, link=None):
1545 """Show the user the forgotten password page."""
1546 logger.info('Forgotten password')
1547+ self.hide_overlay()
1548 self.passwordForgotten.emit()
1549
1550=== modified file 'ubuntu_sso/qt/email_verification_page.py'
1551--- ubuntu_sso/qt/email_verification_page.py 2012-03-02 20:33:05 +0000
1552+++ ubuntu_sso/qt/email_verification_page.py 2012-03-05 21:55:21 +0000
1553@@ -21,7 +21,7 @@
1554 from PyQt4 import QtGui, QtCore
1555
1556 from ubuntu_sso import NO_OP
1557-from ubuntu_sso.logger import setup_logging
1558+from ubuntu_sso.logger import setup_gui_logging
1559 from ubuntu_sso.qt import build_general_error_message
1560 from ubuntu_sso.qt.sso_wizard_page import SSOWizardPage
1561 from ubuntu_sso.qt.ui.email_verification_ui import Ui_EmailVerificationPage
1562@@ -34,14 +34,14 @@
1563 )
1564
1565
1566-logger = setup_logging('ubuntu_sso.email_verification_page')
1567+logger = setup_gui_logging('ubuntu_sso.email_verification_page')
1568
1569
1570 class EmailVerificationPage(SSOWizardPage):
1571 """Widget used to input the email verification code."""
1572
1573 ui_class = Ui_EmailVerificationPage
1574- registrationSuccess = QtCore.pyqtSignal('QString', 'QString')
1575+ registrationSuccess = QtCore.pyqtSignal(unicode)
1576
1577 def __init__(self, *args, **kwargs):
1578 self.email = ''
1579@@ -121,11 +121,11 @@
1580 self.on_email_validation_error)
1581 f(*args, reply_handler=NO_OP, error_handler=error_handler)
1582
1583- def on_email_validated(self, app_name, *args, **kwargs):
1584+ def on_email_validated(self, app_name, email):
1585 """Signal thrown after the email is validated."""
1586 logger.info('EmailVerificationController.on_email_validated')
1587 self.hide_overlay()
1588- self.registrationSuccess.emit(app_name, self.email)
1589+ self.registrationSuccess.emit(self.email)
1590
1591 def on_email_validation_error(self, app_name, error):
1592 """Signal thrown when there's a problem validating the email."""
1593@@ -134,10 +134,12 @@
1594 msg += build_general_error_message(error)
1595 self.show_error(self.app_name, msg)
1596
1597- #pylint: disable=C0103
1598+ # pylint: disable=C0103
1599+
1600 def initializePage(self):
1601 """Called to prepare the page just before it is shown."""
1602 self.next_button.setDefault(True)
1603 self.next_button.setEnabled(False)
1604 self.wizard().setButtonLayout([QtGui.QWizard.Stretch])
1605+
1606 #pylint: enable=C0103
1607
1608=== modified file 'ubuntu_sso/qt/forgotten_password_page.py'
1609--- ubuntu_sso/qt/forgotten_password_page.py 2012-03-01 20:46:34 +0000
1610+++ ubuntu_sso/qt/forgotten_password_page.py 2012-03-05 21:55:21 +0000
1611@@ -21,24 +21,27 @@
1612 from PyQt4 import QtCore
1613
1614 from ubuntu_sso import NO_OP
1615+from ubuntu_sso.logger import setup_gui_logging, log_call
1616 from ubuntu_sso.qt.sso_wizard_page import SSOWizardEnhancedEditPage
1617 from ubuntu_sso.qt.ui.forgotten_password_ui import Ui_ForgottenPasswordPage
1618 from ubuntu_sso.utils.ui import (
1619 EMAIL_LABEL,
1620+ FORGOTTEN_PASSWORD_TITLE,
1621+ FORGOTTEN_PASSWORD_SUBTITLE,
1622 is_correct_email,
1623 RESET_PASSWORD,
1624- REQUEST_PASSWORD_TOKEN_LABEL,
1625 REQUEST_PASSWORD_TOKEN_WRONG_EMAIL,
1626- REQUEST_PASSWORD_TOKEN_TECH_ERROR,
1627- TRY_AGAIN_BUTTON,
1628 )
1629
1630
1631+logger = setup_gui_logging('ubuntu_sso.forgotten_password_page')
1632+
1633+
1634 class ForgottenPasswordPage(SSOWizardEnhancedEditPage):
1635 """Widget used to deal with users that forgot the password."""
1636
1637 ui_class = Ui_ForgottenPasswordPage
1638- passwordResetTokenSent = QtCore.pyqtSignal()
1639+ passwordResetTokenSent = QtCore.pyqtSignal(unicode)
1640
1641 @property
1642 def _signals(self):
1643@@ -52,87 +55,42 @@
1644 return result
1645
1646 @property
1647- def email_widget(self):
1648- """Return the widget used to show the email information."""
1649- return self.ui.email_widget
1650-
1651- @property
1652- def forgotted_password_intro_label(self):
1653- """Return the intro label that lets the user know the issue."""
1654- return self.ui.forgotted_password_intro_label
1655-
1656- @property
1657- def error_label(self):
1658- """Return the label used to show error."""
1659- return self.ui.error_label
1660-
1661- @property
1662- def email_address_label(self):
1663- """Return the lable used to state the use of the line edit."""
1664- return self.ui.email_address_label
1665-
1666- @property
1667 def email_address(self):
1668 """Return the email address provided by the user."""
1669- return str(self.ui.email_line_edit.text())
1670-
1671- @property
1672- def email_address_line_edit(self):
1673- """Return the line edit with the content."""
1674- return self.ui.email_line_edit
1675-
1676- @property
1677- def send_button(self):
1678- """Return the button used to request the new password."""
1679- return self.ui.send_button
1680-
1681- @property
1682- def try_again_widget(self):
1683- """Return the widget used to display the try again button."""
1684- return self.ui.try_again_widget
1685-
1686- @property
1687- def try_again_button(self):
1688- """Return the button used to try again the reset password."""
1689- return self.ui.try_again_button
1690+ return unicode(self.ui.email_line_edit.text())
1691
1692 #pylint: disable=C0103
1693+
1694 def initializePage(self):
1695 """Set the initial state of ForgottenPassword page."""
1696- self.send_button.setDefault(True)
1697+ self.ui.send_button.setDefault(True)
1698 enabled = not self.ui.email_line_edit.text().isEmpty()
1699- self.send_button.setEnabled(enabled)
1700+ self.ui.send_button.setEnabled(enabled)
1701+
1702 #pylint: enable=C0103
1703
1704 def _register_fields(self):
1705 """Register the fields of the wizard page."""
1706 self.registerField('email_address',
1707- self.email_address_line_edit)
1708+ self.ui.email_line_edit)
1709
1710 def _set_translated_strings(self):
1711 """Set the translated strings in the view."""
1712- self.forgotted_password_intro_label.setText(
1713- REQUEST_PASSWORD_TOKEN_LABEL % {'app_name':
1714- self.app_name})
1715- self.email_address_label.setText(EMAIL_LABEL)
1716- self.send_button.setText(RESET_PASSWORD)
1717- self.try_again_button.setText(TRY_AGAIN_BUTTON)
1718+ self.setTitle(FORGOTTEN_PASSWORD_TITLE)
1719+ subtitle = FORGOTTEN_PASSWORD_SUBTITLE.format(app_name=self.app_name)
1720+ self.setSubTitle(subtitle)
1721+ self.ui.email_address_label.setText(EMAIL_LABEL)
1722+ self.ui.send_button.setText(RESET_PASSWORD)
1723
1724 def _set_enhanced_line_edit(self):
1725 """Set the extra logic to the line edits."""
1726- self.set_line_edit_validation_rule(
1727- self.email_address_line_edit,
1728+ self.set_line_edit_validation_rule(self.ui.email_line_edit,
1729 is_correct_email)
1730
1731 def _connect_ui(self):
1732 """Connect the diff signals from the Ui."""
1733- self.email_address_line_edit.textChanged.connect(self._validate)
1734-
1735- self.send_button.clicked.connect(self.request_new_password)
1736-
1737- self.try_again_widget.setVisible(False)
1738- self.try_again_button.clicked.connect(self.on_try_again)
1739-
1740+ self.ui.email_line_edit.textChanged.connect(self._validate)
1741+ self.ui.send_button.clicked.connect(self.request_new_password)
1742 self._set_enhanced_line_edit()
1743 self._register_fields()
1744
1745@@ -150,33 +108,19 @@
1746
1747 def _validate(self):
1748 """Validate that we have an email."""
1749- email = unicode(self.email_address_line_edit.text())
1750- self.send_button.setEnabled(is_correct_email(email))
1751-
1752- def on_try_again(self):
1753- """Set back the widget to the initial state."""
1754- self.hide_error()
1755- self.try_again_widget.setVisible(False)
1756- self.email_widget.setVisible(True)
1757-
1758- def on_password_reset_token_sent(self, app_name, result):
1759+ email = unicode(self.ui.email_line_edit.text())
1760+ self.ui.send_button.setEnabled(is_correct_email(email))
1761+
1762+ def on_password_reset_token_sent(self, app_name, email):
1763 """Action taken when we managed to get the password reset done."""
1764 # ignore the result and move to the reset page
1765 self.hide_overlay()
1766- self.passwordResetTokenSent.emit()
1767+ self.passwordResetTokenSent.emit(email)
1768
1769+ @log_call(logger.error)
1770 def on_password_reset_error(self, app_name, error):
1771 """Action taken when there was an error requesting the reset."""
1772 # set the error message
1773 self.hide_overlay()
1774- msg = REQUEST_PASSWORD_TOKEN_TECH_ERROR
1775- if error['errtype'] == 'ResetPasswordTokenError':
1776- # the account provided is wrong, lets tell the user to try
1777- # again
1778- msg = REQUEST_PASSWORD_TOKEN_WRONG_EMAIL
1779- else:
1780- # ouch, I dont know what went wrong, tell the user to try later
1781- self.email_widget.setVisible(False)
1782- self.forgotted_password_intro_label.setVisible(False)
1783- self.try_again_widget.setVisible(True)
1784+ msg = REQUEST_PASSWORD_TOKEN_WRONG_EMAIL
1785 self.show_error(self.app_name, msg)
1786
1787=== modified file 'ubuntu_sso/qt/proxy_dialog.py'
1788--- ubuntu_sso/qt/proxy_dialog.py 2012-02-27 12:48:59 +0000
1789+++ ubuntu_sso/qt/proxy_dialog.py 2012-03-05 21:55:21 +0000
1790@@ -21,7 +21,7 @@
1791 from PyQt4.QtGui import QApplication, QDialog, QIcon
1792 from twisted.internet import defer
1793
1794-from ubuntu_sso.logger import setup_logging
1795+from ubuntu_sso.logger import setup_gui_logging
1796 from ubuntu_sso.keyring import Keyring
1797 from ubuntu_sso.qt.ui.proxy_credentials_dialog_ui import Ui_ProxyCredsDialog
1798 from ubuntu_sso.utils.ui import (
1799@@ -41,7 +41,7 @@
1800 USER_CANCELATION = -1
1801 EXCEPTION_RAISED = -2
1802
1803-logger = setup_logging("ubuntu_sso.qt.proxy_dialog")
1804+logger = setup_gui_logging("ubuntu_sso.qt.proxy_dialog")
1805
1806
1807 class ProxyCredsDialog(QDialog):
1808
1809=== modified file 'ubuntu_sso/qt/reset_password_page.py'
1810--- ubuntu_sso/qt/reset_password_page.py 2012-03-01 20:46:34 +0000
1811+++ ubuntu_sso/qt/reset_password_page.py 2012-03-05 21:55:21 +0000
1812@@ -22,7 +22,7 @@
1813 from PyQt4.QtGui import QApplication
1814
1815 from ubuntu_sso import NO_OP
1816-from ubuntu_sso.logger import setup_logging
1817+from ubuntu_sso.logger import setup_gui_logging
1818 from ubuntu_sso.qt import build_general_error_message, common
1819 from ubuntu_sso.qt.sso_wizard_page import SSOWizardEnhancedEditPage
1820 from ubuntu_sso.qt.ui.reset_password_ui import Ui_ResetPasswordPage
1821@@ -38,14 +38,14 @@
1822 )
1823
1824
1825-logger = setup_logging('ubuntu_sso.reset_password_page')
1826+logger = setup_gui_logging('ubuntu_sso.reset_password_page')
1827
1828
1829 class ResetPasswordPage(SSOWizardEnhancedEditPage):
1830 """Widget used to allow the user change his password."""
1831
1832 ui_class = Ui_ResetPasswordPage
1833- passwordChanged = pyqtSignal('QString')
1834+ passwordChanged = pyqtSignal(unicode)
1835
1836 @property
1837 def _signals(self):
1838@@ -156,7 +156,7 @@
1839 self.ui.password_line_edit.textChanged.connect(
1840 self.ui.confirm_password_line_edit.textChanged.emit)
1841
1842- def on_password_changed(self, app_name, result):
1843+ def on_password_changed(self, app_name, email):
1844 """Let user know that the password was changed."""
1845 self.hide_overlay()
1846 email = unicode(self.wizard().forgotten.ui.email_line_edit.text())
1847
1848=== modified file 'ubuntu_sso/qt/setup_account_page.py'
1849--- ubuntu_sso/qt/setup_account_page.py 2012-03-05 19:58:07 +0000
1850+++ ubuntu_sso/qt/setup_account_page.py 2012-03-05 21:55:21 +0000
1851@@ -31,11 +31,13 @@
1852 from PyQt4 import QtGui, QtCore
1853
1854 from ubuntu_sso import NO_OP
1855-from ubuntu_sso.logger import setup_logging
1856+from ubuntu_sso.logger import setup_gui_logging
1857 from ubuntu_sso.qt import (
1858+ LINK_STYLE,
1859 build_general_error_message,
1860 common,
1861 enhanced_check_box,
1862+ ERROR_STYLE,
1863 )
1864 from ubuntu_sso.qt.sso_wizard_page import SSOWizardEnhancedEditPage
1865 from ubuntu_sso.qt.ui.setup_account_ui import Ui_SetUpAccountPage
1866@@ -72,29 +74,20 @@
1867 RETYPE_PASSWORD,
1868 SET_UP_ACCOUNT_BUTTON,
1869 TERMS_TEXT,
1870- TITLE,
1871+ REGISTER_TITLE,
1872 )
1873
1874
1875-logger = setup_logging('ubuntu_sso.setup_account_page')
1876-
1877-ERROR = u'<font color="#df2d1f"><b> %s </b></font>'
1878-TITLE_STYLE = "<span style=\"font-size:24px\">%s</span>"
1879+logger = setup_gui_logging('ubuntu_sso.setup_account_page')
1880
1881 ERROR_EMAIL = 'email'
1882-CAPTCHA_RELOAD_LINK = ('<a href="#">'
1883- '<span style="color:#df2d1f;">%(reload_text)s</span></a>')
1884-TERMS_LINK = ('<a href="{toc_link}">'
1885- '<span style="color:#df2d1f;">{terms_text}</span></a>')
1886-PRIVACY_POLICY_LINK = ('<a href="{policy_link}">'
1887- '<span style="color:#df2d1f;">{privacy_policy_text}</span></a>')
1888
1889
1890 class SetupAccountPage(SSOWizardEnhancedEditPage):
1891 """Customized Setup Account page for SSO."""
1892
1893 ui_class = Ui_SetUpAccountPage
1894- userRegistered = QtCore.pyqtSignal('QString', 'QString')
1895+ userRegistered = QtCore.pyqtSignal(unicode)
1896
1897 def __init__(self, *args, **kwargs):
1898 self.captcha_file = None
1899@@ -124,9 +117,6 @@
1900
1901 def initializePage(self):
1902 """Setup UI details."""
1903- title_page = TITLE_STYLE % TITLE.format(app_name=self.app_name)
1904- self.setTitle(title_page)
1905- self.setSubTitle(self.help_text)
1906 # Set Setup Account button
1907 self.wizard().setOption(QtGui.QWizard.HaveCustomButton3, True)
1908 try:
1909@@ -164,6 +154,10 @@
1910 """Set the strings."""
1911 logger.debug('SetUpAccountPage._set_translated_strings')
1912 # set the translated string
1913+ title_page = REGISTER_TITLE.format(app_name=self.app_name)
1914+ self.setTitle(title_page)
1915+ self.setSubTitle(self.help_text)
1916+
1917 self.ui.name_label.setText(NAME_ENTRY)
1918 self.ui.email_label.setText(EMAIL1_ENTRY)
1919 self.ui.confirm_email_label.setText(EMAIL2_ENTRY)
1920@@ -172,17 +166,16 @@
1921 self.ui.password_edit.setToolTip(PASSWORD_HELP)
1922 self.ui.captcha_solution_edit.setPlaceholderText(
1923 CAPTCHA_SOLUTION_ENTRY)
1924- link = CAPTCHA_RELOAD_LINK % {'reload_text': CAPTCHA_RELOAD_TEXT}
1925+ link = LINK_STYLE.format(link_url='#', link_text=CAPTCHA_RELOAD_TEXT)
1926 self.ui.refresh_label.setText(CAPTCHA_RELOAD_MESSAGE %
1927 {'reload_link': link})
1928
1929 if self.tc_url:
1930- terms_links = TERMS_LINK.format(toc_link=self.tc_url,
1931- terms_text=TERMS_TEXT)
1932+ terms_links = LINK_STYLE.format(link_url=self.tc_url,
1933+ link_text=TERMS_TEXT)
1934 if self.policy_url:
1935- privacy_policy_link = PRIVACY_POLICY_LINK.format(
1936- policy_link=self.policy_url,
1937- privacy_policy_text=PRIVACY_POLICY_TEXT)
1938+ privacy_policy_link = LINK_STYLE.format(link_url=self.policy_url,
1939+ link_text=PRIVACY_POLICY_TEXT)
1940
1941 terms = ''
1942 if self.tc_url and self.policy_url:
1943@@ -345,13 +338,12 @@
1944 self.show_error(self.app_name, error_msg)
1945 self._refresh_captcha()
1946
1947- def on_user_registered(self, app_name, result):
1948+ def on_user_registered(self, app_name, email):
1949 """Execute when the user did register."""
1950 self.hide_overlay()
1951 logger.debug('SetUpAccountPage.on_user_registered')
1952 email = unicode(self.ui.email_edit.text())
1953- password = unicode(self.ui.password_edit.text())
1954- self.userRegistered.emit(email, password)
1955+ self.userRegistered.emit(email)
1956
1957 def validate_form(self):
1958 """Validate the info of the form and return an error."""
1959@@ -473,7 +465,7 @@
1960
1961 def set_error_message(self, label, msg):
1962 """Set the message to the proper label applying the error style."""
1963- label.setText(ERROR % msg)
1964+ label.setText(ERROR_STYLE % msg)
1965 label.setVisible(True)
1966
1967 # pylint: disable=C0103
1968
1969=== modified file 'ubuntu_sso/qt/ssl_dialog.py'
1970--- ubuntu_sso/qt/ssl_dialog.py 2012-03-05 16:32:37 +0000
1971+++ ubuntu_sso/qt/ssl_dialog.py 2012-03-05 21:55:21 +0000
1972@@ -27,7 +27,7 @@
1973 )
1974
1975 from ubuntu_sso import USER_CANCELLATION, USER_SUCCESS
1976-from ubuntu_sso.logger import setup_logging
1977+from ubuntu_sso.logger import setup_gui_logging
1978 # Unused import resources_rc, pylint: disable=W0611
1979 from ubuntu_sso.qt.ui import resources_rc
1980 # pylint: enable=W0611
1981@@ -59,7 +59,7 @@
1982 '<li>%(third_reason)s</li>'
1983 '</ul>')
1984
1985-logger = setup_logging("ubuntu_sso.qt.proxy_dialog")
1986+logger = setup_gui_logging("ubuntu_sso.qt.proxy_dialog")
1987
1988
1989 class SSLDialog(QDialog):
1990
1991=== modified file 'ubuntu_sso/qt/sso_wizard_page.py'
1992--- ubuntu_sso/qt/sso_wizard_page.py 2012-03-01 19:44:56 +0000
1993+++ ubuntu_sso/qt/sso_wizard_page.py 2012-03-05 21:55:21 +0000
1994@@ -33,12 +33,12 @@
1995 from twisted.internet import defer
1996
1997 from ubuntu_sso import main
1998-from ubuntu_sso.logger import setup_logging
1999-from ubuntu_sso.qt import PREFERED_UI_SIZE
2000+from ubuntu_sso.logger import setup_gui_logging
2001+from ubuntu_sso.qt import PREFERED_UI_SIZE, TITLE_STYLE
2002 from ubuntu_sso.utils.ui import GENERIC_BACKEND_ERROR
2003
2004
2005-logger = setup_logging('ubuntu_sso.sso_wizard_page')
2006+logger = setup_gui_logging('ubuntu_sso.sso_wizard_page')
2007
2008
2009 class Header(QFrame):
2010@@ -172,11 +172,20 @@
2011
2012 def setTitle(self, title=''):
2013 """Set the Wizard Page Title."""
2014- self.header.set_title(title)
2015+ self.header.set_title(TITLE_STYLE % title)
2016
2017 def setSubTitle(self, subtitle=''):
2018 """Set the Wizard Page Subtitle."""
2019 self.header.set_subtitle(subtitle)
2020+
2021+ def title(self):
2022+ """Return the header's title."""
2023+ return self.header.title_label.text()
2024+
2025+ def subTitle(self):
2026+ """Return the header's subtitle."""
2027+ return self.header.subtitle_label.text()
2028+
2029 # pylint: enable=C0103
2030
2031 def _filter_by_app_name(self, f):
2032
2033=== modified file 'ubuntu_sso/qt/tests/__init__.py'
2034--- ubuntu_sso/qt/tests/__init__.py 2012-02-29 14:31:45 +0000
2035+++ ubuntu_sso/qt/tests/__init__.py 2012-03-05 21:55:21 +0000
2036@@ -21,6 +21,7 @@
2037 from twisted.trial.unittest import TestCase
2038
2039 from ubuntu_sso import main, NO_OP
2040+from ubuntu_sso.qt import TITLE_STYLE
2041 from ubuntu_sso.tests import (
2042 APP_NAME,
2043 HELP_TEXT,
2044@@ -421,7 +422,7 @@
2045
2046 self.app_name = APP_NAME
2047 self.ping_url = PING_URL
2048- self.signals_results = []
2049+ self.signal_results = []
2050
2051 # self.ui_class is not callable
2052 # pylint: disable=E1102, C0103, W0212
2053@@ -457,6 +458,15 @@
2054
2055 self.assertEqual(call[1], kwargs)
2056
2057+ def assert_signal_emitted(self, signal, signal_args,
2058+ trigger, *args, **kwargs):
2059+ """Check that 'trigger(*signal_args)' emits 'signal(*signal_args)'."""
2060+ signal.connect(lambda *a: self.signal_results.append(a))
2061+
2062+ trigger(*args, **kwargs)
2063+
2064+ self.assertEqual(self.signal_results, [signal_args])
2065+
2066 def get_pixmap_data(self, pixmap):
2067 """Get the raw data of a QPixmap."""
2068 byte_array = QtCore.QByteArray()
2069@@ -501,13 +511,13 @@
2070 self.assertEqual(expected, called)
2071
2072
2073-class BaseTestCasePage(BaseTestCase):
2074+class PageBaseTestCase(BaseTestCase):
2075
2076 """BaseTestCase with some specialization for the Wizard Pages."""
2077
2078 @defer.inlineCallbacks
2079 def setUp(self):
2080- yield super(BaseTestCasePage, self).setUp()
2081+ yield super(PageBaseTestCase, self).setUp()
2082 self._overlay_show_counter = 0
2083 self._overlay_hide_counter = 0
2084
2085@@ -526,3 +536,28 @@
2086 def _hide_overlay_slot(self):
2087 """Fake hide overlay slot."""
2088 self._overlay_hide_counter += 1
2089+
2090+ def assert_signal_emitted(self, signal, signal_args,
2091+ trigger, *args, **kwargs):
2092+ """Check that 'trigger(*args, **kwargs)' emits 'signal(*signal_args)'.
2093+
2094+ Also check that the _overlay_hide_counter was increased by one, and
2095+ that the ui is enabled.
2096+
2097+ """
2098+ super(PageBaseTestCase, self).assert_signal_emitted(signal,
2099+ signal_args, trigger, *args, **kwargs)
2100+ self.assertEqual(self._overlay_hide_counter, 1)
2101+ self.assertTrue(self.ui.isEnabled())
2102+
2103+ def assert_title_correct(self, expected):
2104+ """Check that the title is equal to 'expected'."""
2105+ self.assertEqual(TITLE_STYLE % expected, unicode(self.ui.title()))
2106+
2107+ def assert_subtitle_correct(self, expected):
2108+ """Check that the subtitle is equal to 'expected'."""
2109+ elided_text = unicode(self.ui.subTitle())
2110+ elided_text = elided_text[:len(elided_text) - 1]
2111+
2112+ self.assertTrue(expected.startswith(elided_text))
2113+ self.assertEqual(self.ui.header.subtitle_label.toolTip(), expected)
2114
2115=== modified file 'ubuntu_sso/qt/tests/test_current_user_sign_in_page.py'
2116--- ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-03-05 12:07:21 +0000
2117+++ ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-03-05 21:55:21 +0000
2118@@ -18,37 +18,23 @@
2119
2120 from PyQt4 import QtGui, QtCore
2121
2122-from ubuntu_sso.qt import current_user_sign_in_page
2123+from ubuntu_sso.qt import current_user_sign_in_page as gui
2124 from ubuntu_sso.qt.tests import (
2125- BaseTestCasePage,
2126+ PageBaseTestCase,
2127 FakePageUiStyle,
2128 FakeWizardButtonStyle,
2129 )
2130
2131
2132 # pylint: disable=W0212
2133-class CurrentUserSignInTestCase(BaseTestCasePage):
2134+
2135+class CurrentUserSignInTestCase(PageBaseTestCase):
2136 """Test the SetupAccountPage code."""
2137
2138- ui_class = current_user_sign_in_page.CurrentUserSignInPage
2139+ ui_class = gui.CurrentUserSignInPage
2140 ui_signals = ('userLoggedIn', 'passwordForgotten', 'userNotValidated')
2141 ui_backend_signals = ('LoggedIn', 'LoginError', 'UserNotValidated')
2142
2143- def test_on_user_not_validated(self):
2144- """Test the navigation flow on user not validated."""
2145- email = 'email@example'
2146- password = 'password'
2147- self.ui.ui.email_edit.setText(email)
2148- self.ui.ui.password_edit.setText(password)
2149-
2150- def slot(email, password):
2151- """Fake slot."""
2152- self.signals_results.append((email, password))
2153- self.ui.userNotValidated.connect(slot)
2154- self.ui.on_user_not_validated()
2155- self.assertEqual(self._overlay_hide_counter, 1)
2156- self.assertIn((email, password), self.signals_results)
2157-
2158 def test_initialize_page(self):
2159 """Test the initialization method."""
2160 wizard = FakeWizardButtonStyle()
2161@@ -67,30 +53,28 @@
2162
2163 def test_set_translated_strings(self):
2164 """Test the translated string method."""
2165- self.ui._set_translated_strings()
2166- self.assertEqual(self.ui.ui.email_label.text(),
2167- current_user_sign_in_page.EMAIL_LABEL)
2168+ expected = gui.LOGIN_TITLE.format(app_name=self.app_name)
2169+ self.assert_title_correct(expected)
2170+ expected = gui.LOGIN_SUBTITLE % dict(app_name=self.app_name)
2171+ self.assert_subtitle_correct(expected)
2172+ self.assertEqual(self.ui.ui.email_label.text(), gui.EMAIL_LABEL)
2173 self.assertEqual(self.ui.ui.password_label.text(),
2174- current_user_sign_in_page.LOGIN_PASSWORD_LABEL)
2175- text = current_user_sign_in_page.FORGOTTEN_PASSWORD_LINK_STYLE.format(
2176- forgotten_text=current_user_sign_in_page.FORGOTTEN_PASSWORD_BUTTON)
2177- self.assertEqual(self.ui.ui.forgot_password_label.text(),
2178- text)
2179- self.assertEqual(self.ui.ui.sign_in_button.text(),
2180- current_user_sign_in_page.SIGN_IN_BUTTON)
2181+ gui.LOGIN_PASSWORD_LABEL)
2182+ text = gui.LINK_STYLE.format(link_url='#',
2183+ link_text=gui.FORGOTTEN_PASSWORD_BUTTON)
2184+ self.assertEqual(self.ui.ui.forgot_password_label.text(), text)
2185+ self.assertEqual(self.ui.ui.sign_in_button.text(), gui.SIGN_IN_BUTTON)
2186
2187 def test_connect_ui(self):
2188 """Test the connect ui method."""
2189- self.ui._connect_ui()
2190- # We expect 2 values because _connect_ui is called in the init too.
2191 self.assertEqual(self.ui.ui.forgot_password_label.receivers(
2192- QtCore.SIGNAL("linkActivated(const QString&)")), 2)
2193+ QtCore.SIGNAL("linkActivated(const QString&)")), 1)
2194 self.assertEqual(self.ui.ui.email_edit.receivers(
2195- QtCore.SIGNAL("textChanged(const QString&)")), 2)
2196+ QtCore.SIGNAL("textChanged(const QString&)")), 1)
2197 self.assertEqual(self.ui.ui.password_edit.receivers(
2198- QtCore.SIGNAL("textChanged(const QString&)")), 2)
2199+ QtCore.SIGNAL("textChanged(const QString&)")), 1)
2200 self.assertEqual(self.ui.ui.sign_in_button.receivers(
2201- QtCore.SIGNAL("clicked()")), 2)
2202+ QtCore.SIGNAL("clicked()")), 1)
2203
2204 def test_validate_not_valid(self):
2205 """Test validate method."""
2206@@ -155,36 +139,26 @@
2207
2208 def test_on_logged_in(self):
2209 """Test the on_login_in method."""
2210- app_name = 'my_app'
2211 email = 'email@example'
2212- self.ui.app_name = app_name
2213 self.ui.ui.email_edit.setText(email)
2214
2215- def slot(app, email):
2216- """Fake slot."""
2217- self.signals_results.append((app, email))
2218- self.ui.userLoggedIn.connect(slot)
2219- self.ui.on_logged_in(app_name, None)
2220- self.assertEqual(self._overlay_hide_counter, 1)
2221+ self.assert_signal_emitted(self.ui.userLoggedIn, (email,),
2222+ self.ui.on_logged_in, self.app_name, email)
2223 self.assertTrue(self.ui.isEnabled())
2224- self.assertIn((app_name, email), self.signals_results)
2225+
2226+ def test_on_user_not_validated(self):
2227+ """Test the navigation flow on user not validated."""
2228+ email = 'email@example'
2229+ self.ui.ui.email_edit.setText(email)
2230+ self.assert_signal_emitted(self.ui.userNotValidated, (email,),
2231+ self.ui.on_user_not_validated, self.app_name, email)
2232
2233 def test_on_forgotten_password(self):
2234 """Test the on_forgotten_password method."""
2235-
2236- def slot():
2237- """Fake slot."""
2238- self.signals_results.append(1)
2239- self.ui.passwordForgotten.connect(slot)
2240- self.ui.on_forgotten_password()
2241- self.assertIn(1, self.signals_results)
2242+ self.assert_signal_emitted(self.ui.passwordForgotten, (),
2243+ self.ui.on_forgotten_password)
2244
2245 def test_on_forgotten_password_link_clicked(self):
2246- """Test the on_forgotten_password method."""
2247-
2248- def slot():
2249- """Fake slot."""
2250- self.signals_results.append(1)
2251- self.ui.passwordForgotten.connect(slot)
2252- self.ui.ui.forgot_password_label.linkActivated.emit("link")
2253- self.assertIn(1, self.signals_results)
2254+ """Forgotten passsword clicked emits passwordForgotten signal."""
2255+ self.assert_signal_emitted(self.ui.passwordForgotten, (),
2256+ self.ui.ui.forgot_password_label.linkActivated.emit, "link")
2257
2258=== modified file 'ubuntu_sso/qt/tests/test_email_verification.py'
2259--- ubuntu_sso/qt/tests/test_email_verification.py 2012-03-02 20:33:05 +0000
2260+++ ubuntu_sso/qt/tests/test_email_verification.py 2012-03-05 21:55:21 +0000
2261@@ -20,7 +20,7 @@
2262
2263 from ubuntu_sso.qt import email_verification_page
2264 from ubuntu_sso.qt.tests import (
2265- BaseTestCasePage,
2266+ PageBaseTestCase,
2267 FakePageUiStyle,
2268 )
2269
2270@@ -28,7 +28,7 @@
2271 # pylint: disable=W0212
2272
2273
2274-class EmailVerificationTestCase(BaseTestCasePage):
2275+class EmailVerificationTestCase(PageBaseTestCase):
2276 """Test the SetupAccountPage code."""
2277
2278 ui_class = email_verification_page.EmailVerificationPage
2279@@ -76,14 +76,12 @@
2280 def test_set_titles(self):
2281 """Test the set_titles method."""
2282 email = 'mail@example'
2283- app_name = 'my_app'
2284- self.ui.app_name = app_name
2285 self.ui.email = email
2286 self.ui.set_titles(email)
2287 self.assertEqual(self.ui.header.title_label.text(),
2288 email_verification_page.VERIFY_EMAIL_TITLE)
2289 expected = email_verification_page.VERIFY_EMAIL_CONTENT % {
2290- "app_name": app_name,
2291+ "app_name": self.app_name,
2292 "email": email,
2293 }
2294 self.assertEqual(unicode(self.ui.header.subtitle_label.toolTip()),
2295@@ -111,18 +109,11 @@
2296
2297 def test_on_email_validated(self):
2298 """Test the on_email_validated method."""
2299- app_name = 'my_app'
2300 email = 'email@example'
2301- self.ui.app_name = app_name
2302 self.ui.email = email
2303
2304- def slot(app, email):
2305- """Fake slot."""
2306- self.signals_results.append((app, email))
2307- self.ui.registrationSuccess.connect(slot)
2308- self.ui.on_email_validated(app_name)
2309- self.assertIn((app_name, email), self.signals_results)
2310- self.assertEqual(self._overlay_hide_counter, 1)
2311+ self.assert_signal_emitted(self.ui.registrationSuccess, (email,),
2312+ self.ui.on_email_validated, self.app_name, email)
2313
2314 def test_validate_email_with_ping(self):
2315 """Test the login method."""
2316
2317=== modified file 'ubuntu_sso/qt/tests/test_forgotten_password.py'
2318--- ubuntu_sso/qt/tests/test_forgotten_password.py 2012-03-01 20:46:34 +0000
2319+++ ubuntu_sso/qt/tests/test_forgotten_password.py 2012-03-05 21:55:21 +0000
2320@@ -16,11 +16,11 @@
2321
2322 """Tests for the Setup Account page Qt UI."""
2323
2324-from PyQt4 import QtGui, QtCore
2325+from PyQt4 import QtCore
2326
2327-from ubuntu_sso.qt import forgotten_password_page
2328+from ubuntu_sso.qt import forgotten_password_page as gui
2329 from ubuntu_sso.qt.tests import (
2330- BaseTestCasePage,
2331+ PageBaseTestCase,
2332 FakePageUiStyle,
2333 )
2334
2335@@ -28,82 +28,38 @@
2336 # pylint: disable=W0212, E1101
2337
2338
2339-class ForgottenPasswordTestCase(BaseTestCasePage):
2340+class ForgottenPasswordTestCase(PageBaseTestCase):
2341 """Test the SetupAccountPage code."""
2342
2343- ui_class = forgotten_password_page.ForgottenPasswordPage
2344+ ui_class = gui.ForgottenPasswordPage
2345 ui_siganls = ('passwordResetTokenSent',)
2346 ui_backend_siganls = ('PasswordResetTokenSent', 'PasswordResetError')
2347
2348 def test_request_new_password(self):
2349 """Test the request_new_password function."""
2350- app_name = 'my_app'
2351 email = 'email@example.com'
2352- self.ui.app_name = app_name
2353 self.ui.ui.email_line_edit.setText(email)
2354 self.ui.request_new_password()
2355 self.assertEqual(self._overlay_show_counter, 1)
2356 self.assertFalse(self.ui.isEnabled())
2357 self.assert_backend_called('request_password_reset_token',
2358- app_name, email)
2359-
2360- def test_email_widget(self):
2361- """Test the email_widget property."""
2362- value = self.ui.email_widget
2363- self.assertEqual(value, self.ui.ui.email_widget)
2364- self.assertTrue(isinstance(value, QtGui.QWidget))
2365-
2366- def test_forgotted_password_intro_label(self):
2367- """Test the forgotted_password_intro_label property."""
2368- value = self.ui.forgotted_password_intro_label
2369- self.assertEqual(value, self.ui.ui.forgotted_password_intro_label)
2370- self.assertTrue(isinstance(value, QtGui.QLabel))
2371-
2372- def test_email_address_label(self):
2373- """Test the email_address_label property."""
2374- value = self.ui.email_address_label
2375- self.assertEqual(value, self.ui.ui.email_address_label)
2376- self.assertTrue(isinstance(value, QtGui.QLabel))
2377+ self.app_name, email)
2378
2379 def test_email_address(self):
2380 """Test the email_address property."""
2381 value = self.ui.email_address
2382- self.assertEqual(value, str(self.ui.ui.email_line_edit.text()))
2383- self.assertTrue(isinstance(value, str))
2384-
2385- def test_email_address_line_edit(self):
2386- """Test the email_address_line_edit property."""
2387- value = self.ui.email_address_line_edit
2388- self.assertEqual(value, self.ui.ui.email_line_edit)
2389- self.assertTrue(isinstance(value, QtGui.QLineEdit))
2390-
2391- def test_send_button(self):
2392- """Test the send_button property."""
2393- value = self.ui.send_button
2394- self.assertEqual(value, self.ui.ui.send_button)
2395- self.assertTrue(isinstance(value, QtGui.QPushButton))
2396+ self.assertEqual(value, unicode(self.ui.ui.email_line_edit.text()))
2397+ self.assertTrue(isinstance(value, unicode))
2398
2399 def test_send_button_clicked(self):
2400 """Test the send_button property."""
2401 self.patch(self.ui, "hide_error", self._set_called)
2402- self.ui.send_button.clicked.emit(True)
2403+ self.ui.ui.send_button.clicked.emit(True)
2404 self.assert_backend_called('request_password_reset_token',
2405 self.app_name, '')
2406 expected = ((), {})
2407 self.assertEqual(expected, self._called)
2408
2409- def test_try_again_widget(self):
2410- """Test the try_again_widget property."""
2411- value = self.ui.try_again_widget
2412- self.assertEqual(value, self.ui.ui.try_again_widget)
2413- self.assertTrue(isinstance(value, QtGui.QWidget))
2414-
2415- def test_try_again_button(self):
2416- """Test the try_again_button property."""
2417- value = self.ui.try_again_button
2418- self.assertEqual(value, self.ui.ui.try_again_button)
2419- self.assertTrue(isinstance(value, QtGui.QPushButton))
2420-
2421 def test_initialize_page_with_email(self):
2422 """Test the initialization method."""
2423 self.ui.ui.email_line_edit.setText('mail@example')
2424@@ -115,36 +71,24 @@
2425
2426 def test_set_translated_strings(self):
2427 """Test the translated string method."""
2428- app_name = 'my_app'
2429- self.ui.app_name = app_name
2430- self.ui._set_translated_strings()
2431- expected = (forgotten_password_page.REQUEST_PASSWORD_TOKEN_LABEL %
2432- {'app_name': app_name})
2433- self.assertEqual(self.ui.ui.forgotted_password_intro_label.text(),
2434- expected)
2435+ self.assert_title_correct(gui.FORGOTTEN_PASSWORD_TITLE)
2436+ subtitle = gui.FORGOTTEN_PASSWORD_SUBTITLE
2437+ self.assert_subtitle_correct(subtitle.format(app_name=self.app_name))
2438+
2439 self.assertEqual(self.ui.ui.email_address_label.text(),
2440- forgotten_password_page.EMAIL_LABEL)
2441- self.assertEqual(self.ui.ui.send_button.text(),
2442- forgotten_password_page.RESET_PASSWORD)
2443- self.assertEqual(self.ui.ui.try_again_button.text(),
2444- forgotten_password_page.TRY_AGAIN_BUTTON)
2445+ gui.EMAIL_LABEL)
2446+ self.assertEqual(self.ui.ui.send_button.text(), gui.RESET_PASSWORD)
2447
2448 def test_connect_ui(self):
2449 """Test the connect ui method."""
2450- self.ui._connect_ui()
2451- # We expect 2 values because _connect_ui is called in the init too.
2452- # For email_line_edit we expect 3 because has another
2453- # connection in the .ui file.
2454 self.assertEqual(self.ui.ui.email_line_edit.receivers(
2455- QtCore.SIGNAL("textChanged(const QString&)")), 3)
2456+ QtCore.SIGNAL("textChanged(const QString&)")), 2)
2457 self.assertEqual(self.ui.ui.send_button.receivers(
2458- QtCore.SIGNAL("clicked()")), 2)
2459- self.assertEqual(self.ui.ui.try_again_button.receivers(
2460- QtCore.SIGNAL("clicked()")), 2)
2461+ QtCore.SIGNAL("clicked()")), 1)
2462
2463 def test_validate_not_valid(self):
2464 """Test validate method."""
2465- self.ui.email_address_line_edit.setText('')
2466+ self.ui.ui.email_line_edit.setText('')
2467 button = FakePageUiStyle()
2468 self.patch(self.ui.ui, "send_button", button)
2469 self.ui._validate()
2470@@ -152,58 +96,23 @@
2471
2472 def test_validate_valid(self):
2473 """Test validate method."""
2474- self.ui.email_address_line_edit.setText('mail@example')
2475+ self.ui.ui.email_line_edit.setText('mail@example')
2476 button = FakePageUiStyle()
2477 self.patch(self.ui.ui, "send_button", button)
2478 self.ui._validate()
2479 self.assertTrue(button.isEnabled())
2480
2481- def test_on_try_again(self):
2482- """Test on_try_again method."""
2483- self.patch(self.ui, "hide_error", self._set_called)
2484- self.ui.show()
2485- self.addCleanup(self.ui.hide)
2486- self.ui.on_try_again()
2487- self.assertTrue(self.ui.email_widget.isVisible())
2488- self.assertFalse(self.ui.try_again_widget.isVisible())
2489- expected = ((), {})
2490- self.assertEqual(expected, self._called)
2491-
2492 def test_on_password_reset_token_sent(self):
2493 """Test on_password_reset_token_sent method."""
2494-
2495- def slot():
2496- """Fake slot."""
2497- self.signals_results.append(1)
2498- self.ui.passwordResetTokenSent.connect(slot)
2499- self.ui.on_password_reset_token_sent('app_name', {})
2500- self.assertEqual(self._overlay_hide_counter, 1)
2501- self.assertTrue(self.ui.isEnabled())
2502- self.assertTrue(1 in self.signals_results)
2503+ email = 'foo@ubuntu.com'
2504+ self.assert_signal_emitted(self.ui.passwordResetTokenSent, (email,),
2505+ self.ui.on_password_reset_token_sent, self.app_name, email)
2506
2507 def test_on_password_reset_error(self):
2508 """Test on_password_reset_error method."""
2509 self.patch(self.ui, "show_error", self._set_called)
2510- app_name = 'my_app'
2511- error = {'errtype': 'AnotherError'}
2512- self.ui.show()
2513- self.addCleanup(self.ui.hide)
2514- self.ui.on_password_reset_error(app_name, error)
2515- expected = ((self.ui, app_name,
2516- forgotten_password_page.REQUEST_PASSWORD_TOKEN_TECH_ERROR), {})
2517- self.assertTrue(expected, self._called)
2518- self.assertFalse(self.ui.email_widget.isVisible())
2519- self.assertFalse(self.ui.forgotted_password_intro_label.isVisible())
2520- self.assertTrue(self.ui.try_again_widget.isVisible())
2521- self.assertEqual(self._overlay_hide_counter, 1)
2522- self.assertTrue(self.ui.isEnabled())
2523-
2524- def test_on_password_reset_error_with_token_error(self):
2525- """Test on_password_reset_error method."""
2526- self.patch(self.ui, "show_error", self._set_called)
2527- app_name = 'my_app'
2528- error = {'errtype': 'ResetPasswordTokenError'}
2529- self.ui.on_password_reset_error(app_name, error)
2530- expected = ((self.ui, app_name,
2531- forgotten_password_page.REQUEST_PASSWORD_TOKEN_WRONG_EMAIL), {})
2532+ error = {'errtype': 'FooBarBaz'}
2533+ self.ui.on_password_reset_error(self.app_name, error)
2534+ expected = ((self.ui, self.app_name,
2535+ gui.REQUEST_PASSWORD_TOKEN_WRONG_EMAIL), {})
2536 self.assertTrue(expected, self._called)
2537
2538=== modified file 'ubuntu_sso/qt/tests/test_network_detection.py'
2539--- ubuntu_sso/qt/tests/test_network_detection.py 2012-02-29 14:00:12 +0000
2540+++ ubuntu_sso/qt/tests/test_network_detection.py 2012-03-05 21:55:21 +0000
2541@@ -20,7 +20,7 @@
2542
2543 from ubuntu_sso.qt import network_detection_page
2544 from ubuntu_sso.qt.tests import (
2545- BaseTestCase,
2546+ PageBaseTestCase,
2547 FakeWizardButtonStyle,
2548 )
2549
2550@@ -28,7 +28,7 @@
2551 # pylint: disable=W0212, E1101
2552
2553
2554-class NetworkDetectionTestCase(BaseTestCase):
2555+class NetworkDetectionTestCase(PageBaseTestCase):
2556
2557 """Test the CurrentUserController."""
2558
2559
2560=== modified file 'ubuntu_sso/qt/tests/test_reset_password.py'
2561--- ubuntu_sso/qt/tests/test_reset_password.py 2012-03-01 20:46:34 +0000
2562+++ ubuntu_sso/qt/tests/test_reset_password.py 2012-03-05 21:55:21 +0000
2563@@ -30,7 +30,7 @@
2564 RESET_SUBTITLE,
2565 RESET_TITLE,
2566 )
2567-from ubuntu_sso.qt.tests import BaseTestCase
2568+from ubuntu_sso.qt.tests import PageBaseTestCase
2569
2570
2571 # We need this Fake until a future refactor.
2572@@ -54,7 +54,7 @@
2573 return self.line_text
2574
2575
2576-class ResetPasswordTestCase(BaseTestCase):
2577+class ResetPasswordTestCase(PageBaseTestCase):
2578 """Test the ResetPasswordPage code."""
2579
2580 ui_class = ResetPasswordPage
2581@@ -73,9 +73,8 @@
2582 self.ui.show()
2583 self.ui.initializePage()
2584 self.addCleanup(self.ui.hide)
2585- self.assertEqual(self.ui.header.title_label.text(), RESET_TITLE)
2586- self.assertEqual(self.ui.header.subtitle_label.text(),
2587- RESET_SUBTITLE)
2588+ self.assert_title_correct(RESET_TITLE)
2589+ self.assert_subtitle_correct(RESET_SUBTITLE)
2590 self.assertEqual(self.ui.ui.password_label.text(), PASSWORD1_ENTRY)
2591 self.assertEqual(self.ui.ui.confirm_password_label.text(),
2592 PASSWORD2_ENTRY)
2593
2594=== modified file 'ubuntu_sso/qt/tests/test_setup_account.py'
2595--- ubuntu_sso/qt/tests/test_setup_account.py 2012-03-05 19:58:07 +0000
2596+++ ubuntu_sso/qt/tests/test_setup_account.py 2012-03-05 21:55:21 +0000
2597@@ -18,17 +18,14 @@
2598
2599 from PyQt4 import QtGui, QtCore
2600
2601-from ubuntu_sso.qt import common, setup_account_page
2602-from ubuntu_sso.qt.tests import (
2603- BaseTestCasePage,
2604- HELP_TEXT,
2605-)
2606-
2607-
2608-class SetupAccountTestCase(BaseTestCasePage):
2609+from ubuntu_sso.qt import common, setup_account_page as gui
2610+from ubuntu_sso.qt.tests import PageBaseTestCase
2611+
2612+
2613+class SetupAccountTestCase(PageBaseTestCase):
2614 """Test the SetupAccountPage code."""
2615
2616- ui_class = setup_account_page.SetupAccountPage
2617+ ui_class = gui.SetupAccountPage
2618 ui_signals = ('userRegistered',)
2619 ui_backend_signals = ('CaptchaGenerated', 'CaptchaGenerationError',
2620 'UserRegistered', 'UserRegistrationError')
2621@@ -51,7 +48,7 @@
2622 self.assertTrue(self.ui.ui.name_assistance.isVisible())
2623 self.assertEqual(
2624 unicode(self.ui.ui.name_assistance.text()),
2625- setup_account_page.ERROR % setup_account_page.EMPTY_NAME)
2626+ gui.ERROR_STYLE % gui.EMPTY_NAME)
2627 self.ui.hide()
2628
2629 def test_enable_setup_button_with_visible_check(self):
2630@@ -176,16 +173,10 @@
2631 def test_set_next_validation(self):
2632 """Test on_user_registered method."""
2633 email = 'email@example'
2634- password = 'password'
2635 self.ui.ui.email_edit.setText(email)
2636- self.ui.ui.password_edit.setText(password)
2637
2638- def slot(email, password):
2639- """Fake slot."""
2640- self.signals_results.append((email, password))
2641- self.ui.userRegistered.connect(slot)
2642- self.ui.on_user_registered('app_name', None)
2643- self.assertIn((email, password), self.signals_results)
2644+ self.assert_signal_emitted(self.ui.userRegistered, (email,),
2645+ self.ui.on_user_registered, self.app_name, email)
2646
2647 def test_captcha_image_is_requested_as_startup(self):
2648 """The captcha image is requested at startup."""
2649@@ -193,29 +184,24 @@
2650 self.assert_backend_called('generate_captcha',
2651 self.app_name, self.ui.captcha_file)
2652
2653+ def test_set_translated_strings(self):
2654+ """Test the translated string method."""
2655+ expected = gui.REGISTER_TITLE.format(app_name=self.app_name)
2656+ self.assert_title_correct(expected)
2657+ self.assert_subtitle_correct(self.ui.help_text)
2658+
2659 def test_initialize_page(self):
2660 """Widgets are properly initialized."""
2661 self.ui.initializePage()
2662 self.ui.show()
2663 self.addCleanup(self.ui.hide)
2664
2665- # titles
2666- title = unicode(self.ui.header.title_label.text())
2667- title_expected = (setup_account_page.TITLE_STYLE %
2668- setup_account_page.TITLE.format(app_name=self.app_name))
2669- self.assertEqual(title, title_expected)
2670-
2671- elided_text = unicode(self.ui.header.subtitle_label.text())
2672- elided_text = elided_text[:len(elided_text) - 1]
2673- self.assertTrue(HELP_TEXT.startswith(elided_text))
2674- self.assertEqual(self.ui.header.subtitle_label.toolTip(), HELP_TEXT)
2675-
2676 # set up account button
2677 expected = [QtGui.QWizard.BackButton, QtGui.QWizard.Stretch,
2678 QtGui.QWizard.CustomButton3]
2679 self.assertIn(('setButtonLayout', ((expected,), {})),
2680 self.ui.wizard().called)
2681- self.assertEqual(setup_account_page.SET_UP_ACCOUNT_BUTTON,
2682+ self.assertEqual(gui.SET_UP_ACCOUNT_BUTTON,
2683 self.ui.buttonText(QtGui.QWizard.CustomButton3))
2684 self.assertTrue(self.ui.wizard().button(QtGui.QWizard.CustomButton3) is
2685 self.ui.set_up_button)
2686@@ -224,16 +210,13 @@
2687 self.assertFalse(self.ui.captcha_received)
2688
2689 # labels
2690- self.assertEqual(self.ui.ui.name_label.text(),
2691- setup_account_page.NAME_ENTRY)
2692- self.assertEqual(self.ui.ui.email_label.text(),
2693- setup_account_page.EMAIL)
2694+ self.assertEqual(self.ui.ui.name_label.text(), gui.NAME_ENTRY)
2695+ self.assertEqual(self.ui.ui.email_label.text(), gui.EMAIL)
2696 self.assertEqual(self.ui.ui.confirm_email_label.text(),
2697- setup_account_page.RETYPE_EMAIL)
2698- self.assertEqual(self.ui.ui.password_label.text(),
2699- setup_account_page.PASSWORD)
2700+ gui.RETYPE_EMAIL)
2701+ self.assertEqual(self.ui.ui.password_label.text(), gui.PASSWORD)
2702 self.assertEqual(self.ui.ui.confirm_password_label.text(),
2703- setup_account_page.RETYPE_PASSWORD)
2704+ gui.RETYPE_PASSWORD)
2705
2706 # assistants
2707 self.assertFalse(self.ui.ui.name_assistance.isVisible())
2708@@ -262,7 +245,7 @@
2709 self.assertTrue(self.ui.ui.email_assistance.isVisible())
2710 self.assertEqual(
2711 unicode(self.ui.ui.email_assistance.text()),
2712- setup_account_page.ERROR % "message")
2713+ gui.ERROR_STYLE % "message")
2714
2715 def test_blank_name(self):
2716 """Status when the name field is blank (spaces).
2717@@ -277,7 +260,7 @@
2718 self.assertTrue(self.ui.ui.name_assistance.isVisible())
2719 self.assertEqual(
2720 unicode(self.ui.ui.name_assistance.text()),
2721- setup_account_page.ERROR % setup_account_page.EMPTY_NAME)
2722+ gui.ERROR_STYLE % gui.EMPTY_NAME)
2723 self.ui.hide()
2724
2725 def test_valid_name(self):
2726@@ -305,7 +288,7 @@
2727 self.assertTrue(self.ui.ui.email_assistance.isVisible())
2728 self.assertEqual(
2729 unicode(self.ui.ui.email_assistance.text()),
2730- setup_account_page.ERROR % setup_account_page.INVALID_EMAIL)
2731+ gui.ERROR_STYLE % gui.INVALID_EMAIL)
2732
2733 def test_valid_email(self):
2734 """Status when the email field has a @.
2735@@ -346,7 +329,7 @@
2736 self.assertTrue(self.ui.ui.confirm_email_assistance.isVisible())
2737 self.assertEqual(
2738 unicode(self.ui.ui.confirm_email_assistance.text()),
2739- setup_account_page.ERROR % setup_account_page.EMAIL_MATCH)
2740+ gui.ERROR_STYLE % gui.EMAIL_MATCH)
2741 self.ui.hide()
2742
2743 def test_focus_changed_password_visibility(self):
2744
2745=== modified file 'ubuntu_sso/qt/tests/test_sso_wizard_page.py'
2746--- ubuntu_sso/qt/tests/test_sso_wizard_page.py 2012-03-01 12:30:13 +0000
2747+++ ubuntu_sso/qt/tests/test_sso_wizard_page.py 2012-03-05 21:55:21 +0000
2748@@ -21,7 +21,7 @@
2749 from ubuntu_sso.qt import PREFERED_UI_SIZE
2750 from ubuntu_sso.qt.setup_account_page import SetupAccountPage
2751 from ubuntu_sso.qt.sso_wizard_page import Header
2752-from ubuntu_sso.qt.tests import BaseTestCase
2753+from ubuntu_sso.qt.tests import BaseTestCase, PageBaseTestCase
2754
2755
2756 class HeaderTest(BaseTestCase):
2757@@ -84,39 +84,30 @@
2758 self.assertFalse(self.header.title_label.isVisible())
2759
2760
2761-class SSOWizardPageTest(BaseTestCase):
2762+class SSOWizardPageTest(PageBaseTestCase):
2763
2764 """Tests for SSOWizardPage."""
2765
2766- @defer.inlineCallbacks
2767- def setUp(self):
2768- yield super(SSOWizardPageTest, self).setUp()
2769- self.app_name = 'app_name'
2770- # We need to choose some specific page to test SSOWizardPage,
2771- # because the __init__ of SSOWizardPage fails by its own.
2772- self.sso_wizard_page = SetupAccountPage(self.app_name)
2773+ ui_class = SetupAccountPage
2774
2775 def test_show_error(self):
2776 """Test show_error with a normal length string."""
2777 message = 'error-message'
2778- self.sso_wizard_page.show_error(self.app_name, message)
2779- self.assertEqual(
2780- self.sso_wizard_page.form_errors_label.toolTip(), message)
2781- expected = unicode(self.sso_wizard_page.form_errors_label.text())
2782+ self.ui.show_error(self.app_name, message)
2783+ self.assertEqual(self.ui.form_errors_label.toolTip(), message)
2784+ expected = unicode(self.ui.form_errors_label.text())
2785 self.assertEqual(expected, message)
2786
2787 def test_show_error_long_text(self):
2788 """Test show_error with a long length string."""
2789 message = 'a' * int(PREFERED_UI_SIZE['width'] * 0.95) + 'a'
2790- self.sso_wizard_page.show_error(self.app_name, message)
2791- self.assertEqual(
2792- self.sso_wizard_page.form_errors_label.toolTip(), message)
2793- expected = unicode(self.sso_wizard_page.form_errors_label.text())
2794+ self.ui.show_error(self.app_name, message)
2795+ self.assertEqual(self.ui.form_errors_label.toolTip(), message)
2796+ expected = unicode(self.ui.form_errors_label.text())
2797 self.assertTrue(expected.endswith(u'\u2026'))
2798
2799 def test_hide_error(self):
2800 """Test show_error with a long length string."""
2801 message = ' '
2802- self.sso_wizard_page.hide_error()
2803- self.assertEqual(
2804- self.sso_wizard_page.form_errors_label.text(), message)
2805+ self.ui.hide_error()
2806+ self.assertEqual(self.ui.form_errors_label.text(), message)
2807
2808=== modified file 'ubuntu_sso/qt/ubuntu_sso_wizard.py'
2809--- ubuntu_sso/qt/ubuntu_sso_wizard.py 2012-03-05 14:15:44 +0000
2810+++ ubuntu_sso/qt/ubuntu_sso_wizard.py 2012-03-05 21:55:21 +0000
2811@@ -29,7 +29,7 @@
2812 USER_CANCELLATION,
2813 USER_SUCCESS,
2814 )
2815-from ubuntu_sso.logger import setup_logging
2816+from ubuntu_sso.logger import setup_gui_logging
2817 from ubuntu_sso.qt import PREFERED_UI_SIZE
2818 from ubuntu_sso.qt.current_user_sign_in_page import CurrentUserSignInPage
2819 from ubuntu_sso.qt.email_verification_page import EmailVerificationPage
2820@@ -40,7 +40,7 @@
2821 from ubuntu_sso.qt.setup_account_page import SetupAccountPage
2822 from ubuntu_sso.qt.success_page import SuccessPage
2823
2824-logger = setup_logging('ubuntu_sso.gui')
2825+logger = setup_gui_logging('ubuntu_sso.gui')
2826
2827
2828 class UbuntuSSOWizard(QWizard):
2829
2830=== modified file 'ubuntu_sso/utils/ui.py'
2831--- ubuntu_sso/utils/ui.py 2012-03-05 15:58:16 +0000
2832+++ ubuntu_sso/utils/ui.py 2012-03-05 21:55:21 +0000
2833@@ -45,8 +45,8 @@
2834 CAPTCHA_REQUIRED_ERROR = _('The captcha is a required field')
2835 CLOSE_AND_SETUP_LATER = _('Close window and setup later')
2836 CONGRATULATIONS = _("Congratulations, {app_name} is installed!")
2837-CONNECT_HELP_LABEL = _('To connect this computer to %(app_name)s ' \
2838- 'enter your details below.')
2839+CONNECT_HELP_LABEL = _('To connect this computer to %(app_name)s enter your '
2840+ 'details below.')
2841 EMAIL_LABEL = EMAIL1_ENTRY = _('Email address')
2842 EMAIL2_ENTRY = _('Re-type Email address')
2843 EMAIL_INVALID = _('The email must be a valid email address.')
2844@@ -61,6 +61,10 @@
2845 EXISTING_ACCOUNT_CHOICE_BUTTON = _('Sign me in with my existing account')
2846 FIELD_REQUIRED = _('This field is required.')
2847 FORGOTTEN_PASSWORD_BUTTON = _('I\'ve forgotten my password')
2848+FORGOTTEN_PASSWORD_TITLE = _('Reset password')
2849+FORGOTTEN_PASSWORD_SUBTITLE = _('To reset your {app_name} password, enter '
2850+ 'your registered email address below. We will send instructions to reset '
2851+ 'your password.')
2852 INVALID_EMAIL = _("Please enter a valid email address")
2853 GENERIC_BACKEND_ERROR = _('There was a problem accessing the Ubuntu Single'
2854 ' Sign On backend.')
2855@@ -72,6 +76,8 @@
2856 LOGIN_HEADER_LABEL = _('Connect to %(app_name)s')
2857 LOGIN_PASSWORD_ENTRY = _('Password')
2858 LOGIN_PASSWORD_LABEL = LOGIN_PASSWORD_ENTRY
2859+LOGIN_TITLE = _('Sign In to {app_name}')
2860+LOGIN_SUBTITLE = CONNECT_HELP_LABEL
2861 NAME_ENTRY = _('Name')
2862 NAME_INVALID = _('The name must not be empty.')
2863 NEXT = _('Next')
2864@@ -84,12 +90,12 @@
2865 PASSWORD_DIGIT = _("At least one number")
2866 PASSWORD1_ENTRY = RESET_PASSWORD1_ENTRY = _('Password')
2867 PASSWORD2_ENTRY = RESET_PASSWORD2_ENTRY = _('Re-type Password')
2868-PASSWORD_HELP = _('The password must have a minimum of 8 characters and ' \
2869- 'include one uppercase character and one number.')
2870+PASSWORD_HELP = _('The password must have a minimum of 8 characters and '
2871+ 'include one uppercase character and one number.')
2872 PASSWORD_LENGTH = _("At least 8 characters")
2873 PASSWORD_MATCH = _("Passwords don't match")
2874-PASSWORD_MISMATCH = _('The passwords don\'t match, please double check ' \
2875- 'and try entering them again.')
2876+PASSWORD_MISMATCH = _('The passwords don\'t match, please double check '
2877+ 'and try entering them again.')
2878 PASSWORD_MUST_CONTAIN = _("Your password must contain")
2879 PASSWORD_TOO_WEAK = _('The password is too weak.')
2880 PASSWORD_UPPER = _("At least one uppercase letter")
2881@@ -104,24 +110,22 @@
2882 PROXY_CREDS_SAVE_BUTTON = _('Save and Connect')
2883 PROXY_CREDS_USER_LABEL = _('Proxy username:')
2884 RESET_TITLE = _("Reset password")
2885-RESET_SUBTITLE = _("A password reset code has been sent to your e-mail."
2886- "Please enter the code below along with your new password.")
2887+RESET_SUBTITLE = _('A password reset code has been sent to your e-mail. '
2888+ 'Please enter the code below along with your new password.')
2889 RETYPE_EMAIL = _("Retype email")
2890 RETYPE_PASSWORD = _("Retype password")
2891 REQUEST_PASSWORD_TOKEN_LABEL = _('To reset your %(app_name)s password,'
2892 ' enter your email address below:')
2893 REQUEST_PASSWORD_TOKEN_TECH_ERROR = _('We are very Sorry! The service that'
2894- ' signs you on is not responding right'
2895- ' now\nPlease try again or come back in'
2896- ' a few minutes.')
2897+ ' signs you on is not responding right now\nPlease try again or'
2898+ ' come back in a few minutes.')
2899 REQUEST_PASSWORD_TOKEN_WRONG_EMAIL = _('Sorry we did not recognize the email'
2900- ' address.')
2901+ ' address.')
2902 RESET_CODE_ENTRY = _('Reset code')
2903 RESET_EMAIL_ENTRY = _('Email address')
2904-RESET_PASSWORD = _('Reset password')
2905-SET_NEW_PASSWORD_LABEL = _('A password reset code has been sent to ' \
2906- '%(email)s.\nPlease enter the code below ' \
2907- 'along with your new password.')
2908+RESET_PASSWORD = RESET_TITLE
2909+SET_NEW_PASSWORD_LABEL = _('A password reset code has been sent to '
2910+ '%(email)s.\nPlease enter the code below along with your new password.')
2911 SET_UP_ACCOUNT_BUTTON = _('Set Up Account')
2912 SET_UP_ACCOUNT_CHOICE_BUTTON = _('I don\'t have an account yet - sign me up')
2913 SIGN_IN_BUTTON = _('Sign In')
2914@@ -133,8 +137,8 @@
2915 SSL_DIALOG_TITLE = _('SSL Certificate Not Valid')
2916 SSL_DOMAIN_HELP = _('the domain whose ssl certificate we are going to show.')
2917 SSL_EXPLANATION = _('You are trying to connect to a proxy server on'
2918- ' %(domain)s. This server uses a secure connection,'
2919- ' and the SSL certificate is not valid because:')
2920+ ' %(domain)s. This server uses a secure connection, and the SSL '
2921+ 'certificate is not valid because:')
2922 SSL_FIRST_REASON = _('The certificate has not been verified')
2923 SSL_HEADER = _('Do you want to connect to this server?')
2924 SSL_HELP_BUTTON = _('Get Help With SSL')
2925@@ -142,25 +146,24 @@
2926 ' connect to %(app_name)s.')
2927 SSL_REMEMBER_DECISION = _('Remember my settings for this certificate.')
2928 SSL_SECOND_REASON = _('The name on the certificate isn\'t valid or doesn\'t'
2929- ' match the name of the site')
2930+ ' match the name of the site')
2931 SSL_THIRD_REASON = _('The certificate has expired')
2932 SUCCESS = _('You are now logged into %(app_name)s.')
2933 SURNAME_ENTRY = _('Surname')
2934 TERMS_TEXT = _("Terms of Service")
2935-TITLE = _("Sign Up to {app_name}")
2936+TITLE = REGISTER_TITLE = _("Sign Up to {app_name}")
2937 TC_BUTTON = _('Show Terms & Conditions')
2938-TC_NOT_ACCEPTED = _('Agreeing to the %(app_name)s Terms & Conditions is ' \
2939- 'required to subscribe.')
2940+TC_NOT_ACCEPTED = _('Agreeing to the %(app_name)s Terms & Conditions is '
2941+ 'required to subscribe.')
2942 TOS_LABEL = _("You can also find these terms at <a href='%(url)s'>%(url)s</a>")
2943 TRY_AGAIN_BUTTON = _('Try again')
2944-UNKNOWN_ERROR = _('There was an error when trying to complete the ' \
2945- 'process. Please check the information and try again.')
2946+UNKNOWN_ERROR = _('There was an error when trying to complete the '
2947+ 'process. Please check the information and try again.')
2948 VERIFICATION_CODE = _('Verification code')
2949-VERIFY_EMAIL_CONTENT = _('Check %(email)s for an email from'
2950- ' Ubuntu Single Sign On.'
2951- ' This message contains a verification code.'
2952- ' Enter the code in the field below and click OK'
2953- ' to complete creating your %(app_name)s account.')
2954+VERIFY_EMAIL_CONTENT = _('Check %(email)s for an email from Ubuntu Single '
2955+ 'Sign On. This message contains a verification code. Enter the code in '
2956+ 'the field below and click OK to complete creating your %(app_name)s '
2957+ 'account.')
2958 VERIFY_EMAIL_TITLE = _('Enter verification code')
2959 VERIFY_EMAIL_LABEL = ('<b>%s</b>\n\n' % VERIFY_EMAIL_TITLE +
2960 VERIFY_EMAIL_CONTENT)

Subscribers

People subscribed via source and target branches