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

Proposed by Natalia Bidart
Status: Merged
Approved by: Natalia Bidart
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
data/qt/current_user_sign_in.ui (+115/-133)
data/qt/email_verification.ui (+56/-64)
data/qt/forgotten_password.ui (+34/-108)
data/qt/reset_password.ui (+235/-241)
data/qt/setup_account.ui (+99/-113)
data/qt/stylesheet.qss (+1/-0)
ubuntu_sso/qt/__init__.py (+4/-0)
ubuntu_sso/qt/current_user_sign_in_page.py (+17/-16)
ubuntu_sso/qt/email_verification_page.py (+8/-6)
ubuntu_sso/qt/forgotten_password_page.py (+28/-84)
ubuntu_sso/qt/proxy_dialog.py (+2/-2)
ubuntu_sso/qt/reset_password_page.py (+4/-4)
ubuntu_sso/qt/setup_account_page.py (+18/-26)
ubuntu_sso/qt/ssl_dialog.py (+2/-2)
ubuntu_sso/qt/sso_wizard_page.py (+13/-4)
ubuntu_sso/qt/tests/__init__.py (+38/-3)
ubuntu_sso/qt/tests/test_current_user_sign_in_page.py (+33/-59)
ubuntu_sso/qt/tests/test_email_verification.py (+5/-14)
ubuntu_sso/qt/tests/test_forgotten_password.py (+26/-117)
ubuntu_sso/qt/tests/test_network_detection.py (+2/-2)
ubuntu_sso/qt/tests/test_reset_password.py (+4/-5)
ubuntu_sso/qt/tests/test_setup_account.py (+25/-42)
ubuntu_sso/qt/tests/test_sso_wizard_page.py (+11/-20)
ubuntu_sso/qt/ubuntu_sso_wizard.py (+2/-2)
ubuntu_sso/utils/ui.py (+32/-29)
To merge this branch: bzr merge lp:~nataliabidart/ubuntu-sso-client/login-titles
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Diego Sarmentero (community) Approve
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

Wrong order!

906. By Natalia Bidart

- Attach bug number.

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
907. By Natalia Bidart

Setup account xml cleanup.

Revision history for this message
Roberto Alsina (ralsina) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/qt/current_user_sign_in.ui'
--- data/qt/current_user_sign_in.ui 2012-02-22 16:58:08 +0000
+++ data/qt/current_user_sign_in.ui 2012-03-05 21:55:21 +0000
@@ -6,147 +6,100 @@
6 <rect>6 <rect>
7 <x>0</x>7 <x>0</x>
8 <y>0</y>8 <y>0</y>
9 <width>399</width>9 <width>302</width>
10 <height>309</height>10 <height>244</height>
11 </rect>11 </rect>
12 </property>12 </property>
13 <layout class="QVBoxLayout" name="verticalLayout_4">13 <layout class="QVBoxLayout" name="verticalLayout_2">
14 <property name="topMargin">14 <property name="spacing">
15 <number>15</number>
16 </property>
17 <property name="margin">
15 <number>0</number>18 <number>0</number>
16 </property>19 </property>
17 <item>20 <item>
18 <layout class="QHBoxLayout" name="horizontalLayout_3">21 <layout class="QVBoxLayout" name="verticalLayout">
19 <item>22 <property name="spacing">
20 <layout class="QVBoxLayout" name="verticalLayout">23 <number>3</number>
21 <item>24 </property>
22 <spacer name="verticalSpacer_3">25 <item>
23 <property name="orientation">26 <widget class="QLabel" name="email_label">
24 <enum>Qt::Vertical</enum>27 <property name="text">
25 </property>28 <string notr="true">&amp;Email</string>
26 <property name="sizeHint" stdset="0">29 </property>
27 <size>30 <property name="buddy">
28 <width>20</width>31 <cstring>email_edit</cstring>
29 <height>40</height>32 </property>
30 </size>33 </widget>
31 </property>34 </item>
32 </spacer>35 <item>
33 </item>36 <widget class="QLineEdit" name="email_edit">
34 <item>37 <property name="minimumSize">
35 <widget class="QFrame" name="_signInFrame">38 <size>
36 <property name="frameShape">39 <width>300</width>
37 <enum>QFrame::NoFrame</enum>40 <height>0</height>
38 </property>41 </size>
39 <layout class="QVBoxLayout" name="verticalLayout_3">42 </property>
40 <item>43 <property name="placeholderText">
41 <layout class="QVBoxLayout" name="verticalLayout_2">44 <string/>
42 <item>45 </property>
43 <widget class="QLabel" name="email_label">46 </widget>
44 <property name="text">47 </item>
45 <string notr="true">&amp;Email</string>48 </layout>
46 </property>49 </item>
47 <property name="buddy">50 <item>
48 <cstring>email_edit</cstring>51 <layout class="QVBoxLayout" name="verticalLayout_3">
49 </property>52 <property name="spacing">
50 </widget>53 <number>3</number>
51 </item>54 </property>
52 <item>55 <item>
53 <widget class="QLineEdit" name="email_edit">56 <widget class="QLabel" name="password_label">
54 <property name="placeholderText">57 <property name="text">
55 <string/>58 <string notr="true">&amp;Password</string>
56 </property>59 </property>
57 </widget>60 <property name="buddy">
58 </item>61 <cstring>password_edit</cstring>
59 <item>62 </property>
60 <widget class="QLabel" name="password_label">63 </widget>
61 <property name="text">64 </item>
62 <string notr="true">&amp;Password</string>65 <item>
63 </property>66 <widget class="QLineEdit" name="password_edit">
64 <property name="buddy">67 <property name="minimumSize">
65 <cstring>password_edit</cstring>68 <size>
66 </property>69 <width>300</width>
67 </widget>70 <height>0</height>
68 </item>71 </size>
69 <item>72 </property>
70 <widget class="QLineEdit" name="password_edit">73 <property name="echoMode">
71 <property name="echoMode">74 <enum>QLineEdit::Password</enum>
72 <enum>QLineEdit::Password</enum>75 </property>
73 </property>76 <property name="placeholderText">
74 <property name="placeholderText">77 <string/>
75 <string/>78 </property>
76 </property>79 </widget>
77 </widget>80 </item>
78 </item>81 </layout>
79 <item>82 </item>
80 <widget class="QLabel" name="forgot_password_label">83 <item>
81 <property name="sizePolicy">84 <widget class="QLabel" name="forgot_password_label">
82 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">85 <property name="sizePolicy">
83 <horstretch>0</horstretch>86 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
84 <verstretch>0</verstretch>87 <horstretch>0</horstretch>
85 </sizepolicy>88 <verstretch>0</verstretch>
86 </property>89 </sizepolicy>
87 <property name="text">90 </property>
88 <string notr="true">Forgot password?</string>91 <property name="text">
89 </property>92 <string notr="true">Forgot password?</string>
90 </widget>93 </property>
91 </item>94 </widget>
92 <item>95 </item>
93 <layout class="QHBoxLayout" name="horizontalLayout_4">96 <item>
94 <item>97 <layout class="QHBoxLayout" name="horizontalLayout_4">
95 <spacer name="horizontalSpacer_3">98 <item>
96 <property name="orientation">99 <spacer name="horizontalSpacer_3">
97 <enum>Qt::Horizontal</enum>
98 </property>
99 <property name="sizeHint" stdset="0">
100 <size>
101 <width>40</width>
102 <height>20</height>
103 </size>
104 </property>
105 </spacer>
106 </item>
107 <item>
108 <widget class="QPushButton" name="sign_in_button">
109 <property name="enabled">
110 <bool>false</bool>
111 </property>
112 <property name="text">
113 <string notr="true">Sign In</string>
114 </property>
115 <property name="default">
116 <bool>true</bool>
117 </property>
118 </widget>
119 </item>
120 </layout>
121 </item>
122 </layout>
123 </item>
124 </layout>
125 </widget>
126 </item>
127 <item>
128 <spacer name="verticalSpacer_2">
129 <property name="orientation">
130 <enum>Qt::Vertical</enum>
131 </property>
132 <property name="sizeHint" stdset="0">
133 <size>
134 <width>20</width>
135 <height>40</height>
136 </size>
137 </property>
138 </spacer>
139 </item>
140 </layout>
141 </item>
142 <item>
143 <spacer name="horizontalSpacer">
144 <property name="orientation">100 <property name="orientation">
145 <enum>Qt::Horizontal</enum>101 <enum>Qt::Horizontal</enum>
146 </property>102 </property>
147 <property name="sizeType">
148 <enum>QSizePolicy::Fixed</enum>
149 </property>
150 <property name="sizeHint" stdset="0">103 <property name="sizeHint" stdset="0">
151 <size>104 <size>
152 <width>40</width>105 <width>40</width>
@@ -155,9 +108,38 @@
155 </property>108 </property>
156 </spacer>109 </spacer>
157 </item>110 </item>
111 <item>
112 <widget class="QPushButton" name="sign_in_button">
113 <property name="enabled">
114 <bool>false</bool>
115 </property>
116 <property name="text">
117 <string notr="true">Sign In</string>
118 </property>
119 <property name="default">
120 <bool>true</bool>
121 </property>
122 </widget>
123 </item>
158 </layout>124 </layout>
159 </item>125 </item>
126 <item>
127 <spacer name="verticalSpacer">
128 <property name="orientation">
129 <enum>Qt::Vertical</enum>
130 </property>
131 <property name="sizeHint" stdset="0">
132 <size>
133 <width>20</width>
134 <height>40</height>
135 </size>
136 </property>
137 </spacer>
138 </item>
160 </layout>139 </layout>
140 <zorder>verticalSpacer</zorder>
141 <zorder>forgot_password_label</zorder>
142 <zorder></zorder>
161 </widget>143 </widget>
162 <resources/>144 <resources/>
163 <connections>145 <connections>
164146
=== modified file 'data/qt/email_verification.ui'
--- data/qt/email_verification.ui 2012-02-22 16:58:08 +0000
+++ data/qt/email_verification.ui 2012-03-05 21:55:21 +0000
@@ -6,79 +6,51 @@
6 <rect>6 <rect>
7 <x>0</x>7 <x>0</x>
8 <y>0</y>8 <y>0</y>
9 <width>400</width>9 <width>300</width>
10 <height>300</height>10 <height>148</height>
11 </rect>11 </rect>
12 </property>12 </property>
13 <property name="minimumSize">
14 <size>
15 <width>300</width>
16 <height>0</height>
17 </size>
18 </property>
13 <layout class="QVBoxLayout" name="verticalLayout_2">19 <layout class="QVBoxLayout" name="verticalLayout_2">
14 <property name="topMargin">20 <property name="spacing">
21 <number>15</number>
22 </property>
23 <property name="margin">
15 <number>0</number>24 <number>0</number>
16 </property>25 </property>
17 <item>26 <item>
18 <layout class="QHBoxLayout" name="horizontalLayout_3">27 <layout class="QVBoxLayout" name="verticalLayout">
19 <item>28 <property name="spacing">
20 <layout class="QVBoxLayout" name="verticalLayout">29 <number>3</number>
21 <item>30 </property>
22 <widget class="QLabel" name="label">31 <item>
23 <property name="text">32 <widget class="QLabel" name="label">
24 <string notr="true">Verification code</string>33 <property name="text">
25 </property>34 <string notr="true">Verification code</string>
26 </widget>35 </property>
27 </item>36 </widget>
28 <item>37 </item>
29 <widget class="QLineEdit" name="verification_code_edit">38 <item>
30 <property name="placeholderText">39 <widget class="QLineEdit" name="verification_code_edit">
31 <string/>40 <property name="placeholderText">
32 </property>41 <string/>
33 </widget>42 </property>
34 </item>43 </widget>
35 <item>44 </item>
36 <layout class="QHBoxLayout" name="horizontalLayout_2">45 </layout>
37 <item>46 </item>
38 <spacer name="horizontalSpacer_3">47 <item>
39 <property name="orientation">48 <layout class="QHBoxLayout" name="horizontalLayout_2">
40 <enum>Qt::Horizontal</enum>49 <item>
41 </property>50 <spacer name="horizontalSpacer_3">
42 <property name="sizeHint" stdset="0">
43 <size>
44 <width>40</width>
45 <height>20</height>
46 </size>
47 </property>
48 </spacer>
49 </item>
50 <item>
51 <widget class="QPushButton" name="next_button">
52 <property name="text">
53 <string notr="true">Next</string>
54 </property>
55 </widget>
56 </item>
57 </layout>
58 </item>
59 <item>
60 <spacer name="verticalSpacer_2">
61 <property name="orientation">
62 <enum>Qt::Vertical</enum>
63 </property>
64 <property name="sizeHint" stdset="0">
65 <size>
66 <width>20</width>
67 <height>40</height>
68 </size>
69 </property>
70 </spacer>
71 </item>
72 </layout>
73 </item>
74 <item>
75 <spacer name="horizontalSpacer">
76 <property name="orientation">51 <property name="orientation">
77 <enum>Qt::Horizontal</enum>52 <enum>Qt::Horizontal</enum>
78 </property>53 </property>
79 <property name="sizeType">
80 <enum>QSizePolicy::Fixed</enum>
81 </property>
82 <property name="sizeHint" stdset="0">54 <property name="sizeHint" stdset="0">
83 <size>55 <size>
84 <width>40</width>56 <width>40</width>
@@ -87,8 +59,28 @@
87 </property>59 </property>
88 </spacer>60 </spacer>
89 </item>61 </item>
62 <item>
63 <widget class="QPushButton" name="next_button">
64 <property name="text">
65 <string notr="true">Next</string>
66 </property>
67 </widget>
68 </item>
90 </layout>69 </layout>
91 </item>70 </item>
71 <item>
72 <spacer name="verticalSpacer_2">
73 <property name="orientation">
74 <enum>Qt::Vertical</enum>
75 </property>
76 <property name="sizeHint" stdset="0">
77 <size>
78 <width>20</width>
79 <height>40</height>
80 </size>
81 </property>
82 </spacer>
83 </item>
92 </layout>84 </layout>
93 </widget>85 </widget>
94 <resources/>86 <resources/>
9587
=== modified file 'data/qt/forgotten_password.ui'
--- data/qt/forgotten_password.ui 2012-02-22 16:58:08 +0000
+++ data/qt/forgotten_password.ui 2012-03-05 21:55:21 +0000
@@ -6,65 +6,46 @@
6 <rect>6 <rect>
7 <x>0</x>7 <x>0</x>
8 <y>0</y>8 <y>0</y>
9 <width>230</width>9 <width>148</width>
10 <height>234</height>10 <height>148</height>
11 </rect>11 </rect>
12 </property>12 </property>
13 <layout class="QVBoxLayout" name="verticalLayout_2">13 <layout class="QVBoxLayout" name="verticalLayout_2">
14 <property name="topMargin">14 <property name="spacing">
15 <number>15</number>
16 </property>
17 <property name="margin">
15 <number>0</number>18 <number>0</number>
16 </property>19 </property>
17 <item>20 <item>
18 <widget class="QLabel" name="forgotted_password_intro_label">21 <layout class="QVBoxLayout" name="verticalLayout">
19 <property name="text">22 <property name="spacing">
20 <string notr="true"/>23 <number>3</number>
21 </property>24 </property>
22 <property name="wordWrap">25 <item>
23 <bool>true</bool>26 <widget class="QLabel" name="email_address_label">
24 </property>27 <property name="sizePolicy">
25 </widget>28 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
26 </item>29 <horstretch>0</horstretch>
27 <item>30 <verstretch>0</verstretch>
28 <widget class="QWidget" name="email_widget" native="true">31 </sizepolicy>
29 <layout class="QHBoxLayout" name="horizontalLayout_2">32 </property>
30 <item>33 <property name="text">
31 <layout class="QVBoxLayout" name="verticalLayout">34 <string notr="true"/>
32 <item>35 </property>
33 <widget class="QLabel" name="email_address_label">36 </widget>
34 <property name="sizePolicy">37 </item>
35 <sizepolicy hsizetype="Preferred" vsizetype="Fixed">38 <item>
36 <horstretch>0</horstretch>39 <widget class="QLineEdit" name="email_line_edit">
37 <verstretch>0</verstretch>40 <property name="minimumSize">
38 </sizepolicy>41 <size>
39 </property>42 <width>300</width>
40 <property name="text">43 <height>0</height>
41 <string notr="true"/>44 </size>
42 </property>45 </property>
43 </widget>46 </widget>
44 </item>47 </item>
45 <item>48 </layout>
46 <widget class="QLineEdit" name="email_line_edit"/>
47 </item>
48 </layout>
49 </item>
50 <item>
51 <spacer name="horizontalSpacer_3">
52 <property name="orientation">
53 <enum>Qt::Horizontal</enum>
54 </property>
55 <property name="sizeType">
56 <enum>QSizePolicy::Fixed</enum>
57 </property>
58 <property name="sizeHint" stdset="0">
59 <size>
60 <width>40</width>
61 <height>20</height>
62 </size>
63 </property>
64 </spacer>
65 </item>
66 </layout>
67 </widget>
68 </item>49 </item>
69 <item>50 <item>
70 <layout class="QHBoxLayout" name="horizontalLayout">51 <layout class="QHBoxLayout" name="horizontalLayout">
@@ -91,64 +72,9 @@
91 </property>72 </property>
92 </widget>73 </widget>
93 </item>74 </item>
94 <item>
95 <spacer name="horizontalSpacer_4">
96 <property name="orientation">
97 <enum>Qt::Horizontal</enum>
98 </property>
99 <property name="sizeType">
100 <enum>QSizePolicy::Fixed</enum>
101 </property>
102 <property name="sizeHint" stdset="0">
103 <size>
104 <width>40</width>
105 <height>20</height>
106 </size>
107 </property>
108 </spacer>
109 </item>
110 </layout>75 </layout>
111 </item>76 </item>
112 <item>77 <item>
113 <widget class="QWidget" name="try_again_widget" native="true">
114 <layout class="QHBoxLayout" name="horizontalLayout_3">
115 <item>
116 <spacer name="horizontalSpacer_5">
117 <property name="orientation">
118 <enum>Qt::Horizontal</enum>
119 </property>
120 <property name="sizeHint" stdset="0">
121 <size>
122 <width>40</width>
123 <height>20</height>
124 </size>
125 </property>
126 </spacer>
127 </item>
128 <item>
129 <widget class="QPushButton" name="try_again_button">
130 <property name="text">
131 <string notr="true"/>
132 </property>
133 </widget>
134 </item>
135 <item>
136 <spacer name="horizontalSpacer_6">
137 <property name="orientation">
138 <enum>Qt::Horizontal</enum>
139 </property>
140 <property name="sizeHint" stdset="0">
141 <size>
142 <width>40</width>
143 <height>20</height>
144 </size>
145 </property>
146 </spacer>
147 </item>
148 </layout>
149 </widget>
150 </item>
151 <item>
152 <spacer name="verticalSpacer">78 <spacer name="verticalSpacer">
153 <property name="orientation">79 <property name="orientation">
154 <enum>Qt::Vertical</enum>80 <enum>Qt::Vertical</enum>
15581
=== modified file 'data/qt/reset_password.ui'
--- data/qt/reset_password.ui 2012-02-22 16:58:08 +0000
+++ data/qt/reset_password.ui 2012-03-05 21:55:21 +0000
@@ -6,232 +6,217 @@
6 <rect>6 <rect>
7 <x>0</x>7 <x>0</x>
8 <y>0</y>8 <y>0</y>
9 <width>542</width>9 <width>544</width>
10 <height>437</height>10 <height>280</height>
11 </rect>11 </rect>
12 </property>12 </property>
13 <property name="layoutDirection">13 <property name="layoutDirection">
14 <enum>Qt::LeftToRight</enum>14 <enum>Qt::LeftToRight</enum>
15 </property>15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout">16 <layout class="QVBoxLayout" name="verticalLayout_6">
17 <property name="spacing">17 <property name="spacing">
18 <number>6</number>18 <number>15</number>
19 </property>19 </property>
20 <property name="margin">20 <property name="margin">
21 <number>0</number>21 <number>0</number>
22 </property>22 </property>
23 <item>23 <item>
24 <layout class="QHBoxLayout" name="horizontalLayout">24 <layout class="QHBoxLayout" name="horizontalLayout">
25 <property name="spacing">
26 <number>0</number>
27 </property>
25 <item>28 <item>
26 <layout class="QVBoxLayout" name="verticalLayout_2">29 <layout class="QVBoxLayout" name="verticalLayout_5">
27 <item>30 <property name="spacing">
28 <widget class="QLabel" name="reset_code">31 <number>15</number>
29 <property name="sizePolicy">32 </property>
30 <sizepolicy hsizetype="Minimum" vsizetype="Preferred">33 <item>
31 <horstretch>0</horstretch>34 <layout class="QVBoxLayout" name="verticalLayout_4">
32 <verstretch>0</verstretch>35 <property name="spacing">
33 </sizepolicy>36 <number>3</number>
34 </property>37 </property>
35 <property name="minimumSize">38 <item>
36 <size>39 <widget class="QLabel" name="reset_code">
37 <width>310</width>40 <property name="sizePolicy">
38 <height>0</height>41 <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
39 </size>42 <horstretch>0</horstretch>
40 </property>43 <verstretch>0</verstretch>
41 <property name="maximumSize">44 </sizepolicy>
42 <size>45 </property>
43 <width>16777215</width>46 <property name="minimumSize">
44 <height>16777215</height>47 <size>
45 </size>48 <width>310</width>
46 </property>49 <height>0</height>
47 <property name="font">50 </size>
48 <font>51 </property>
49 <weight>75</weight>52 <property name="maximumSize">
50 <bold>true</bold>53 <size>
51 </font>54 <width>16777215</width>
52 </property>55 <height>16777215</height>
53 <property name="text">56 </size>
54 <string notr="true">reset_code</string>57 </property>
55 </property>58 <property name="font">
56 </widget>59 <font>
57 </item>60 <weight>75</weight>
58 <item>61 <bold>true</bold>
59 <widget class="QLineEdit" name="reset_code_line_edit">62 </font>
60 <property name="sizePolicy">63 </property>
61 <sizepolicy hsizetype="Minimum" vsizetype="Fixed">64 <property name="text">
62 <horstretch>0</horstretch>65 <string notr="true">reset_code</string>
63 <verstretch>0</verstretch>66 </property>
64 </sizepolicy>67 </widget>
65 </property>68 </item>
66 <property name="minimumSize">69 <item>
67 <size>70 <widget class="QLineEdit" name="reset_code_line_edit">
68 <width>300</width>71 <property name="sizePolicy">
69 <height>0</height>72 <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
70 </size>73 <horstretch>0</horstretch>
71 </property>74 <verstretch>0</verstretch>
72 <property name="maximumSize">75 </sizepolicy>
73 <size>76 </property>
74 <width>300</width>77 <property name="minimumSize">
75 <height>16777215</height>78 <size>
76 </size>79 <width>300</width>
77 </property>80 <height>0</height>
78 </widget>81 </size>
79 </item>82 </property>
80 <item>83 <property name="maximumSize">
81 <widget class="QLabel" name="password_label">84 <size>
82 <property name="sizePolicy">85 <width>300</width>
83 <sizepolicy hsizetype="Minimum" vsizetype="Preferred">86 <height>16777215</height>
84 <horstretch>0</horstretch>87 </size>
85 <verstretch>0</verstretch>88 </property>
86 </sizepolicy>89 </widget>
87 </property>90 </item>
88 <property name="minimumSize">91 </layout>
89 <size>92 </item>
90 <width>310</width>93 <item>
91 <height>0</height>94 <layout class="QVBoxLayout" name="verticalLayout">
92 </size>95 <property name="spacing">
93 </property>96 <number>3</number>
94 <property name="maximumSize">97 </property>
95 <size>98 <item>
96 <width>16777215</width>99 <widget class="QLabel" name="password_label">
97 <height>16777215</height>100 <property name="sizePolicy">
98 </size>101 <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
99 </property>102 <horstretch>0</horstretch>
100 <property name="font">103 <verstretch>0</verstretch>
101 <font>104 </sizepolicy>
102 <weight>75</weight>105 </property>
103 <bold>true</bold>106 <property name="minimumSize">
104 </font>107 <size>
105 </property>108 <width>310</width>
106 <property name="text">109 <height>0</height>
107 <string notr="true">password_label</string>110 </size>
108 </property>111 </property>
109 </widget>112 <property name="maximumSize">
110 </item>113 <size>
111 <item>114 <width>16777215</width>
112 <widget class="QLineEdit" name="password_line_edit">115 <height>16777215</height>
113 <property name="sizePolicy">116 </size>
114 <sizepolicy hsizetype="Minimum" vsizetype="Fixed">117 </property>
115 <horstretch>0</horstretch>118 <property name="font">
116 <verstretch>0</verstretch>119 <font>
117 </sizepolicy>120 <weight>75</weight>
118 </property>121 <bold>true</bold>
119 <property name="minimumSize">122 </font>
120 <size>123 </property>
121 <width>300</width>124 <property name="text">
122 <height>0</height>125 <string notr="true">password_label</string>
123 </size>126 </property>
124 </property>127 </widget>
125 <property name="maximumSize">128 </item>
126 <size>129 <item>
127 <width>300</width>130 <widget class="QLineEdit" name="password_line_edit">
128 <height>16777215</height>131 <property name="sizePolicy">
129 </size>132 <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
130 </property>133 <horstretch>0</horstretch>
131 <property name="echoMode">134 <verstretch>0</verstretch>
132 <enum>QLineEdit::Password</enum>135 </sizepolicy>
133 </property>136 </property>
134 </widget>137 <property name="minimumSize">
135 </item>138 <size>
136 <item>139 <width>300</width>
137 <widget class="QLabel" name="confirm_password_label">140 <height>0</height>
138 <property name="sizePolicy">141 </size>
139 <sizepolicy hsizetype="Minimum" vsizetype="Preferred">142 </property>
140 <horstretch>0</horstretch>143 <property name="maximumSize">
141 <verstretch>0</verstretch>144 <size>
142 </sizepolicy>145 <width>300</width>
143 </property>146 <height>16777215</height>
144 <property name="minimumSize">147 </size>
145 <size>148 </property>
146 <width>310</width>149 <property name="echoMode">
147 <height>0</height>150 <enum>QLineEdit::Password</enum>
148 </size>151 </property>
149 </property>152 </widget>
150 <property name="font">153 </item>
151 <font>154 </layout>
152 <weight>75</weight>155 </item>
153 <bold>true</bold>156 <item>
154 </font>157 <layout class="QVBoxLayout" name="verticalLayout_2">
155 </property>158 <property name="spacing">
156 <property name="text">159 <number>3</number>
157 <string notr="true">confirm_password_label</string>160 </property>
158 </property>161 <item>
159 </widget>162 <widget class="QLabel" name="confirm_password_label">
160 </item>163 <property name="sizePolicy">
161 <item>164 <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
162 <widget class="QLineEdit" name="confirm_password_line_edit">165 <horstretch>0</horstretch>
163 <property name="sizePolicy">166 <verstretch>0</verstretch>
164 <sizepolicy hsizetype="Minimum" vsizetype="Fixed">167 </sizepolicy>
165 <horstretch>0</horstretch>168 </property>
166 <verstretch>0</verstretch>169 <property name="minimumSize">
167 </sizepolicy>170 <size>
168 </property>171 <width>310</width>
169 <property name="minimumSize">172 <height>0</height>
170 <size>173 </size>
171 <width>300</width>174 </property>
172 <height>0</height>175 <property name="font">
173 </size>176 <font>
174 </property>177 <weight>75</weight>
175 <property name="maximumSize">178 <bold>true</bold>
176 <size>179 </font>
177 <width>300</width>180 </property>
178 <height>16777215</height>181 <property name="text">
179 </size>182 <string notr="true">confirm_password_label</string>
180 </property>183 </property>
181 <property name="echoMode">184 </widget>
182 <enum>QLineEdit::Password</enum>185 </item>
183 </property>186 <item>
184 </widget>187 <widget class="QLineEdit" name="confirm_password_line_edit">
185 </item>188 <property name="sizePolicy">
186 <item>189 <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
187 <spacer name="verticalSpacer">190 <horstretch>0</horstretch>
188 <property name="orientation">191 <verstretch>0</verstretch>
189 <enum>Qt::Vertical</enum>192 </sizepolicy>
190 </property>193 </property>
191 <property name="sizeHint" stdset="0">194 <property name="minimumSize">
192 <size>195 <size>
193 <width>300</width>196 <width>300</width>
194 <height>222</height>197 <height>0</height>
195 </size>198 </size>
196 </property>199 </property>
197 </spacer>200 <property name="maximumSize">
198 </item>201 <size>
199 <item>202 <width>300</width>
200 <spacer name="horizontalSpacer_2">203 <height>16777215</height>
201 <property name="orientation">204 </size>
202 <enum>Qt::Horizontal</enum>205 </property>
203 </property>206 <property name="echoMode">
204 <property name="sizeType">207 <enum>QLineEdit::Password</enum>
205 <enum>QSizePolicy::Fixed</enum>208 </property>
206 </property>209 </widget>
207 <property name="sizeHint" stdset="0">210 </item>
208 <size>211 </layout>
209 <width>300</width>
210 <height>0</height>
211 </size>
212 </property>
213 </spacer>
214 </item>212 </item>
215 </layout>213 </layout>
216 </item>214 </item>
217 <item>215 <item>
218 <layout class="QVBoxLayout" name="verticalLayout_3">216 <layout class="QVBoxLayout" name="verticalLayout_3">
219 <item>217 <property name="spacing">
220 <spacer name="verticalSpacer_3">218 <number>0</number>
221 <property name="orientation">219 </property>
222 <enum>Qt::Vertical</enum>
223 </property>
224 <property name="sizeType">
225 <enum>QSizePolicy::Fixed</enum>
226 </property>
227 <property name="sizeHint" stdset="0">
228 <size>
229 <width>20</width>
230 <height>55</height>
231 </size>
232 </property>
233 </spacer>
234 </item>
235 <item>220 <item>
236 <widget class="QLabel" name="password_assistance">221 <widget class="QLabel" name="password_assistance">
237 <property name="sizePolicy">222 <property name="sizePolicy">
@@ -294,42 +279,51 @@
294 </layout>279 </layout>
295 </item>280 </item>
296 <item>281 <item>
297 <layout class="QHBoxLayout" name="horizontalLayout_2">282 <layout class="QHBoxLayout" name="horizontalLayout_3">
298 <item>283 <property name="rightMargin">
299 <layout class="QHBoxLayout" name="horizontalLayout_3">284 <number>0</number>
300 <property name="rightMargin">285 </property>
301 <number>0</number>286 <item>
302 </property>287 <spacer name="horizontalSpacer_4">
303 <item>288 <property name="orientation">
304 <spacer name="horizontalSpacer_4">289 <enum>Qt::Horizontal</enum>
305 <property name="orientation">290 </property>
306 <enum>Qt::Horizontal</enum>291 <property name="sizeType">
307 </property>292 <enum>QSizePolicy::Expanding</enum>
308 <property name="sizeType">293 </property>
309 <enum>QSizePolicy::Expanding</enum>294 <property name="sizeHint" stdset="0">
310 </property>295 <size>
311 <property name="sizeHint" stdset="0">296 <width>40</width>
312 <size>297 <height>20</height>
313 <width>40</width>298 </size>
314 <height>20</height>299 </property>
315 </size>300 </spacer>
316 </property>301 </item>
317 </spacer>302 <item>
318 </item>303 <widget class="QPushButton" name="reset_password_button">
319 <item>304 <property name="enabled">
320 <widget class="QPushButton" name="reset_password_button">305 <bool>false</bool>
321 <property name="enabled">306 </property>
322 <bool>false</bool>307 <property name="text">
323 </property>308 <string notr="true"/>
324 <property name="text">309 </property>
325 <string notr="true"/>310 </widget>
326 </property>
327 </widget>
328 </item>
329 </layout>
330 </item>311 </item>
331 </layout>312 </layout>
332 </item>313 </item>
314 <item>
315 <spacer name="verticalSpacer">
316 <property name="orientation">
317 <enum>Qt::Vertical</enum>
318 </property>
319 <property name="sizeHint" stdset="0">
320 <size>
321 <width>20</width>
322 <height>40</height>
323 </size>
324 </property>
325 </spacer>
326 </item>
333 </layout>327 </layout>
334 </widget>328 </widget>
335 <resources/>329 <resources/>
336330
=== modified file 'data/qt/setup_account.ui'
--- data/qt/setup_account.ui 2012-03-01 20:13:02 +0000
+++ data/qt/setup_account.ui 2012-03-05 21:55:21 +0000
@@ -6,8 +6,8 @@
6 <rect>6 <rect>
7 <x>0</x>7 <x>0</x>
8 <y>0</y>8 <y>0</y>
9 <width>543</width>9 <width>532</width>
10 <height>476</height>10 <height>438</height>
11 </rect>11 </rect>
12 </property>12 </property>
13 <property name="sizePolicy">13 <property name="sizePolicy">
@@ -26,16 +26,7 @@
26 <property name="spacing">26 <property name="spacing">
27 <number>0</number>27 <number>0</number>
28 </property>28 </property>
29 <property name="leftMargin">29 <property name="margin">
30 <number>0</number>
31 </property>
32 <property name="topMargin">
33 <number>0</number>
34 </property>
35 <property name="rightMargin">
36 <number>3</number>
37 </property>
38 <property name="bottomMargin">
39 <number>0</number>30 <number>0</number>
40 </property>31 </property>
41 <item>32 <item>
@@ -43,24 +34,50 @@
43 <property name="sizeConstraint">34 <property name="sizeConstraint">
44 <enum>QLayout::SetDefaultConstraint</enum>35 <enum>QLayout::SetDefaultConstraint</enum>
45 </property>36 </property>
46 <item row="1" column="1">37 <property name="verticalSpacing">
47 <spacer name="verticalSpacer">38 <number>6</number>
48 <property name="orientation">39 </property>
49 <enum>Qt::Vertical</enum>40 <item row="4" column="0" colspan="2">
50 </property>41 <spacer name="verticalSpacer_2">
51 <property name="sizeType">42 <property name="orientation">
52 <enum>QSizePolicy::Fixed</enum>43 <enum>Qt::Vertical</enum>
53 </property>44 </property>
54 <property name="sizeHint" stdset="0">45 <property name="sizeHint" stdset="0">
55 <size>46 <size>
56 <width>20</width>47 <width>20</width>
57 <height>15</height>48 <height>10</height>
49 </size>
50 </property>
51 </spacer>
52 </item>
53 <item row="10" column="0" colspan="2">
54 <spacer name="verticalSpacer_3">
55 <property name="orientation">
56 <enum>Qt::Vertical</enum>
57 </property>
58 <property name="sizeHint" stdset="0">
59 <size>
60 <width>20</width>
61 <height>10</height>
62 </size>
63 </property>
64 </spacer>
65 </item>
66 <item row="7" column="0" colspan="2">
67 <spacer name="verticalSpacer_4">
68 <property name="orientation">
69 <enum>Qt::Vertical</enum>
70 </property>
71 <property name="sizeHint" stdset="0">
72 <size>
73 <width>20</width>
74 <height>10</height>
58 </size>75 </size>
59 </property>76 </property>
60 </spacer>77 </spacer>
61 </item>78 </item>
62 <item row="0" column="0">79 <item row="0" column="0">
63 <layout class="QVBoxLayout" name="verticalLayout">80 <layout class="QVBoxLayout" name="verticalLayout_5">
64 <property name="spacing">81 <property name="spacing">
65 <number>3</number>82 <number>3</number>
66 </property>83 </property>
@@ -110,7 +127,7 @@
110 </layout>127 </layout>
111 </item>128 </item>
112 <item row="2" column="0">129 <item row="2" column="0">
113 <layout class="QVBoxLayout" name="verticalLayout">130 <layout class="QVBoxLayout" name="verticalLayout_6">
114 <property name="spacing">131 <property name="spacing">
115 <number>3</number>132 <number>3</number>
116 </property>133 </property>
@@ -204,7 +221,7 @@
204 </layout>221 </layout>
205 </item>222 </item>
206 <item row="3" column="0">223 <item row="3" column="0">
207 <layout class="QVBoxLayout" name="verticalLayout">224 <layout class="QVBoxLayout" name="verticalLayout_10">
208 <property name="spacing">225 <property name="spacing">
209 <number>3</number>226 <number>3</number>
210 </property>227 </property>
@@ -300,45 +317,13 @@
300 </item>317 </item>
301 </layout>318 </layout>
302 </item>319 </item>
303 <item row="4" column="1">320 <item row="11" column="0" colspan="2">
304 <spacer name="verticalSpacer_2">
305 <property name="orientation">
306 <enum>Qt::Vertical</enum>
307 </property>
308 <property name="sizeType">
309 <enum>QSizePolicy::Fixed</enum>
310 </property>
311 <property name="sizeHint" stdset="0">
312 <size>
313 <width>20</width>
314 <height>15</height>
315 </size>
316 </property>
317 </spacer>
318 </item>
319 <item row="9" column="1">
320 <spacer name="verticalSpacer_5">
321 <property name="orientation">
322 <enum>Qt::Vertical</enum>
323 </property>
324 <property name="sizeType">
325 <enum>QSizePolicy::Fixed</enum>
326 </property>
327 <property name="sizeHint" stdset="0">
328 <size>
329 <width>20</width>
330 <height>15</height>
331 </size>
332 </property>
333 </spacer>
334 </item>
335 <item row="10" column="0" colspan="2">
336 <layout class="QHBoxLayout" name="hlayout_check">321 <layout class="QHBoxLayout" name="hlayout_check">
337 <property name="spacing">322 <property name="spacing">
338 <number>0</number>323 <number>6</number>
339 </property>324 </property>
340 <property name="topMargin">325 <property name="topMargin">
341 <number>10</number>326 <number>0</number>
342 </property>327 </property>
343 </layout>328 </layout>
344 </item>329 </item>
@@ -384,7 +369,7 @@
384 </layout>369 </layout>
385 </item>370 </item>
386 <item row="5" column="0">371 <item row="5" column="0">
387 <layout class="QVBoxLayout" name="verticalLayout">372 <layout class="QVBoxLayout" name="verticalLayout_3">
388 <property name="spacing">373 <property name="spacing">
389 <number>3</number>374 <number>3</number>
390 </property>375 </property>
@@ -447,6 +432,9 @@
447 </item>432 </item>
448 <item row="5" column="1" rowspan="2">433 <item row="5" column="1" rowspan="2">
449 <layout class="QHBoxLayout" name="horizontalLayout_3">434 <layout class="QHBoxLayout" name="horizontalLayout_3">
435 <property name="spacing">
436 <number>0</number>
437 </property>
450 <item>438 <item>
451 <widget class="QLabel" name="password_assistance">439 <widget class="QLabel" name="password_assistance">
452 <property name="sizePolicy">440 <property name="sizePolicy">
@@ -481,7 +469,7 @@
481 </layout>469 </layout>
482 </item>470 </item>
483 <item row="6" column="0">471 <item row="6" column="0">
484 <layout class="QVBoxLayout" name="verticalLayout">472 <layout class="QVBoxLayout" name="verticalLayout_2">
485 <property name="spacing">473 <property name="spacing">
486 <number>3</number>474 <number>3</number>
487 </property>475 </property>
@@ -536,31 +524,15 @@
536 </item>524 </item>
537 </layout>525 </layout>
538 </item>526 </item>
539 <item row="7" column="1">
540 <spacer name="verticalSpacer_3">
541 <property name="orientation">
542 <enum>Qt::Vertical</enum>
543 </property>
544 <property name="sizeType">
545 <enum>QSizePolicy::Fixed</enum>
546 </property>
547 <property name="sizeHint" stdset="0">
548 <size>
549 <width>20</width>
550 <height>15</height>
551 </size>
552 </property>
553 </spacer>
554 </item>
555 <item row="8" column="0">527 <item row="8" column="0">
556 <layout class="QVBoxLayout" name="verticalLayout">528 <layout class="QVBoxLayout" name="verticalLayout_4">
557 <property name="spacing">529 <property name="spacing">
558 <number>3</number>530 <number>3</number>
559 </property>531 </property>
560 <item>532 <item>
561 <widget class="QLabel" name="captcha_view">533 <widget class="QLabel" name="captcha_view">
562 <property name="sizePolicy">534 <property name="sizePolicy">
563 <sizepolicy hsizetype="Minimum" vsizetype="Fixed">535 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
564 <horstretch>0</horstretch>536 <horstretch>0</horstretch>
565 <verstretch>0</verstretch>537 <verstretch>0</verstretch>
566 </sizepolicy>538 </sizepolicy>
@@ -574,7 +546,7 @@
574 <property name="maximumSize">546 <property name="maximumSize">
575 <size>547 <size>
576 <width>300</width>548 <width>300</width>
577 <height>16777215</height>549 <height>57</height>
578 </size>550 </size>
579 </property>551 </property>
580 <property name="styleSheet">552 <property name="styleSheet">
@@ -632,39 +604,53 @@
632 </item>604 </item>
633 </layout>605 </layout>
634 </item>606 </item>
607 <item row="1" column="0" colspan="2">
608 <spacer name="verticalSpacer">
609 <property name="orientation">
610 <enum>Qt::Vertical</enum>
611 </property>
612 <property name="sizeHint" stdset="0">
613 <size>
614 <width>20</width>
615 <height>10</height>
616 </size>
617 </property>
618 </spacer>
619 </item>
635 <item row="8" column="1">620 <item row="8" column="1">
636 <widget class="QLabel" name="refresh_label">621 <layout class="QVBoxLayout" name="verticalLayout_13">
637 <property name="sizePolicy">622 <property name="rightMargin">
638 <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
639 <horstretch>0</horstretch>
640 <verstretch>0</verstretch>
641 </sizepolicy>
642 </property>
643 <property name="minimumSize">
644 <size>
645 <width>220</width>
646 <height>0</height>
647 </size>
648 </property>
649 <property name="maximumSize">
650 <size>
651 <width>220</width>
652 <height>16777215</height>
653 </size>
654 </property>
655 <property name="locale">
656 <locale language="English" country="UnitedStates"/>
657 </property>
658 <property name="text">
659 <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>
660 </property>
661 <property name="wordWrap">
662 <bool>true</bool>
663 </property>
664 <property name="indent">
665 <number>0</number>623 <number>0</number>
666 </property>624 </property>
667 </widget>625 <item>
626 <widget class="QLabel" name="refresh_label">
627 <property name="minimumSize">
628 <size>
629 <width>220</width>
630 <height>0</height>
631 </size>
632 </property>
633 <property name="maximumSize">
634 <size>
635 <width>220</width>
636 <height>16777215</height>
637 </size>
638 </property>
639 <property name="locale">
640 <locale language="English" country="UnitedStates"/>
641 </property>
642 <property name="text">
643 <string notr="true">If you can't read this then refresh this page</string>
644 </property>
645 <property name="wordWrap">
646 <bool>true</bool>
647 </property>
648 <property name="indent">
649 <number>0</number>
650 </property>
651 </widget>
652 </item>
653 </layout>
668 </item>654 </item>
669 </layout>655 </layout>
670 </item>656 </item>
671657
=== modified file 'data/qt/stylesheet.qss'
--- data/qt/stylesheet.qss 2012-03-01 20:13:02 +0000
+++ data/qt/stylesheet.qss 2012-03-05 21:55:21 +0000
@@ -6,6 +6,7 @@
6QFrame#ubuntussoframe {6QFrame#ubuntussoframe {
7 background-color: white;7 background-color: white;
8 padding-left: 30px;8 padding-left: 30px;
9 padding-right: 30px;
9}10}
1011
11QWizard,12QWizard,
1213
=== modified file 'ubuntu_sso/qt/__init__.py'
--- ubuntu_sso/qt/__init__.py 2012-03-01 12:30:13 +0000
+++ ubuntu_sso/qt/__init__.py 2012-03-05 21:55:21 +0000
@@ -19,9 +19,13 @@
19import collections19import collections
2020
2121
22LINK_STYLE = ('<a href="{link_url}">'
23 '<span style="color:#df2d1f;">{link_text}</span></a>')
22ERROR_ALL = '__all__'24ERROR_ALL = '__all__'
25ERROR_STYLE = u'<font color="#df2d1f"><b>%s</b></font>'
23ERROR_MESSAGE = 'message'26ERROR_MESSAGE = 'message'
24PREFERED_UI_SIZE = {'width': 550, 'height': 525}27PREFERED_UI_SIZE = {'width': 550, 'height': 525}
28TITLE_STYLE = u'<span style="font-size:24px">%s</span>'
2529
2630
27# Based on the gtk implementation31# Based on the gtk implementation
2832
=== modified file 'ubuntu_sso/qt/current_user_sign_in_page.py'
--- ubuntu_sso/qt/current_user_sign_in_page.py 2012-03-05 12:07:21 +0000
+++ ubuntu_sso/qt/current_user_sign_in_page.py 2012-03-05 21:55:21 +0000
@@ -21,8 +21,8 @@
21from PyQt4 import QtGui, QtCore21from PyQt4 import QtGui, QtCore
2222
23from ubuntu_sso import NO_OP23from ubuntu_sso import NO_OP
24from ubuntu_sso.logger import setup_logging24from ubuntu_sso.logger import setup_gui_logging
25from ubuntu_sso.qt import build_general_error_message25from ubuntu_sso.qt import LINK_STYLE, build_general_error_message
26from ubuntu_sso.qt.sso_wizard_page import SSOWizardPage26from ubuntu_sso.qt.sso_wizard_page import SSOWizardPage
27from ubuntu_sso.qt.ui.current_user_sign_in_ui import Ui_CurrentUserSignInPage27from ubuntu_sso.qt.ui.current_user_sign_in_ui import Ui_CurrentUserSignInPage
28from ubuntu_sso.utils.ui import (28from ubuntu_sso.utils.ui import (
@@ -31,24 +31,22 @@
31 FORGOTTEN_PASSWORD_BUTTON,31 FORGOTTEN_PASSWORD_BUTTON,
32 is_correct_email,32 is_correct_email,
33 LOGIN_PASSWORD_LABEL,33 LOGIN_PASSWORD_LABEL,
34 LOGIN_TITLE,
35 LOGIN_SUBTITLE,
34 SIGN_IN_BUTTON,36 SIGN_IN_BUTTON,
35)37)
3638
3739
38FORGOTTEN_PASSWORD_LINK_STYLE = ('<a href="#" style="color:#dd4814;">'40logger = setup_gui_logging('ubuntu_sso.current_user_sign_in_page')
39 '{forgotten_text}</a>')
40
41
42logger = setup_logging('ubuntu_sso.current_user_sign_in_page')
4341
4442
45class CurrentUserSignInPage(SSOWizardPage):43class CurrentUserSignInPage(SSOWizardPage):
46 """Wizard Page that lets a current user Sign into Ubuntu Single Sign On."""44 """Wizard Page that lets a current user Sign into Ubuntu Single Sign On."""
4745
48 ui_class = Ui_CurrentUserSignInPage46 ui_class = Ui_CurrentUserSignInPage
49 userLoggedIn = QtCore.pyqtSignal('QString', 'QString')47 userLoggedIn = QtCore.pyqtSignal(unicode)
50 passwordForgotten = QtCore.pyqtSignal()48 passwordForgotten = QtCore.pyqtSignal()
51 userNotValidated = QtCore.pyqtSignal('QString', 'QString')49 userNotValidated = QtCore.pyqtSignal(unicode)
5250
53 @property51 @property
54 def _signals(self):52 def _signals(self):
@@ -63,12 +61,11 @@
63 }61 }
64 return result62 return result
6563
66 def on_user_not_validated(self, *args):64 def on_user_not_validated(self, app_name, email):
67 """Show the validate email page."""65 """Show the validate email page."""
68 self.hide_overlay()66 self.hide_overlay()
69 email = unicode(self.ui.email_edit.text())67 email = unicode(self.ui.email_edit.text())
70 password = unicode(self.ui.password_edit.text())68 self.userNotValidated.emit(email)
71 self.userNotValidated.emit(email, password)
7269
73 # Invalid names of Qt-inherited methods70 # Invalid names of Qt-inherited methods
74 # pylint: disable=C010371 # pylint: disable=C0103
@@ -98,10 +95,13 @@
98 def _set_translated_strings(self):95 def _set_translated_strings(self):
99 """Set the translated strings."""96 """Set the translated strings."""
100 logger.debug('CurrentUserSignInPage._set_translated_strings')97 logger.debug('CurrentUserSignInPage._set_translated_strings')
98 self.setTitle(LOGIN_TITLE.format(app_name=self.app_name))
99 self.setSubTitle(LOGIN_SUBTITLE % {'app_name': self.app_name})
100
101 self.ui.email_label.setText(EMAIL_LABEL)101 self.ui.email_label.setText(EMAIL_LABEL)
102 self.ui.password_label.setText(LOGIN_PASSWORD_LABEL)102 self.ui.password_label.setText(LOGIN_PASSWORD_LABEL)
103 forgotten_text = FORGOTTEN_PASSWORD_LINK_STYLE.format(103 forgotten_text = LINK_STYLE.format(link_url='#',
104 forgotten_text=FORGOTTEN_PASSWORD_BUTTON)104 link_text=FORGOTTEN_PASSWORD_BUTTON)
105 self.ui.forgot_password_label.setText(forgotten_text)105 self.ui.forgot_password_label.setText(forgotten_text)
106 self.ui.sign_in_button.setText(SIGN_IN_BUTTON)106 self.ui.sign_in_button.setText(SIGN_IN_BUTTON)
107107
@@ -153,10 +153,11 @@
153 logger.info('Logged in for %s', app_name)153 logger.info('Logged in for %s', app_name)
154 self.hide_overlay()154 self.hide_overlay()
155 email = unicode(self.ui.email_edit.text())155 email = unicode(self.ui.email_edit.text())
156 self.userLoggedIn.emit(app_name, email)156 self.userLoggedIn.emit(email)
157 logger.debug('Wizard.loginSuccess emitted.')157 logger.debug('Wizard.loginSuccess emitted.')
158158
159 def on_forgotten_password(self):159 def on_forgotten_password(self, link=None):
160 """Show the user the forgotten password page."""160 """Show the user the forgotten password page."""
161 logger.info('Forgotten password')161 logger.info('Forgotten password')
162 self.hide_overlay()
162 self.passwordForgotten.emit()163 self.passwordForgotten.emit()
163164
=== modified file 'ubuntu_sso/qt/email_verification_page.py'
--- ubuntu_sso/qt/email_verification_page.py 2012-03-02 20:33:05 +0000
+++ ubuntu_sso/qt/email_verification_page.py 2012-03-05 21:55:21 +0000
@@ -21,7 +21,7 @@
21from PyQt4 import QtGui, QtCore21from PyQt4 import QtGui, QtCore
2222
23from ubuntu_sso import NO_OP23from ubuntu_sso import NO_OP
24from ubuntu_sso.logger import setup_logging24from ubuntu_sso.logger import setup_gui_logging
25from ubuntu_sso.qt import build_general_error_message25from ubuntu_sso.qt import build_general_error_message
26from ubuntu_sso.qt.sso_wizard_page import SSOWizardPage26from ubuntu_sso.qt.sso_wizard_page import SSOWizardPage
27from ubuntu_sso.qt.ui.email_verification_ui import Ui_EmailVerificationPage27from ubuntu_sso.qt.ui.email_verification_ui import Ui_EmailVerificationPage
@@ -34,14 +34,14 @@
34)34)
3535
3636
37logger = setup_logging('ubuntu_sso.email_verification_page')37logger = setup_gui_logging('ubuntu_sso.email_verification_page')
3838
3939
40class EmailVerificationPage(SSOWizardPage):40class EmailVerificationPage(SSOWizardPage):
41 """Widget used to input the email verification code."""41 """Widget used to input the email verification code."""
4242
43 ui_class = Ui_EmailVerificationPage43 ui_class = Ui_EmailVerificationPage
44 registrationSuccess = QtCore.pyqtSignal('QString', 'QString')44 registrationSuccess = QtCore.pyqtSignal(unicode)
4545
46 def __init__(self, *args, **kwargs):46 def __init__(self, *args, **kwargs):
47 self.email = ''47 self.email = ''
@@ -121,11 +121,11 @@
121 self.on_email_validation_error)121 self.on_email_validation_error)
122 f(*args, reply_handler=NO_OP, error_handler=error_handler)122 f(*args, reply_handler=NO_OP, error_handler=error_handler)
123123
124 def on_email_validated(self, app_name, *args, **kwargs):124 def on_email_validated(self, app_name, email):
125 """Signal thrown after the email is validated."""125 """Signal thrown after the email is validated."""
126 logger.info('EmailVerificationController.on_email_validated')126 logger.info('EmailVerificationController.on_email_validated')
127 self.hide_overlay()127 self.hide_overlay()
128 self.registrationSuccess.emit(app_name, self.email)128 self.registrationSuccess.emit(self.email)
129129
130 def on_email_validation_error(self, app_name, error):130 def on_email_validation_error(self, app_name, error):
131 """Signal thrown when there's a problem validating the email."""131 """Signal thrown when there's a problem validating the email."""
@@ -134,10 +134,12 @@
134 msg += build_general_error_message(error)134 msg += build_general_error_message(error)
135 self.show_error(self.app_name, msg)135 self.show_error(self.app_name, msg)
136136
137 #pylint: disable=C0103137 # pylint: disable=C0103
138
138 def initializePage(self):139 def initializePage(self):
139 """Called to prepare the page just before it is shown."""140 """Called to prepare the page just before it is shown."""
140 self.next_button.setDefault(True)141 self.next_button.setDefault(True)
141 self.next_button.setEnabled(False)142 self.next_button.setEnabled(False)
142 self.wizard().setButtonLayout([QtGui.QWizard.Stretch])143 self.wizard().setButtonLayout([QtGui.QWizard.Stretch])
144
143 #pylint: enable=C0103145 #pylint: enable=C0103
144146
=== modified file 'ubuntu_sso/qt/forgotten_password_page.py'
--- ubuntu_sso/qt/forgotten_password_page.py 2012-03-01 20:46:34 +0000
+++ ubuntu_sso/qt/forgotten_password_page.py 2012-03-05 21:55:21 +0000
@@ -21,24 +21,27 @@
21from PyQt4 import QtCore21from PyQt4 import QtCore
2222
23from ubuntu_sso import NO_OP23from ubuntu_sso import NO_OP
24from ubuntu_sso.logger import setup_gui_logging, log_call
24from ubuntu_sso.qt.sso_wizard_page import SSOWizardEnhancedEditPage25from ubuntu_sso.qt.sso_wizard_page import SSOWizardEnhancedEditPage
25from ubuntu_sso.qt.ui.forgotten_password_ui import Ui_ForgottenPasswordPage26from ubuntu_sso.qt.ui.forgotten_password_ui import Ui_ForgottenPasswordPage
26from ubuntu_sso.utils.ui import (27from ubuntu_sso.utils.ui import (
27 EMAIL_LABEL,28 EMAIL_LABEL,
29 FORGOTTEN_PASSWORD_TITLE,
30 FORGOTTEN_PASSWORD_SUBTITLE,
28 is_correct_email,31 is_correct_email,
29 RESET_PASSWORD,32 RESET_PASSWORD,
30 REQUEST_PASSWORD_TOKEN_LABEL,
31 REQUEST_PASSWORD_TOKEN_WRONG_EMAIL,33 REQUEST_PASSWORD_TOKEN_WRONG_EMAIL,
32 REQUEST_PASSWORD_TOKEN_TECH_ERROR,
33 TRY_AGAIN_BUTTON,
34)34)
3535
3636
37logger = setup_gui_logging('ubuntu_sso.forgotten_password_page')
38
39
37class ForgottenPasswordPage(SSOWizardEnhancedEditPage):40class ForgottenPasswordPage(SSOWizardEnhancedEditPage):
38 """Widget used to deal with users that forgot the password."""41 """Widget used to deal with users that forgot the password."""
3942
40 ui_class = Ui_ForgottenPasswordPage43 ui_class = Ui_ForgottenPasswordPage
41 passwordResetTokenSent = QtCore.pyqtSignal()44 passwordResetTokenSent = QtCore.pyqtSignal(unicode)
4245
43 @property46 @property
44 def _signals(self):47 def _signals(self):
@@ -52,87 +55,42 @@
52 return result55 return result
5356
54 @property57 @property
55 def email_widget(self):
56 """Return the widget used to show the email information."""
57 return self.ui.email_widget
58
59 @property
60 def forgotted_password_intro_label(self):
61 """Return the intro label that lets the user know the issue."""
62 return self.ui.forgotted_password_intro_label
63
64 @property
65 def error_label(self):
66 """Return the label used to show error."""
67 return self.ui.error_label
68
69 @property
70 def email_address_label(self):
71 """Return the lable used to state the use of the line edit."""
72 return self.ui.email_address_label
73
74 @property
75 def email_address(self):58 def email_address(self):
76 """Return the email address provided by the user."""59 """Return the email address provided by the user."""
77 return str(self.ui.email_line_edit.text())60 return unicode(self.ui.email_line_edit.text())
78
79 @property
80 def email_address_line_edit(self):
81 """Return the line edit with the content."""
82 return self.ui.email_line_edit
83
84 @property
85 def send_button(self):
86 """Return the button used to request the new password."""
87 return self.ui.send_button
88
89 @property
90 def try_again_widget(self):
91 """Return the widget used to display the try again button."""
92 return self.ui.try_again_widget
93
94 @property
95 def try_again_button(self):
96 """Return the button used to try again the reset password."""
97 return self.ui.try_again_button
9861
99 #pylint: disable=C010362 #pylint: disable=C0103
63
100 def initializePage(self):64 def initializePage(self):
101 """Set the initial state of ForgottenPassword page."""65 """Set the initial state of ForgottenPassword page."""
102 self.send_button.setDefault(True)66 self.ui.send_button.setDefault(True)
103 enabled = not self.ui.email_line_edit.text().isEmpty()67 enabled = not self.ui.email_line_edit.text().isEmpty()
104 self.send_button.setEnabled(enabled)68 self.ui.send_button.setEnabled(enabled)
69
105 #pylint: enable=C010370 #pylint: enable=C0103
10671
107 def _register_fields(self):72 def _register_fields(self):
108 """Register the fields of the wizard page."""73 """Register the fields of the wizard page."""
109 self.registerField('email_address',74 self.registerField('email_address',
110 self.email_address_line_edit)75 self.ui.email_line_edit)
11176
112 def _set_translated_strings(self):77 def _set_translated_strings(self):
113 """Set the translated strings in the view."""78 """Set the translated strings in the view."""
114 self.forgotted_password_intro_label.setText(79 self.setTitle(FORGOTTEN_PASSWORD_TITLE)
115 REQUEST_PASSWORD_TOKEN_LABEL % {'app_name':80 subtitle = FORGOTTEN_PASSWORD_SUBTITLE.format(app_name=self.app_name)
116 self.app_name})81 self.setSubTitle(subtitle)
117 self.email_address_label.setText(EMAIL_LABEL)82 self.ui.email_address_label.setText(EMAIL_LABEL)
118 self.send_button.setText(RESET_PASSWORD)83 self.ui.send_button.setText(RESET_PASSWORD)
119 self.try_again_button.setText(TRY_AGAIN_BUTTON)
12084
121 def _set_enhanced_line_edit(self):85 def _set_enhanced_line_edit(self):
122 """Set the extra logic to the line edits."""86 """Set the extra logic to the line edits."""
123 self.set_line_edit_validation_rule(87 self.set_line_edit_validation_rule(self.ui.email_line_edit,
124 self.email_address_line_edit,
125 is_correct_email)88 is_correct_email)
12689
127 def _connect_ui(self):90 def _connect_ui(self):
128 """Connect the diff signals from the Ui."""91 """Connect the diff signals from the Ui."""
129 self.email_address_line_edit.textChanged.connect(self._validate)92 self.ui.email_line_edit.textChanged.connect(self._validate)
13093 self.ui.send_button.clicked.connect(self.request_new_password)
131 self.send_button.clicked.connect(self.request_new_password)
132
133 self.try_again_widget.setVisible(False)
134 self.try_again_button.clicked.connect(self.on_try_again)
135
136 self._set_enhanced_line_edit()94 self._set_enhanced_line_edit()
137 self._register_fields()95 self._register_fields()
13896
@@ -150,33 +108,19 @@
150108
151 def _validate(self):109 def _validate(self):
152 """Validate that we have an email."""110 """Validate that we have an email."""
153 email = unicode(self.email_address_line_edit.text())111 email = unicode(self.ui.email_line_edit.text())
154 self.send_button.setEnabled(is_correct_email(email))112 self.ui.send_button.setEnabled(is_correct_email(email))
155113
156 def on_try_again(self):114 def on_password_reset_token_sent(self, app_name, email):
157 """Set back the widget to the initial state."""
158 self.hide_error()
159 self.try_again_widget.setVisible(False)
160 self.email_widget.setVisible(True)
161
162 def on_password_reset_token_sent(self, app_name, result):
163 """Action taken when we managed to get the password reset done."""115 """Action taken when we managed to get the password reset done."""
164 # ignore the result and move to the reset page116 # ignore the result and move to the reset page
165 self.hide_overlay()117 self.hide_overlay()
166 self.passwordResetTokenSent.emit()118 self.passwordResetTokenSent.emit(email)
167119
120 @log_call(logger.error)
168 def on_password_reset_error(self, app_name, error):121 def on_password_reset_error(self, app_name, error):
169 """Action taken when there was an error requesting the reset."""122 """Action taken when there was an error requesting the reset."""
170 # set the error message123 # set the error message
171 self.hide_overlay()124 self.hide_overlay()
172 msg = REQUEST_PASSWORD_TOKEN_TECH_ERROR125 msg = REQUEST_PASSWORD_TOKEN_WRONG_EMAIL
173 if error['errtype'] == 'ResetPasswordTokenError':
174 # the account provided is wrong, lets tell the user to try
175 # again
176 msg = REQUEST_PASSWORD_TOKEN_WRONG_EMAIL
177 else:
178 # ouch, I dont know what went wrong, tell the user to try later
179 self.email_widget.setVisible(False)
180 self.forgotted_password_intro_label.setVisible(False)
181 self.try_again_widget.setVisible(True)
182 self.show_error(self.app_name, msg)126 self.show_error(self.app_name, msg)
183127
=== modified file 'ubuntu_sso/qt/proxy_dialog.py'
--- ubuntu_sso/qt/proxy_dialog.py 2012-02-27 12:48:59 +0000
+++ ubuntu_sso/qt/proxy_dialog.py 2012-03-05 21:55:21 +0000
@@ -21,7 +21,7 @@
21from PyQt4.QtGui import QApplication, QDialog, QIcon21from PyQt4.QtGui import QApplication, QDialog, QIcon
22from twisted.internet import defer22from twisted.internet import defer
2323
24from ubuntu_sso.logger import setup_logging24from ubuntu_sso.logger import setup_gui_logging
25from ubuntu_sso.keyring import Keyring25from ubuntu_sso.keyring import Keyring
26from ubuntu_sso.qt.ui.proxy_credentials_dialog_ui import Ui_ProxyCredsDialog26from ubuntu_sso.qt.ui.proxy_credentials_dialog_ui import Ui_ProxyCredsDialog
27from ubuntu_sso.utils.ui import (27from ubuntu_sso.utils.ui import (
@@ -41,7 +41,7 @@
41USER_CANCELATION = -141USER_CANCELATION = -1
42EXCEPTION_RAISED = -242EXCEPTION_RAISED = -2
4343
44logger = setup_logging("ubuntu_sso.qt.proxy_dialog")44logger = setup_gui_logging("ubuntu_sso.qt.proxy_dialog")
4545
4646
47class ProxyCredsDialog(QDialog):47class ProxyCredsDialog(QDialog):
4848
=== modified file 'ubuntu_sso/qt/reset_password_page.py'
--- ubuntu_sso/qt/reset_password_page.py 2012-03-01 20:46:34 +0000
+++ ubuntu_sso/qt/reset_password_page.py 2012-03-05 21:55:21 +0000
@@ -22,7 +22,7 @@
22from PyQt4.QtGui import QApplication22from PyQt4.QtGui import QApplication
2323
24from ubuntu_sso import NO_OP24from ubuntu_sso import NO_OP
25from ubuntu_sso.logger import setup_logging25from ubuntu_sso.logger import setup_gui_logging
26from ubuntu_sso.qt import build_general_error_message, common26from ubuntu_sso.qt import build_general_error_message, common
27from ubuntu_sso.qt.sso_wizard_page import SSOWizardEnhancedEditPage27from ubuntu_sso.qt.sso_wizard_page import SSOWizardEnhancedEditPage
28from ubuntu_sso.qt.ui.reset_password_ui import Ui_ResetPasswordPage28from ubuntu_sso.qt.ui.reset_password_ui import Ui_ResetPasswordPage
@@ -38,14 +38,14 @@
38)38)
3939
4040
41logger = setup_logging('ubuntu_sso.reset_password_page')41logger = setup_gui_logging('ubuntu_sso.reset_password_page')
4242
4343
44class ResetPasswordPage(SSOWizardEnhancedEditPage):44class ResetPasswordPage(SSOWizardEnhancedEditPage):
45 """Widget used to allow the user change his password."""45 """Widget used to allow the user change his password."""
4646
47 ui_class = Ui_ResetPasswordPage47 ui_class = Ui_ResetPasswordPage
48 passwordChanged = pyqtSignal('QString')48 passwordChanged = pyqtSignal(unicode)
4949
50 @property50 @property
51 def _signals(self):51 def _signals(self):
@@ -156,7 +156,7 @@
156 self.ui.password_line_edit.textChanged.connect(156 self.ui.password_line_edit.textChanged.connect(
157 self.ui.confirm_password_line_edit.textChanged.emit)157 self.ui.confirm_password_line_edit.textChanged.emit)
158158
159 def on_password_changed(self, app_name, result):159 def on_password_changed(self, app_name, email):
160 """Let user know that the password was changed."""160 """Let user know that the password was changed."""
161 self.hide_overlay()161 self.hide_overlay()
162 email = unicode(self.wizard().forgotten.ui.email_line_edit.text())162 email = unicode(self.wizard().forgotten.ui.email_line_edit.text())
163163
=== modified file 'ubuntu_sso/qt/setup_account_page.py'
--- ubuntu_sso/qt/setup_account_page.py 2012-03-05 19:58:07 +0000
+++ ubuntu_sso/qt/setup_account_page.py 2012-03-05 21:55:21 +0000
@@ -31,11 +31,13 @@
31from PyQt4 import QtGui, QtCore31from PyQt4 import QtGui, QtCore
3232
33from ubuntu_sso import NO_OP33from ubuntu_sso import NO_OP
34from ubuntu_sso.logger import setup_logging34from ubuntu_sso.logger import setup_gui_logging
35from ubuntu_sso.qt import (35from ubuntu_sso.qt import (
36 LINK_STYLE,
36 build_general_error_message,37 build_general_error_message,
37 common,38 common,
38 enhanced_check_box,39 enhanced_check_box,
40 ERROR_STYLE,
39)41)
40from ubuntu_sso.qt.sso_wizard_page import SSOWizardEnhancedEditPage42from ubuntu_sso.qt.sso_wizard_page import SSOWizardEnhancedEditPage
41from ubuntu_sso.qt.ui.setup_account_ui import Ui_SetUpAccountPage43from ubuntu_sso.qt.ui.setup_account_ui import Ui_SetUpAccountPage
@@ -72,29 +74,20 @@
72 RETYPE_PASSWORD,74 RETYPE_PASSWORD,
73 SET_UP_ACCOUNT_BUTTON,75 SET_UP_ACCOUNT_BUTTON,
74 TERMS_TEXT,76 TERMS_TEXT,
75 TITLE,77 REGISTER_TITLE,
76)78)
7779
7880
79logger = setup_logging('ubuntu_sso.setup_account_page')81logger = setup_gui_logging('ubuntu_sso.setup_account_page')
80
81ERROR = u'<font color="#df2d1f"><b> %s </b></font>'
82TITLE_STYLE = "<span style=\"font-size:24px\">%s</span>"
8382
84ERROR_EMAIL = 'email'83ERROR_EMAIL = 'email'
85CAPTCHA_RELOAD_LINK = ('<a href="#">'
86 '<span style="color:#df2d1f;">%(reload_text)s</span></a>')
87TERMS_LINK = ('<a href="{toc_link}">'
88 '<span style="color:#df2d1f;">{terms_text}</span></a>')
89PRIVACY_POLICY_LINK = ('<a href="{policy_link}">'
90 '<span style="color:#df2d1f;">{privacy_policy_text}</span></a>')
9184
9285
93class SetupAccountPage(SSOWizardEnhancedEditPage):86class SetupAccountPage(SSOWizardEnhancedEditPage):
94 """Customized Setup Account page for SSO."""87 """Customized Setup Account page for SSO."""
9588
96 ui_class = Ui_SetUpAccountPage89 ui_class = Ui_SetUpAccountPage
97 userRegistered = QtCore.pyqtSignal('QString', 'QString')90 userRegistered = QtCore.pyqtSignal(unicode)
9891
99 def __init__(self, *args, **kwargs):92 def __init__(self, *args, **kwargs):
100 self.captcha_file = None93 self.captcha_file = None
@@ -124,9 +117,6 @@
124117
125 def initializePage(self):118 def initializePage(self):
126 """Setup UI details."""119 """Setup UI details."""
127 title_page = TITLE_STYLE % TITLE.format(app_name=self.app_name)
128 self.setTitle(title_page)
129 self.setSubTitle(self.help_text)
130 # Set Setup Account button120 # Set Setup Account button
131 self.wizard().setOption(QtGui.QWizard.HaveCustomButton3, True)121 self.wizard().setOption(QtGui.QWizard.HaveCustomButton3, True)
132 try:122 try:
@@ -164,6 +154,10 @@
164 """Set the strings."""154 """Set the strings."""
165 logger.debug('SetUpAccountPage._set_translated_strings')155 logger.debug('SetUpAccountPage._set_translated_strings')
166 # set the translated string156 # set the translated string
157 title_page = REGISTER_TITLE.format(app_name=self.app_name)
158 self.setTitle(title_page)
159 self.setSubTitle(self.help_text)
160
167 self.ui.name_label.setText(NAME_ENTRY)161 self.ui.name_label.setText(NAME_ENTRY)
168 self.ui.email_label.setText(EMAIL1_ENTRY)162 self.ui.email_label.setText(EMAIL1_ENTRY)
169 self.ui.confirm_email_label.setText(EMAIL2_ENTRY)163 self.ui.confirm_email_label.setText(EMAIL2_ENTRY)
@@ -172,17 +166,16 @@
172 self.ui.password_edit.setToolTip(PASSWORD_HELP)166 self.ui.password_edit.setToolTip(PASSWORD_HELP)
173 self.ui.captcha_solution_edit.setPlaceholderText(167 self.ui.captcha_solution_edit.setPlaceholderText(
174 CAPTCHA_SOLUTION_ENTRY)168 CAPTCHA_SOLUTION_ENTRY)
175 link = CAPTCHA_RELOAD_LINK % {'reload_text': CAPTCHA_RELOAD_TEXT}169 link = LINK_STYLE.format(link_url='#', link_text=CAPTCHA_RELOAD_TEXT)
176 self.ui.refresh_label.setText(CAPTCHA_RELOAD_MESSAGE %170 self.ui.refresh_label.setText(CAPTCHA_RELOAD_MESSAGE %
177 {'reload_link': link})171 {'reload_link': link})
178172
179 if self.tc_url:173 if self.tc_url:
180 terms_links = TERMS_LINK.format(toc_link=self.tc_url,174 terms_links = LINK_STYLE.format(link_url=self.tc_url,
181 terms_text=TERMS_TEXT)175 link_text=TERMS_TEXT)
182 if self.policy_url:176 if self.policy_url:
183 privacy_policy_link = PRIVACY_POLICY_LINK.format(177 privacy_policy_link = LINK_STYLE.format(link_url=self.policy_url,
184 policy_link=self.policy_url,178 link_text=PRIVACY_POLICY_TEXT)
185 privacy_policy_text=PRIVACY_POLICY_TEXT)
186179
187 terms = ''180 terms = ''
188 if self.tc_url and self.policy_url:181 if self.tc_url and self.policy_url:
@@ -345,13 +338,12 @@
345 self.show_error(self.app_name, error_msg)338 self.show_error(self.app_name, error_msg)
346 self._refresh_captcha()339 self._refresh_captcha()
347340
348 def on_user_registered(self, app_name, result):341 def on_user_registered(self, app_name, email):
349 """Execute when the user did register."""342 """Execute when the user did register."""
350 self.hide_overlay()343 self.hide_overlay()
351 logger.debug('SetUpAccountPage.on_user_registered')344 logger.debug('SetUpAccountPage.on_user_registered')
352 email = unicode(self.ui.email_edit.text())345 email = unicode(self.ui.email_edit.text())
353 password = unicode(self.ui.password_edit.text())346 self.userRegistered.emit(email)
354 self.userRegistered.emit(email, password)
355347
356 def validate_form(self):348 def validate_form(self):
357 """Validate the info of the form and return an error."""349 """Validate the info of the form and return an error."""
@@ -473,7 +465,7 @@
473465
474 def set_error_message(self, label, msg):466 def set_error_message(self, label, msg):
475 """Set the message to the proper label applying the error style."""467 """Set the message to the proper label applying the error style."""
476 label.setText(ERROR % msg)468 label.setText(ERROR_STYLE % msg)
477 label.setVisible(True)469 label.setVisible(True)
478470
479 # pylint: disable=C0103471 # pylint: disable=C0103
480472
=== modified file 'ubuntu_sso/qt/ssl_dialog.py'
--- ubuntu_sso/qt/ssl_dialog.py 2012-03-05 16:32:37 +0000
+++ ubuntu_sso/qt/ssl_dialog.py 2012-03-05 21:55:21 +0000
@@ -27,7 +27,7 @@
27)27)
2828
29from ubuntu_sso import USER_CANCELLATION, USER_SUCCESS29from ubuntu_sso import USER_CANCELLATION, USER_SUCCESS
30from ubuntu_sso.logger import setup_logging30from ubuntu_sso.logger import setup_gui_logging
31# Unused import resources_rc, pylint: disable=W061131# Unused import resources_rc, pylint: disable=W0611
32from ubuntu_sso.qt.ui import resources_rc32from ubuntu_sso.qt.ui import resources_rc
33# pylint: enable=W061133# pylint: enable=W0611
@@ -59,7 +59,7 @@
59 '<li>%(third_reason)s</li>'59 '<li>%(third_reason)s</li>'
60 '</ul>')60 '</ul>')
6161
62logger = setup_logging("ubuntu_sso.qt.proxy_dialog")62logger = setup_gui_logging("ubuntu_sso.qt.proxy_dialog")
6363
6464
65class SSLDialog(QDialog):65class SSLDialog(QDialog):
6666
=== modified file 'ubuntu_sso/qt/sso_wizard_page.py'
--- ubuntu_sso/qt/sso_wizard_page.py 2012-03-01 19:44:56 +0000
+++ ubuntu_sso/qt/sso_wizard_page.py 2012-03-05 21:55:21 +0000
@@ -33,12 +33,12 @@
33from twisted.internet import defer33from twisted.internet import defer
3434
35from ubuntu_sso import main35from ubuntu_sso import main
36from ubuntu_sso.logger import setup_logging36from ubuntu_sso.logger import setup_gui_logging
37from ubuntu_sso.qt import PREFERED_UI_SIZE37from ubuntu_sso.qt import PREFERED_UI_SIZE, TITLE_STYLE
38from ubuntu_sso.utils.ui import GENERIC_BACKEND_ERROR38from ubuntu_sso.utils.ui import GENERIC_BACKEND_ERROR
3939
4040
41logger = setup_logging('ubuntu_sso.sso_wizard_page')41logger = setup_gui_logging('ubuntu_sso.sso_wizard_page')
4242
4343
44class Header(QFrame):44class Header(QFrame):
@@ -172,11 +172,20 @@
172172
173 def setTitle(self, title=''):173 def setTitle(self, title=''):
174 """Set the Wizard Page Title."""174 """Set the Wizard Page Title."""
175 self.header.set_title(title)175 self.header.set_title(TITLE_STYLE % title)
176176
177 def setSubTitle(self, subtitle=''):177 def setSubTitle(self, subtitle=''):
178 """Set the Wizard Page Subtitle."""178 """Set the Wizard Page Subtitle."""
179 self.header.set_subtitle(subtitle)179 self.header.set_subtitle(subtitle)
180
181 def title(self):
182 """Return the header's title."""
183 return self.header.title_label.text()
184
185 def subTitle(self):
186 """Return the header's subtitle."""
187 return self.header.subtitle_label.text()
188
180 # pylint: enable=C0103189 # pylint: enable=C0103
181190
182 def _filter_by_app_name(self, f):191 def _filter_by_app_name(self, f):
183192
=== modified file 'ubuntu_sso/qt/tests/__init__.py'
--- ubuntu_sso/qt/tests/__init__.py 2012-02-29 14:31:45 +0000
+++ ubuntu_sso/qt/tests/__init__.py 2012-03-05 21:55:21 +0000
@@ -21,6 +21,7 @@
21from twisted.trial.unittest import TestCase21from twisted.trial.unittest import TestCase
2222
23from ubuntu_sso import main, NO_OP23from ubuntu_sso import main, NO_OP
24from ubuntu_sso.qt import TITLE_STYLE
24from ubuntu_sso.tests import (25from ubuntu_sso.tests import (
25 APP_NAME,26 APP_NAME,
26 HELP_TEXT,27 HELP_TEXT,
@@ -421,7 +422,7 @@
421422
422 self.app_name = APP_NAME423 self.app_name = APP_NAME
423 self.ping_url = PING_URL424 self.ping_url = PING_URL
424 self.signals_results = []425 self.signal_results = []
425426
426 # self.ui_class is not callable427 # self.ui_class is not callable
427 # pylint: disable=E1102, C0103, W0212428 # pylint: disable=E1102, C0103, W0212
@@ -457,6 +458,15 @@
457458
458 self.assertEqual(call[1], kwargs)459 self.assertEqual(call[1], kwargs)
459460
461 def assert_signal_emitted(self, signal, signal_args,
462 trigger, *args, **kwargs):
463 """Check that 'trigger(*signal_args)' emits 'signal(*signal_args)'."""
464 signal.connect(lambda *a: self.signal_results.append(a))
465
466 trigger(*args, **kwargs)
467
468 self.assertEqual(self.signal_results, [signal_args])
469
460 def get_pixmap_data(self, pixmap):470 def get_pixmap_data(self, pixmap):
461 """Get the raw data of a QPixmap."""471 """Get the raw data of a QPixmap."""
462 byte_array = QtCore.QByteArray()472 byte_array = QtCore.QByteArray()
@@ -501,13 +511,13 @@
501 self.assertEqual(expected, called)511 self.assertEqual(expected, called)
502512
503513
504class BaseTestCasePage(BaseTestCase):514class PageBaseTestCase(BaseTestCase):
505515
506 """BaseTestCase with some specialization for the Wizard Pages."""516 """BaseTestCase with some specialization for the Wizard Pages."""
507517
508 @defer.inlineCallbacks518 @defer.inlineCallbacks
509 def setUp(self):519 def setUp(self):
510 yield super(BaseTestCasePage, self).setUp()520 yield super(PageBaseTestCase, self).setUp()
511 self._overlay_show_counter = 0521 self._overlay_show_counter = 0
512 self._overlay_hide_counter = 0522 self._overlay_hide_counter = 0
513523
@@ -526,3 +536,28 @@
526 def _hide_overlay_slot(self):536 def _hide_overlay_slot(self):
527 """Fake hide overlay slot."""537 """Fake hide overlay slot."""
528 self._overlay_hide_counter += 1538 self._overlay_hide_counter += 1
539
540 def assert_signal_emitted(self, signal, signal_args,
541 trigger, *args, **kwargs):
542 """Check that 'trigger(*args, **kwargs)' emits 'signal(*signal_args)'.
543
544 Also check that the _overlay_hide_counter was increased by one, and
545 that the ui is enabled.
546
547 """
548 super(PageBaseTestCase, self).assert_signal_emitted(signal,
549 signal_args, trigger, *args, **kwargs)
550 self.assertEqual(self._overlay_hide_counter, 1)
551 self.assertTrue(self.ui.isEnabled())
552
553 def assert_title_correct(self, expected):
554 """Check that the title is equal to 'expected'."""
555 self.assertEqual(TITLE_STYLE % expected, unicode(self.ui.title()))
556
557 def assert_subtitle_correct(self, expected):
558 """Check that the subtitle is equal to 'expected'."""
559 elided_text = unicode(self.ui.subTitle())
560 elided_text = elided_text[:len(elided_text) - 1]
561
562 self.assertTrue(expected.startswith(elided_text))
563 self.assertEqual(self.ui.header.subtitle_label.toolTip(), expected)
529564
=== modified file 'ubuntu_sso/qt/tests/test_current_user_sign_in_page.py'
--- ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-03-05 12:07:21 +0000
+++ ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-03-05 21:55:21 +0000
@@ -18,37 +18,23 @@
1818
19from PyQt4 import QtGui, QtCore19from PyQt4 import QtGui, QtCore
2020
21from ubuntu_sso.qt import current_user_sign_in_page21from ubuntu_sso.qt import current_user_sign_in_page as gui
22from ubuntu_sso.qt.tests import (22from ubuntu_sso.qt.tests import (
23 BaseTestCasePage,23 PageBaseTestCase,
24 FakePageUiStyle,24 FakePageUiStyle,
25 FakeWizardButtonStyle,25 FakeWizardButtonStyle,
26)26)
2727
2828
29# pylint: disable=W021229# pylint: disable=W0212
30class CurrentUserSignInTestCase(BaseTestCasePage):30
31class CurrentUserSignInTestCase(PageBaseTestCase):
31 """Test the SetupAccountPage code."""32 """Test the SetupAccountPage code."""
3233
33 ui_class = current_user_sign_in_page.CurrentUserSignInPage34 ui_class = gui.CurrentUserSignInPage
34 ui_signals = ('userLoggedIn', 'passwordForgotten', 'userNotValidated')35 ui_signals = ('userLoggedIn', 'passwordForgotten', 'userNotValidated')
35 ui_backend_signals = ('LoggedIn', 'LoginError', 'UserNotValidated')36 ui_backend_signals = ('LoggedIn', 'LoginError', 'UserNotValidated')
3637
37 def test_on_user_not_validated(self):
38 """Test the navigation flow on user not validated."""
39 email = 'email@example'
40 password = 'password'
41 self.ui.ui.email_edit.setText(email)
42 self.ui.ui.password_edit.setText(password)
43
44 def slot(email, password):
45 """Fake slot."""
46 self.signals_results.append((email, password))
47 self.ui.userNotValidated.connect(slot)
48 self.ui.on_user_not_validated()
49 self.assertEqual(self._overlay_hide_counter, 1)
50 self.assertIn((email, password), self.signals_results)
51
52 def test_initialize_page(self):38 def test_initialize_page(self):
53 """Test the initialization method."""39 """Test the initialization method."""
54 wizard = FakeWizardButtonStyle()40 wizard = FakeWizardButtonStyle()
@@ -67,30 +53,28 @@
6753
68 def test_set_translated_strings(self):54 def test_set_translated_strings(self):
69 """Test the translated string method."""55 """Test the translated string method."""
70 self.ui._set_translated_strings()56 expected = gui.LOGIN_TITLE.format(app_name=self.app_name)
71 self.assertEqual(self.ui.ui.email_label.text(),57 self.assert_title_correct(expected)
72 current_user_sign_in_page.EMAIL_LABEL)58 expected = gui.LOGIN_SUBTITLE % dict(app_name=self.app_name)
59 self.assert_subtitle_correct(expected)
60 self.assertEqual(self.ui.ui.email_label.text(), gui.EMAIL_LABEL)
73 self.assertEqual(self.ui.ui.password_label.text(),61 self.assertEqual(self.ui.ui.password_label.text(),
74 current_user_sign_in_page.LOGIN_PASSWORD_LABEL)62 gui.LOGIN_PASSWORD_LABEL)
75 text = current_user_sign_in_page.FORGOTTEN_PASSWORD_LINK_STYLE.format(63 text = gui.LINK_STYLE.format(link_url='#',
76 forgotten_text=current_user_sign_in_page.FORGOTTEN_PASSWORD_BUTTON)64 link_text=gui.FORGOTTEN_PASSWORD_BUTTON)
77 self.assertEqual(self.ui.ui.forgot_password_label.text(),65 self.assertEqual(self.ui.ui.forgot_password_label.text(), text)
78 text)66 self.assertEqual(self.ui.ui.sign_in_button.text(), gui.SIGN_IN_BUTTON)
79 self.assertEqual(self.ui.ui.sign_in_button.text(),
80 current_user_sign_in_page.SIGN_IN_BUTTON)
8167
82 def test_connect_ui(self):68 def test_connect_ui(self):
83 """Test the connect ui method."""69 """Test the connect ui method."""
84 self.ui._connect_ui()
85 # We expect 2 values because _connect_ui is called in the init too.
86 self.assertEqual(self.ui.ui.forgot_password_label.receivers(70 self.assertEqual(self.ui.ui.forgot_password_label.receivers(
87 QtCore.SIGNAL("linkActivated(const QString&)")), 2)71 QtCore.SIGNAL("linkActivated(const QString&)")), 1)
88 self.assertEqual(self.ui.ui.email_edit.receivers(72 self.assertEqual(self.ui.ui.email_edit.receivers(
89 QtCore.SIGNAL("textChanged(const QString&)")), 2)73 QtCore.SIGNAL("textChanged(const QString&)")), 1)
90 self.assertEqual(self.ui.ui.password_edit.receivers(74 self.assertEqual(self.ui.ui.password_edit.receivers(
91 QtCore.SIGNAL("textChanged(const QString&)")), 2)75 QtCore.SIGNAL("textChanged(const QString&)")), 1)
92 self.assertEqual(self.ui.ui.sign_in_button.receivers(76 self.assertEqual(self.ui.ui.sign_in_button.receivers(
93 QtCore.SIGNAL("clicked()")), 2)77 QtCore.SIGNAL("clicked()")), 1)
9478
95 def test_validate_not_valid(self):79 def test_validate_not_valid(self):
96 """Test validate method."""80 """Test validate method."""
@@ -155,36 +139,26 @@
155139
156 def test_on_logged_in(self):140 def test_on_logged_in(self):
157 """Test the on_login_in method."""141 """Test the on_login_in method."""
158 app_name = 'my_app'
159 email = 'email@example'142 email = 'email@example'
160 self.ui.app_name = app_name
161 self.ui.ui.email_edit.setText(email)143 self.ui.ui.email_edit.setText(email)
162144
163 def slot(app, email):145 self.assert_signal_emitted(self.ui.userLoggedIn, (email,),
164 """Fake slot."""146 self.ui.on_logged_in, self.app_name, email)
165 self.signals_results.append((app, email))
166 self.ui.userLoggedIn.connect(slot)
167 self.ui.on_logged_in(app_name, None)
168 self.assertEqual(self._overlay_hide_counter, 1)
169 self.assertTrue(self.ui.isEnabled())147 self.assertTrue(self.ui.isEnabled())
170 self.assertIn((app_name, email), self.signals_results)148
149 def test_on_user_not_validated(self):
150 """Test the navigation flow on user not validated."""
151 email = 'email@example'
152 self.ui.ui.email_edit.setText(email)
153 self.assert_signal_emitted(self.ui.userNotValidated, (email,),
154 self.ui.on_user_not_validated, self.app_name, email)
171155
172 def test_on_forgotten_password(self):156 def test_on_forgotten_password(self):
173 """Test the on_forgotten_password method."""157 """Test the on_forgotten_password method."""
174158 self.assert_signal_emitted(self.ui.passwordForgotten, (),
175 def slot():159 self.ui.on_forgotten_password)
176 """Fake slot."""
177 self.signals_results.append(1)
178 self.ui.passwordForgotten.connect(slot)
179 self.ui.on_forgotten_password()
180 self.assertIn(1, self.signals_results)
181160
182 def test_on_forgotten_password_link_clicked(self):161 def test_on_forgotten_password_link_clicked(self):
183 """Test the on_forgotten_password method."""162 """Forgotten passsword clicked emits passwordForgotten signal."""
184163 self.assert_signal_emitted(self.ui.passwordForgotten, (),
185 def slot():164 self.ui.ui.forgot_password_label.linkActivated.emit, "link")
186 """Fake slot."""
187 self.signals_results.append(1)
188 self.ui.passwordForgotten.connect(slot)
189 self.ui.ui.forgot_password_label.linkActivated.emit("link")
190 self.assertIn(1, self.signals_results)
191165
=== modified file 'ubuntu_sso/qt/tests/test_email_verification.py'
--- ubuntu_sso/qt/tests/test_email_verification.py 2012-03-02 20:33:05 +0000
+++ ubuntu_sso/qt/tests/test_email_verification.py 2012-03-05 21:55:21 +0000
@@ -20,7 +20,7 @@
2020
21from ubuntu_sso.qt import email_verification_page21from ubuntu_sso.qt import email_verification_page
22from ubuntu_sso.qt.tests import (22from ubuntu_sso.qt.tests import (
23 BaseTestCasePage,23 PageBaseTestCase,
24 FakePageUiStyle,24 FakePageUiStyle,
25)25)
2626
@@ -28,7 +28,7 @@
28# pylint: disable=W021228# pylint: disable=W0212
2929
3030
31class EmailVerificationTestCase(BaseTestCasePage):31class EmailVerificationTestCase(PageBaseTestCase):
32 """Test the SetupAccountPage code."""32 """Test the SetupAccountPage code."""
3333
34 ui_class = email_verification_page.EmailVerificationPage34 ui_class = email_verification_page.EmailVerificationPage
@@ -76,14 +76,12 @@
76 def test_set_titles(self):76 def test_set_titles(self):
77 """Test the set_titles method."""77 """Test the set_titles method."""
78 email = 'mail@example'78 email = 'mail@example'
79 app_name = 'my_app'
80 self.ui.app_name = app_name
81 self.ui.email = email79 self.ui.email = email
82 self.ui.set_titles(email)80 self.ui.set_titles(email)
83 self.assertEqual(self.ui.header.title_label.text(),81 self.assertEqual(self.ui.header.title_label.text(),
84 email_verification_page.VERIFY_EMAIL_TITLE)82 email_verification_page.VERIFY_EMAIL_TITLE)
85 expected = email_verification_page.VERIFY_EMAIL_CONTENT % {83 expected = email_verification_page.VERIFY_EMAIL_CONTENT % {
86 "app_name": app_name,84 "app_name": self.app_name,
87 "email": email,85 "email": email,
88 }86 }
89 self.assertEqual(unicode(self.ui.header.subtitle_label.toolTip()),87 self.assertEqual(unicode(self.ui.header.subtitle_label.toolTip()),
@@ -111,18 +109,11 @@
111109
112 def test_on_email_validated(self):110 def test_on_email_validated(self):
113 """Test the on_email_validated method."""111 """Test the on_email_validated method."""
114 app_name = 'my_app'
115 email = 'email@example'112 email = 'email@example'
116 self.ui.app_name = app_name
117 self.ui.email = email113 self.ui.email = email
118114
119 def slot(app, email):115 self.assert_signal_emitted(self.ui.registrationSuccess, (email,),
120 """Fake slot."""116 self.ui.on_email_validated, self.app_name, email)
121 self.signals_results.append((app, email))
122 self.ui.registrationSuccess.connect(slot)
123 self.ui.on_email_validated(app_name)
124 self.assertIn((app_name, email), self.signals_results)
125 self.assertEqual(self._overlay_hide_counter, 1)
126117
127 def test_validate_email_with_ping(self):118 def test_validate_email_with_ping(self):
128 """Test the login method."""119 """Test the login method."""
129120
=== modified file 'ubuntu_sso/qt/tests/test_forgotten_password.py'
--- ubuntu_sso/qt/tests/test_forgotten_password.py 2012-03-01 20:46:34 +0000
+++ ubuntu_sso/qt/tests/test_forgotten_password.py 2012-03-05 21:55:21 +0000
@@ -16,11 +16,11 @@
1616
17"""Tests for the Setup Account page Qt UI."""17"""Tests for the Setup Account page Qt UI."""
1818
19from PyQt4 import QtGui, QtCore19from PyQt4 import QtCore
2020
21from ubuntu_sso.qt import forgotten_password_page21from ubuntu_sso.qt import forgotten_password_page as gui
22from ubuntu_sso.qt.tests import (22from ubuntu_sso.qt.tests import (
23 BaseTestCasePage,23 PageBaseTestCase,
24 FakePageUiStyle,24 FakePageUiStyle,
25)25)
2626
@@ -28,82 +28,38 @@
28# pylint: disable=W0212, E110128# pylint: disable=W0212, E1101
2929
3030
31class ForgottenPasswordTestCase(BaseTestCasePage):31class ForgottenPasswordTestCase(PageBaseTestCase):
32 """Test the SetupAccountPage code."""32 """Test the SetupAccountPage code."""
3333
34 ui_class = forgotten_password_page.ForgottenPasswordPage34 ui_class = gui.ForgottenPasswordPage
35 ui_siganls = ('passwordResetTokenSent',)35 ui_siganls = ('passwordResetTokenSent',)
36 ui_backend_siganls = ('PasswordResetTokenSent', 'PasswordResetError')36 ui_backend_siganls = ('PasswordResetTokenSent', 'PasswordResetError')
3737
38 def test_request_new_password(self):38 def test_request_new_password(self):
39 """Test the request_new_password function."""39 """Test the request_new_password function."""
40 app_name = 'my_app'
41 email = 'email@example.com'40 email = 'email@example.com'
42 self.ui.app_name = app_name
43 self.ui.ui.email_line_edit.setText(email)41 self.ui.ui.email_line_edit.setText(email)
44 self.ui.request_new_password()42 self.ui.request_new_password()
45 self.assertEqual(self._overlay_show_counter, 1)43 self.assertEqual(self._overlay_show_counter, 1)
46 self.assertFalse(self.ui.isEnabled())44 self.assertFalse(self.ui.isEnabled())
47 self.assert_backend_called('request_password_reset_token',45 self.assert_backend_called('request_password_reset_token',
48 app_name, email)46 self.app_name, email)
49
50 def test_email_widget(self):
51 """Test the email_widget property."""
52 value = self.ui.email_widget
53 self.assertEqual(value, self.ui.ui.email_widget)
54 self.assertTrue(isinstance(value, QtGui.QWidget))
55
56 def test_forgotted_password_intro_label(self):
57 """Test the forgotted_password_intro_label property."""
58 value = self.ui.forgotted_password_intro_label
59 self.assertEqual(value, self.ui.ui.forgotted_password_intro_label)
60 self.assertTrue(isinstance(value, QtGui.QLabel))
61
62 def test_email_address_label(self):
63 """Test the email_address_label property."""
64 value = self.ui.email_address_label
65 self.assertEqual(value, self.ui.ui.email_address_label)
66 self.assertTrue(isinstance(value, QtGui.QLabel))
6747
68 def test_email_address(self):48 def test_email_address(self):
69 """Test the email_address property."""49 """Test the email_address property."""
70 value = self.ui.email_address50 value = self.ui.email_address
71 self.assertEqual(value, str(self.ui.ui.email_line_edit.text()))51 self.assertEqual(value, unicode(self.ui.ui.email_line_edit.text()))
72 self.assertTrue(isinstance(value, str))52 self.assertTrue(isinstance(value, unicode))
73
74 def test_email_address_line_edit(self):
75 """Test the email_address_line_edit property."""
76 value = self.ui.email_address_line_edit
77 self.assertEqual(value, self.ui.ui.email_line_edit)
78 self.assertTrue(isinstance(value, QtGui.QLineEdit))
79
80 def test_send_button(self):
81 """Test the send_button property."""
82 value = self.ui.send_button
83 self.assertEqual(value, self.ui.ui.send_button)
84 self.assertTrue(isinstance(value, QtGui.QPushButton))
8553
86 def test_send_button_clicked(self):54 def test_send_button_clicked(self):
87 """Test the send_button property."""55 """Test the send_button property."""
88 self.patch(self.ui, "hide_error", self._set_called)56 self.patch(self.ui, "hide_error", self._set_called)
89 self.ui.send_button.clicked.emit(True)57 self.ui.ui.send_button.clicked.emit(True)
90 self.assert_backend_called('request_password_reset_token',58 self.assert_backend_called('request_password_reset_token',
91 self.app_name, '')59 self.app_name, '')
92 expected = ((), {})60 expected = ((), {})
93 self.assertEqual(expected, self._called)61 self.assertEqual(expected, self._called)
9462
95 def test_try_again_widget(self):
96 """Test the try_again_widget property."""
97 value = self.ui.try_again_widget
98 self.assertEqual(value, self.ui.ui.try_again_widget)
99 self.assertTrue(isinstance(value, QtGui.QWidget))
100
101 def test_try_again_button(self):
102 """Test the try_again_button property."""
103 value = self.ui.try_again_button
104 self.assertEqual(value, self.ui.ui.try_again_button)
105 self.assertTrue(isinstance(value, QtGui.QPushButton))
106
107 def test_initialize_page_with_email(self):63 def test_initialize_page_with_email(self):
108 """Test the initialization method."""64 """Test the initialization method."""
109 self.ui.ui.email_line_edit.setText('mail@example')65 self.ui.ui.email_line_edit.setText('mail@example')
@@ -115,36 +71,24 @@
11571
116 def test_set_translated_strings(self):72 def test_set_translated_strings(self):
117 """Test the translated string method."""73 """Test the translated string method."""
118 app_name = 'my_app'74 self.assert_title_correct(gui.FORGOTTEN_PASSWORD_TITLE)
119 self.ui.app_name = app_name75 subtitle = gui.FORGOTTEN_PASSWORD_SUBTITLE
120 self.ui._set_translated_strings()76 self.assert_subtitle_correct(subtitle.format(app_name=self.app_name))
121 expected = (forgotten_password_page.REQUEST_PASSWORD_TOKEN_LABEL %77
122 {'app_name': app_name})
123 self.assertEqual(self.ui.ui.forgotted_password_intro_label.text(),
124 expected)
125 self.assertEqual(self.ui.ui.email_address_label.text(),78 self.assertEqual(self.ui.ui.email_address_label.text(),
126 forgotten_password_page.EMAIL_LABEL)79 gui.EMAIL_LABEL)
127 self.assertEqual(self.ui.ui.send_button.text(),80 self.assertEqual(self.ui.ui.send_button.text(), gui.RESET_PASSWORD)
128 forgotten_password_page.RESET_PASSWORD)
129 self.assertEqual(self.ui.ui.try_again_button.text(),
130 forgotten_password_page.TRY_AGAIN_BUTTON)
13181
132 def test_connect_ui(self):82 def test_connect_ui(self):
133 """Test the connect ui method."""83 """Test the connect ui method."""
134 self.ui._connect_ui()
135 # We expect 2 values because _connect_ui is called in the init too.
136 # For email_line_edit we expect 3 because has another
137 # connection in the .ui file.
138 self.assertEqual(self.ui.ui.email_line_edit.receivers(84 self.assertEqual(self.ui.ui.email_line_edit.receivers(
139 QtCore.SIGNAL("textChanged(const QString&)")), 3)85 QtCore.SIGNAL("textChanged(const QString&)")), 2)
140 self.assertEqual(self.ui.ui.send_button.receivers(86 self.assertEqual(self.ui.ui.send_button.receivers(
141 QtCore.SIGNAL("clicked()")), 2)87 QtCore.SIGNAL("clicked()")), 1)
142 self.assertEqual(self.ui.ui.try_again_button.receivers(
143 QtCore.SIGNAL("clicked()")), 2)
14488
145 def test_validate_not_valid(self):89 def test_validate_not_valid(self):
146 """Test validate method."""90 """Test validate method."""
147 self.ui.email_address_line_edit.setText('')91 self.ui.ui.email_line_edit.setText('')
148 button = FakePageUiStyle()92 button = FakePageUiStyle()
149 self.patch(self.ui.ui, "send_button", button)93 self.patch(self.ui.ui, "send_button", button)
150 self.ui._validate()94 self.ui._validate()
@@ -152,58 +96,23 @@
15296
153 def test_validate_valid(self):97 def test_validate_valid(self):
154 """Test validate method."""98 """Test validate method."""
155 self.ui.email_address_line_edit.setText('mail@example')99 self.ui.ui.email_line_edit.setText('mail@example')
156 button = FakePageUiStyle()100 button = FakePageUiStyle()
157 self.patch(self.ui.ui, "send_button", button)101 self.patch(self.ui.ui, "send_button", button)
158 self.ui._validate()102 self.ui._validate()
159 self.assertTrue(button.isEnabled())103 self.assertTrue(button.isEnabled())
160104
161 def test_on_try_again(self):
162 """Test on_try_again method."""
163 self.patch(self.ui, "hide_error", self._set_called)
164 self.ui.show()
165 self.addCleanup(self.ui.hide)
166 self.ui.on_try_again()
167 self.assertTrue(self.ui.email_widget.isVisible())
168 self.assertFalse(self.ui.try_again_widget.isVisible())
169 expected = ((), {})
170 self.assertEqual(expected, self._called)
171
172 def test_on_password_reset_token_sent(self):105 def test_on_password_reset_token_sent(self):
173 """Test on_password_reset_token_sent method."""106 """Test on_password_reset_token_sent method."""
174107 email = 'foo@ubuntu.com'
175 def slot():108 self.assert_signal_emitted(self.ui.passwordResetTokenSent, (email,),
176 """Fake slot."""109 self.ui.on_password_reset_token_sent, self.app_name, email)
177 self.signals_results.append(1)
178 self.ui.passwordResetTokenSent.connect(slot)
179 self.ui.on_password_reset_token_sent('app_name', {})
180 self.assertEqual(self._overlay_hide_counter, 1)
181 self.assertTrue(self.ui.isEnabled())
182 self.assertTrue(1 in self.signals_results)
183110
184 def test_on_password_reset_error(self):111 def test_on_password_reset_error(self):
185 """Test on_password_reset_error method."""112 """Test on_password_reset_error method."""
186 self.patch(self.ui, "show_error", self._set_called)113 self.patch(self.ui, "show_error", self._set_called)
187 app_name = 'my_app'114 error = {'errtype': 'FooBarBaz'}
188 error = {'errtype': 'AnotherError'}115 self.ui.on_password_reset_error(self.app_name, error)
189 self.ui.show()116 expected = ((self.ui, self.app_name,
190 self.addCleanup(self.ui.hide)117 gui.REQUEST_PASSWORD_TOKEN_WRONG_EMAIL), {})
191 self.ui.on_password_reset_error(app_name, error)
192 expected = ((self.ui, app_name,
193 forgotten_password_page.REQUEST_PASSWORD_TOKEN_TECH_ERROR), {})
194 self.assertTrue(expected, self._called)
195 self.assertFalse(self.ui.email_widget.isVisible())
196 self.assertFalse(self.ui.forgotted_password_intro_label.isVisible())
197 self.assertTrue(self.ui.try_again_widget.isVisible())
198 self.assertEqual(self._overlay_hide_counter, 1)
199 self.assertTrue(self.ui.isEnabled())
200
201 def test_on_password_reset_error_with_token_error(self):
202 """Test on_password_reset_error method."""
203 self.patch(self.ui, "show_error", self._set_called)
204 app_name = 'my_app'
205 error = {'errtype': 'ResetPasswordTokenError'}
206 self.ui.on_password_reset_error(app_name, error)
207 expected = ((self.ui, app_name,
208 forgotten_password_page.REQUEST_PASSWORD_TOKEN_WRONG_EMAIL), {})
209 self.assertTrue(expected, self._called)118 self.assertTrue(expected, self._called)
210119
=== modified file 'ubuntu_sso/qt/tests/test_network_detection.py'
--- ubuntu_sso/qt/tests/test_network_detection.py 2012-02-29 14:00:12 +0000
+++ ubuntu_sso/qt/tests/test_network_detection.py 2012-03-05 21:55:21 +0000
@@ -20,7 +20,7 @@
2020
21from ubuntu_sso.qt import network_detection_page21from ubuntu_sso.qt import network_detection_page
22from ubuntu_sso.qt.tests import (22from ubuntu_sso.qt.tests import (
23 BaseTestCase,23 PageBaseTestCase,
24 FakeWizardButtonStyle,24 FakeWizardButtonStyle,
25)25)
2626
@@ -28,7 +28,7 @@
28# pylint: disable=W0212, E110128# pylint: disable=W0212, E1101
2929
3030
31class NetworkDetectionTestCase(BaseTestCase):31class NetworkDetectionTestCase(PageBaseTestCase):
3232
33 """Test the CurrentUserController."""33 """Test the CurrentUserController."""
3434
3535
=== modified file 'ubuntu_sso/qt/tests/test_reset_password.py'
--- ubuntu_sso/qt/tests/test_reset_password.py 2012-03-01 20:46:34 +0000
+++ ubuntu_sso/qt/tests/test_reset_password.py 2012-03-05 21:55:21 +0000
@@ -30,7 +30,7 @@
30 RESET_SUBTITLE,30 RESET_SUBTITLE,
31 RESET_TITLE,31 RESET_TITLE,
32)32)
33from ubuntu_sso.qt.tests import BaseTestCase33from ubuntu_sso.qt.tests import PageBaseTestCase
3434
3535
36# We need this Fake until a future refactor.36# We need this Fake until a future refactor.
@@ -54,7 +54,7 @@
54 return self.line_text54 return self.line_text
5555
5656
57class ResetPasswordTestCase(BaseTestCase):57class ResetPasswordTestCase(PageBaseTestCase):
58 """Test the ResetPasswordPage code."""58 """Test the ResetPasswordPage code."""
5959
60 ui_class = ResetPasswordPage60 ui_class = ResetPasswordPage
@@ -73,9 +73,8 @@
73 self.ui.show()73 self.ui.show()
74 self.ui.initializePage()74 self.ui.initializePage()
75 self.addCleanup(self.ui.hide)75 self.addCleanup(self.ui.hide)
76 self.assertEqual(self.ui.header.title_label.text(), RESET_TITLE)76 self.assert_title_correct(RESET_TITLE)
77 self.assertEqual(self.ui.header.subtitle_label.text(),77 self.assert_subtitle_correct(RESET_SUBTITLE)
78 RESET_SUBTITLE)
79 self.assertEqual(self.ui.ui.password_label.text(), PASSWORD1_ENTRY)78 self.assertEqual(self.ui.ui.password_label.text(), PASSWORD1_ENTRY)
80 self.assertEqual(self.ui.ui.confirm_password_label.text(),79 self.assertEqual(self.ui.ui.confirm_password_label.text(),
81 PASSWORD2_ENTRY)80 PASSWORD2_ENTRY)
8281
=== modified file 'ubuntu_sso/qt/tests/test_setup_account.py'
--- ubuntu_sso/qt/tests/test_setup_account.py 2012-03-05 19:58:07 +0000
+++ ubuntu_sso/qt/tests/test_setup_account.py 2012-03-05 21:55:21 +0000
@@ -18,17 +18,14 @@
1818
19from PyQt4 import QtGui, QtCore19from PyQt4 import QtGui, QtCore
2020
21from ubuntu_sso.qt import common, setup_account_page21from ubuntu_sso.qt import common, setup_account_page as gui
22from ubuntu_sso.qt.tests import (22from ubuntu_sso.qt.tests import PageBaseTestCase
23 BaseTestCasePage,23
24 HELP_TEXT,24
25)25class SetupAccountTestCase(PageBaseTestCase):
26
27
28class SetupAccountTestCase(BaseTestCasePage):
29 """Test the SetupAccountPage code."""26 """Test the SetupAccountPage code."""
3027
31 ui_class = setup_account_page.SetupAccountPage28 ui_class = gui.SetupAccountPage
32 ui_signals = ('userRegistered',)29 ui_signals = ('userRegistered',)
33 ui_backend_signals = ('CaptchaGenerated', 'CaptchaGenerationError',30 ui_backend_signals = ('CaptchaGenerated', 'CaptchaGenerationError',
34 'UserRegistered', 'UserRegistrationError')31 'UserRegistered', 'UserRegistrationError')
@@ -51,7 +48,7 @@
51 self.assertTrue(self.ui.ui.name_assistance.isVisible())48 self.assertTrue(self.ui.ui.name_assistance.isVisible())
52 self.assertEqual(49 self.assertEqual(
53 unicode(self.ui.ui.name_assistance.text()),50 unicode(self.ui.ui.name_assistance.text()),
54 setup_account_page.ERROR % setup_account_page.EMPTY_NAME)51 gui.ERROR_STYLE % gui.EMPTY_NAME)
55 self.ui.hide()52 self.ui.hide()
5653
57 def test_enable_setup_button_with_visible_check(self):54 def test_enable_setup_button_with_visible_check(self):
@@ -176,16 +173,10 @@
176 def test_set_next_validation(self):173 def test_set_next_validation(self):
177 """Test on_user_registered method."""174 """Test on_user_registered method."""
178 email = 'email@example'175 email = 'email@example'
179 password = 'password'
180 self.ui.ui.email_edit.setText(email)176 self.ui.ui.email_edit.setText(email)
181 self.ui.ui.password_edit.setText(password)
182177
183 def slot(email, password):178 self.assert_signal_emitted(self.ui.userRegistered, (email,),
184 """Fake slot."""179 self.ui.on_user_registered, self.app_name, email)
185 self.signals_results.append((email, password))
186 self.ui.userRegistered.connect(slot)
187 self.ui.on_user_registered('app_name', None)
188 self.assertIn((email, password), self.signals_results)
189180
190 def test_captcha_image_is_requested_as_startup(self):181 def test_captcha_image_is_requested_as_startup(self):
191 """The captcha image is requested at startup."""182 """The captcha image is requested at startup."""
@@ -193,29 +184,24 @@
193 self.assert_backend_called('generate_captcha',184 self.assert_backend_called('generate_captcha',
194 self.app_name, self.ui.captcha_file)185 self.app_name, self.ui.captcha_file)
195186
187 def test_set_translated_strings(self):
188 """Test the translated string method."""
189 expected = gui.REGISTER_TITLE.format(app_name=self.app_name)
190 self.assert_title_correct(expected)
191 self.assert_subtitle_correct(self.ui.help_text)
192
196 def test_initialize_page(self):193 def test_initialize_page(self):
197 """Widgets are properly initialized."""194 """Widgets are properly initialized."""
198 self.ui.initializePage()195 self.ui.initializePage()
199 self.ui.show()196 self.ui.show()
200 self.addCleanup(self.ui.hide)197 self.addCleanup(self.ui.hide)
201198
202 # titles
203 title = unicode(self.ui.header.title_label.text())
204 title_expected = (setup_account_page.TITLE_STYLE %
205 setup_account_page.TITLE.format(app_name=self.app_name))
206 self.assertEqual(title, title_expected)
207
208 elided_text = unicode(self.ui.header.subtitle_label.text())
209 elided_text = elided_text[:len(elided_text) - 1]
210 self.assertTrue(HELP_TEXT.startswith(elided_text))
211 self.assertEqual(self.ui.header.subtitle_label.toolTip(), HELP_TEXT)
212
213 # set up account button199 # set up account button
214 expected = [QtGui.QWizard.BackButton, QtGui.QWizard.Stretch,200 expected = [QtGui.QWizard.BackButton, QtGui.QWizard.Stretch,
215 QtGui.QWizard.CustomButton3]201 QtGui.QWizard.CustomButton3]
216 self.assertIn(('setButtonLayout', ((expected,), {})),202 self.assertIn(('setButtonLayout', ((expected,), {})),
217 self.ui.wizard().called)203 self.ui.wizard().called)
218 self.assertEqual(setup_account_page.SET_UP_ACCOUNT_BUTTON,204 self.assertEqual(gui.SET_UP_ACCOUNT_BUTTON,
219 self.ui.buttonText(QtGui.QWizard.CustomButton3))205 self.ui.buttonText(QtGui.QWizard.CustomButton3))
220 self.assertTrue(self.ui.wizard().button(QtGui.QWizard.CustomButton3) is206 self.assertTrue(self.ui.wizard().button(QtGui.QWizard.CustomButton3) is
221 self.ui.set_up_button)207 self.ui.set_up_button)
@@ -224,16 +210,13 @@
224 self.assertFalse(self.ui.captcha_received)210 self.assertFalse(self.ui.captcha_received)
225211
226 # labels212 # labels
227 self.assertEqual(self.ui.ui.name_label.text(),213 self.assertEqual(self.ui.ui.name_label.text(), gui.NAME_ENTRY)
228 setup_account_page.NAME_ENTRY)214 self.assertEqual(self.ui.ui.email_label.text(), gui.EMAIL)
229 self.assertEqual(self.ui.ui.email_label.text(),
230 setup_account_page.EMAIL)
231 self.assertEqual(self.ui.ui.confirm_email_label.text(),215 self.assertEqual(self.ui.ui.confirm_email_label.text(),
232 setup_account_page.RETYPE_EMAIL)216 gui.RETYPE_EMAIL)
233 self.assertEqual(self.ui.ui.password_label.text(),217 self.assertEqual(self.ui.ui.password_label.text(), gui.PASSWORD)
234 setup_account_page.PASSWORD)
235 self.assertEqual(self.ui.ui.confirm_password_label.text(),218 self.assertEqual(self.ui.ui.confirm_password_label.text(),
236 setup_account_page.RETYPE_PASSWORD)219 gui.RETYPE_PASSWORD)
237220
238 # assistants221 # assistants
239 self.assertFalse(self.ui.ui.name_assistance.isVisible())222 self.assertFalse(self.ui.ui.name_assistance.isVisible())
@@ -262,7 +245,7 @@
262 self.assertTrue(self.ui.ui.email_assistance.isVisible())245 self.assertTrue(self.ui.ui.email_assistance.isVisible())
263 self.assertEqual(246 self.assertEqual(
264 unicode(self.ui.ui.email_assistance.text()),247 unicode(self.ui.ui.email_assistance.text()),
265 setup_account_page.ERROR % "message")248 gui.ERROR_STYLE % "message")
266249
267 def test_blank_name(self):250 def test_blank_name(self):
268 """Status when the name field is blank (spaces).251 """Status when the name field is blank (spaces).
@@ -277,7 +260,7 @@
277 self.assertTrue(self.ui.ui.name_assistance.isVisible())260 self.assertTrue(self.ui.ui.name_assistance.isVisible())
278 self.assertEqual(261 self.assertEqual(
279 unicode(self.ui.ui.name_assistance.text()),262 unicode(self.ui.ui.name_assistance.text()),
280 setup_account_page.ERROR % setup_account_page.EMPTY_NAME)263 gui.ERROR_STYLE % gui.EMPTY_NAME)
281 self.ui.hide()264 self.ui.hide()
282265
283 def test_valid_name(self):266 def test_valid_name(self):
@@ -305,7 +288,7 @@
305 self.assertTrue(self.ui.ui.email_assistance.isVisible())288 self.assertTrue(self.ui.ui.email_assistance.isVisible())
306 self.assertEqual(289 self.assertEqual(
307 unicode(self.ui.ui.email_assistance.text()),290 unicode(self.ui.ui.email_assistance.text()),
308 setup_account_page.ERROR % setup_account_page.INVALID_EMAIL)291 gui.ERROR_STYLE % gui.INVALID_EMAIL)
309292
310 def test_valid_email(self):293 def test_valid_email(self):
311 """Status when the email field has a @.294 """Status when the email field has a @.
@@ -346,7 +329,7 @@
346 self.assertTrue(self.ui.ui.confirm_email_assistance.isVisible())329 self.assertTrue(self.ui.ui.confirm_email_assistance.isVisible())
347 self.assertEqual(330 self.assertEqual(
348 unicode(self.ui.ui.confirm_email_assistance.text()),331 unicode(self.ui.ui.confirm_email_assistance.text()),
349 setup_account_page.ERROR % setup_account_page.EMAIL_MATCH)332 gui.ERROR_STYLE % gui.EMAIL_MATCH)
350 self.ui.hide()333 self.ui.hide()
351334
352 def test_focus_changed_password_visibility(self):335 def test_focus_changed_password_visibility(self):
353336
=== modified file 'ubuntu_sso/qt/tests/test_sso_wizard_page.py'
--- ubuntu_sso/qt/tests/test_sso_wizard_page.py 2012-03-01 12:30:13 +0000
+++ ubuntu_sso/qt/tests/test_sso_wizard_page.py 2012-03-05 21:55:21 +0000
@@ -21,7 +21,7 @@
21from ubuntu_sso.qt import PREFERED_UI_SIZE21from ubuntu_sso.qt import PREFERED_UI_SIZE
22from ubuntu_sso.qt.setup_account_page import SetupAccountPage22from ubuntu_sso.qt.setup_account_page import SetupAccountPage
23from ubuntu_sso.qt.sso_wizard_page import Header23from ubuntu_sso.qt.sso_wizard_page import Header
24from ubuntu_sso.qt.tests import BaseTestCase24from ubuntu_sso.qt.tests import BaseTestCase, PageBaseTestCase
2525
2626
27class HeaderTest(BaseTestCase):27class HeaderTest(BaseTestCase):
@@ -84,39 +84,30 @@
84 self.assertFalse(self.header.title_label.isVisible())84 self.assertFalse(self.header.title_label.isVisible())
8585
8686
87class SSOWizardPageTest(BaseTestCase):87class SSOWizardPageTest(PageBaseTestCase):
8888
89 """Tests for SSOWizardPage."""89 """Tests for SSOWizardPage."""
9090
91 @defer.inlineCallbacks91 ui_class = SetupAccountPage
92 def setUp(self):
93 yield super(SSOWizardPageTest, self).setUp()
94 self.app_name = 'app_name'
95 # We need to choose some specific page to test SSOWizardPage,
96 # because the __init__ of SSOWizardPage fails by its own.
97 self.sso_wizard_page = SetupAccountPage(self.app_name)
9892
99 def test_show_error(self):93 def test_show_error(self):
100 """Test show_error with a normal length string."""94 """Test show_error with a normal length string."""
101 message = 'error-message'95 message = 'error-message'
102 self.sso_wizard_page.show_error(self.app_name, message)96 self.ui.show_error(self.app_name, message)
103 self.assertEqual(97 self.assertEqual(self.ui.form_errors_label.toolTip(), message)
104 self.sso_wizard_page.form_errors_label.toolTip(), message)98 expected = unicode(self.ui.form_errors_label.text())
105 expected = unicode(self.sso_wizard_page.form_errors_label.text())
106 self.assertEqual(expected, message)99 self.assertEqual(expected, message)
107100
108 def test_show_error_long_text(self):101 def test_show_error_long_text(self):
109 """Test show_error with a long length string."""102 """Test show_error with a long length string."""
110 message = 'a' * int(PREFERED_UI_SIZE['width'] * 0.95) + 'a'103 message = 'a' * int(PREFERED_UI_SIZE['width'] * 0.95) + 'a'
111 self.sso_wizard_page.show_error(self.app_name, message)104 self.ui.show_error(self.app_name, message)
112 self.assertEqual(105 self.assertEqual(self.ui.form_errors_label.toolTip(), message)
113 self.sso_wizard_page.form_errors_label.toolTip(), message)106 expected = unicode(self.ui.form_errors_label.text())
114 expected = unicode(self.sso_wizard_page.form_errors_label.text())
115 self.assertTrue(expected.endswith(u'\u2026'))107 self.assertTrue(expected.endswith(u'\u2026'))
116108
117 def test_hide_error(self):109 def test_hide_error(self):
118 """Test show_error with a long length string."""110 """Test show_error with a long length string."""
119 message = ' '111 message = ' '
120 self.sso_wizard_page.hide_error()112 self.ui.hide_error()
121 self.assertEqual(113 self.assertEqual(self.ui.form_errors_label.text(), message)
122 self.sso_wizard_page.form_errors_label.text(), message)
123114
=== modified file 'ubuntu_sso/qt/ubuntu_sso_wizard.py'
--- ubuntu_sso/qt/ubuntu_sso_wizard.py 2012-03-05 14:15:44 +0000
+++ ubuntu_sso/qt/ubuntu_sso_wizard.py 2012-03-05 21:55:21 +0000
@@ -29,7 +29,7 @@
29 USER_CANCELLATION,29 USER_CANCELLATION,
30 USER_SUCCESS,30 USER_SUCCESS,
31)31)
32from ubuntu_sso.logger import setup_logging32from ubuntu_sso.logger import setup_gui_logging
33from ubuntu_sso.qt import PREFERED_UI_SIZE33from ubuntu_sso.qt import PREFERED_UI_SIZE
34from ubuntu_sso.qt.current_user_sign_in_page import CurrentUserSignInPage34from ubuntu_sso.qt.current_user_sign_in_page import CurrentUserSignInPage
35from ubuntu_sso.qt.email_verification_page import EmailVerificationPage35from ubuntu_sso.qt.email_verification_page import EmailVerificationPage
@@ -40,7 +40,7 @@
40from ubuntu_sso.qt.setup_account_page import SetupAccountPage40from ubuntu_sso.qt.setup_account_page import SetupAccountPage
41from ubuntu_sso.qt.success_page import SuccessPage41from ubuntu_sso.qt.success_page import SuccessPage
4242
43logger = setup_logging('ubuntu_sso.gui')43logger = setup_gui_logging('ubuntu_sso.gui')
4444
4545
46class UbuntuSSOWizard(QWizard):46class UbuntuSSOWizard(QWizard):
4747
=== modified file 'ubuntu_sso/utils/ui.py'
--- ubuntu_sso/utils/ui.py 2012-03-05 15:58:16 +0000
+++ ubuntu_sso/utils/ui.py 2012-03-05 21:55:21 +0000
@@ -45,8 +45,8 @@
45CAPTCHA_REQUIRED_ERROR = _('The captcha is a required field')45CAPTCHA_REQUIRED_ERROR = _('The captcha is a required field')
46CLOSE_AND_SETUP_LATER = _('Close window and setup later')46CLOSE_AND_SETUP_LATER = _('Close window and setup later')
47CONGRATULATIONS = _("Congratulations, {app_name} is installed!")47CONGRATULATIONS = _("Congratulations, {app_name} is installed!")
48CONNECT_HELP_LABEL = _('To connect this computer to %(app_name)s ' \48CONNECT_HELP_LABEL = _('To connect this computer to %(app_name)s enter your '
49 'enter your details below.')49 'details below.')
50EMAIL_LABEL = EMAIL1_ENTRY = _('Email address')50EMAIL_LABEL = EMAIL1_ENTRY = _('Email address')
51EMAIL2_ENTRY = _('Re-type Email address')51EMAIL2_ENTRY = _('Re-type Email address')
52EMAIL_INVALID = _('The email must be a valid email address.')52EMAIL_INVALID = _('The email must be a valid email address.')
@@ -61,6 +61,10 @@
61EXISTING_ACCOUNT_CHOICE_BUTTON = _('Sign me in with my existing account')61EXISTING_ACCOUNT_CHOICE_BUTTON = _('Sign me in with my existing account')
62FIELD_REQUIRED = _('This field is required.')62FIELD_REQUIRED = _('This field is required.')
63FORGOTTEN_PASSWORD_BUTTON = _('I\'ve forgotten my password')63FORGOTTEN_PASSWORD_BUTTON = _('I\'ve forgotten my password')
64FORGOTTEN_PASSWORD_TITLE = _('Reset password')
65FORGOTTEN_PASSWORD_SUBTITLE = _('To reset your {app_name} password, enter '
66 'your registered email address below. We will send instructions to reset '
67 'your password.')
64INVALID_EMAIL = _("Please enter a valid email address")68INVALID_EMAIL = _("Please enter a valid email address")
65GENERIC_BACKEND_ERROR = _('There was a problem accessing the Ubuntu Single'69GENERIC_BACKEND_ERROR = _('There was a problem accessing the Ubuntu Single'
66 ' Sign On backend.')70 ' Sign On backend.')
@@ -72,6 +76,8 @@
72LOGIN_HEADER_LABEL = _('Connect to %(app_name)s')76LOGIN_HEADER_LABEL = _('Connect to %(app_name)s')
73LOGIN_PASSWORD_ENTRY = _('Password')77LOGIN_PASSWORD_ENTRY = _('Password')
74LOGIN_PASSWORD_LABEL = LOGIN_PASSWORD_ENTRY78LOGIN_PASSWORD_LABEL = LOGIN_PASSWORD_ENTRY
79LOGIN_TITLE = _('Sign In to {app_name}')
80LOGIN_SUBTITLE = CONNECT_HELP_LABEL
75NAME_ENTRY = _('Name')81NAME_ENTRY = _('Name')
76NAME_INVALID = _('The name must not be empty.')82NAME_INVALID = _('The name must not be empty.')
77NEXT = _('Next')83NEXT = _('Next')
@@ -84,12 +90,12 @@
84PASSWORD_DIGIT = _("At least one number")90PASSWORD_DIGIT = _("At least one number")
85PASSWORD1_ENTRY = RESET_PASSWORD1_ENTRY = _('Password')91PASSWORD1_ENTRY = RESET_PASSWORD1_ENTRY = _('Password')
86PASSWORD2_ENTRY = RESET_PASSWORD2_ENTRY = _('Re-type Password')92PASSWORD2_ENTRY = RESET_PASSWORD2_ENTRY = _('Re-type Password')
87PASSWORD_HELP = _('The password must have a minimum of 8 characters and ' \93PASSWORD_HELP = _('The password must have a minimum of 8 characters and '
88 'include one uppercase character and one number.')94 'include one uppercase character and one number.')
89PASSWORD_LENGTH = _("At least 8 characters")95PASSWORD_LENGTH = _("At least 8 characters")
90PASSWORD_MATCH = _("Passwords don't match")96PASSWORD_MATCH = _("Passwords don't match")
91PASSWORD_MISMATCH = _('The passwords don\'t match, please double check ' \97PASSWORD_MISMATCH = _('The passwords don\'t match, please double check '
92 'and try entering them again.')98 'and try entering them again.')
93PASSWORD_MUST_CONTAIN = _("Your password must contain")99PASSWORD_MUST_CONTAIN = _("Your password must contain")
94PASSWORD_TOO_WEAK = _('The password is too weak.')100PASSWORD_TOO_WEAK = _('The password is too weak.')
95PASSWORD_UPPER = _("At least one uppercase letter")101PASSWORD_UPPER = _("At least one uppercase letter")
@@ -104,24 +110,22 @@
104PROXY_CREDS_SAVE_BUTTON = _('Save and Connect')110PROXY_CREDS_SAVE_BUTTON = _('Save and Connect')
105PROXY_CREDS_USER_LABEL = _('Proxy username:')111PROXY_CREDS_USER_LABEL = _('Proxy username:')
106RESET_TITLE = _("Reset password")112RESET_TITLE = _("Reset password")
107RESET_SUBTITLE = _("A password reset code has been sent to your e-mail."113RESET_SUBTITLE = _('A password reset code has been sent to your e-mail. '
108 "Please enter the code below along with your new password.")114 'Please enter the code below along with your new password.')
109RETYPE_EMAIL = _("Retype email")115RETYPE_EMAIL = _("Retype email")
110RETYPE_PASSWORD = _("Retype password")116RETYPE_PASSWORD = _("Retype password")
111REQUEST_PASSWORD_TOKEN_LABEL = _('To reset your %(app_name)s password,'117REQUEST_PASSWORD_TOKEN_LABEL = _('To reset your %(app_name)s password,'
112 ' enter your email address below:')118 ' enter your email address below:')
113REQUEST_PASSWORD_TOKEN_TECH_ERROR = _('We are very Sorry! The service that'119REQUEST_PASSWORD_TOKEN_TECH_ERROR = _('We are very Sorry! The service that'
114 ' signs you on is not responding right'120 ' signs you on is not responding right now\nPlease try again or'
115 ' now\nPlease try again or come back in'121 ' come back in a few minutes.')
116 ' a few minutes.')
117REQUEST_PASSWORD_TOKEN_WRONG_EMAIL = _('Sorry we did not recognize the email'122REQUEST_PASSWORD_TOKEN_WRONG_EMAIL = _('Sorry we did not recognize the email'
118 ' address.')123 ' address.')
119RESET_CODE_ENTRY = _('Reset code')124RESET_CODE_ENTRY = _('Reset code')
120RESET_EMAIL_ENTRY = _('Email address')125RESET_EMAIL_ENTRY = _('Email address')
121RESET_PASSWORD = _('Reset password')126RESET_PASSWORD = RESET_TITLE
122SET_NEW_PASSWORD_LABEL = _('A password reset code has been sent to ' \127SET_NEW_PASSWORD_LABEL = _('A password reset code has been sent to '
123 '%(email)s.\nPlease enter the code below ' \128 '%(email)s.\nPlease enter the code below along with your new password.')
124 'along with your new password.')
125SET_UP_ACCOUNT_BUTTON = _('Set Up Account')129SET_UP_ACCOUNT_BUTTON = _('Set Up Account')
126SET_UP_ACCOUNT_CHOICE_BUTTON = _('I don\'t have an account yet - sign me up')130SET_UP_ACCOUNT_CHOICE_BUTTON = _('I don\'t have an account yet - sign me up')
127SIGN_IN_BUTTON = _('Sign In')131SIGN_IN_BUTTON = _('Sign In')
@@ -133,8 +137,8 @@
133SSL_DIALOG_TITLE = _('SSL Certificate Not Valid')137SSL_DIALOG_TITLE = _('SSL Certificate Not Valid')
134SSL_DOMAIN_HELP = _('the domain whose ssl certificate we are going to show.')138SSL_DOMAIN_HELP = _('the domain whose ssl certificate we are going to show.')
135SSL_EXPLANATION = _('You are trying to connect to a proxy server on'139SSL_EXPLANATION = _('You are trying to connect to a proxy server on'
136 ' %(domain)s. This server uses a secure connection,'140 ' %(domain)s. This server uses a secure connection, and the SSL '
137 ' and the SSL certificate is not valid because:')141 'certificate is not valid because:')
138SSL_FIRST_REASON = _('The certificate has not been verified')142SSL_FIRST_REASON = _('The certificate has not been verified')
139SSL_HEADER = _('Do you want to connect to this server?')143SSL_HEADER = _('Do you want to connect to this server?')
140SSL_HELP_BUTTON = _('Get Help With SSL')144SSL_HELP_BUTTON = _('Get Help With SSL')
@@ -142,25 +146,24 @@
142 ' connect to %(app_name)s.')146 ' connect to %(app_name)s.')
143SSL_REMEMBER_DECISION = _('Remember my settings for this certificate.')147SSL_REMEMBER_DECISION = _('Remember my settings for this certificate.')
144SSL_SECOND_REASON = _('The name on the certificate isn\'t valid or doesn\'t'148SSL_SECOND_REASON = _('The name on the certificate isn\'t valid or doesn\'t'
145 ' match the name of the site')149 ' match the name of the site')
146SSL_THIRD_REASON = _('The certificate has expired')150SSL_THIRD_REASON = _('The certificate has expired')
147SUCCESS = _('You are now logged into %(app_name)s.')151SUCCESS = _('You are now logged into %(app_name)s.')
148SURNAME_ENTRY = _('Surname')152SURNAME_ENTRY = _('Surname')
149TERMS_TEXT = _("Terms of Service")153TERMS_TEXT = _("Terms of Service")
150TITLE = _("Sign Up to {app_name}")154TITLE = REGISTER_TITLE = _("Sign Up to {app_name}")
151TC_BUTTON = _('Show Terms & Conditions')155TC_BUTTON = _('Show Terms & Conditions')
152TC_NOT_ACCEPTED = _('Agreeing to the %(app_name)s Terms & Conditions is ' \156TC_NOT_ACCEPTED = _('Agreeing to the %(app_name)s Terms & Conditions is '
153 'required to subscribe.')157 'required to subscribe.')
154TOS_LABEL = _("You can also find these terms at <a href='%(url)s'>%(url)s</a>")158TOS_LABEL = _("You can also find these terms at <a href='%(url)s'>%(url)s</a>")
155TRY_AGAIN_BUTTON = _('Try again')159TRY_AGAIN_BUTTON = _('Try again')
156UNKNOWN_ERROR = _('There was an error when trying to complete the ' \160UNKNOWN_ERROR = _('There was an error when trying to complete the '
157 'process. Please check the information and try again.')161 'process. Please check the information and try again.')
158VERIFICATION_CODE = _('Verification code')162VERIFICATION_CODE = _('Verification code')
159VERIFY_EMAIL_CONTENT = _('Check %(email)s for an email from'163VERIFY_EMAIL_CONTENT = _('Check %(email)s for an email from Ubuntu Single '
160 ' Ubuntu Single Sign On.'164 'Sign On. This message contains a verification code. Enter the code in '
161 ' This message contains a verification code.'165 'the field below and click OK to complete creating your %(app_name)s '
162 ' Enter the code in the field below and click OK'166 'account.')
163 ' to complete creating your %(app_name)s account.')
164VERIFY_EMAIL_TITLE = _('Enter verification code')167VERIFY_EMAIL_TITLE = _('Enter verification code')
165VERIFY_EMAIL_LABEL = ('<b>%s</b>\n\n' % VERIFY_EMAIL_TITLE +168VERIFY_EMAIL_LABEL = ('<b>%s</b>\n\n' % VERIFY_EMAIL_TITLE +
166 VERIFY_EMAIL_CONTENT)169 VERIFY_EMAIL_CONTENT)

Subscribers

People subscribed via source and target branches