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