Merge lp:~ralsina/ubuntu-sso-client/change-your-mind into lp:ubuntu-sso-client
- change-your-mind
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Alejandro J. Cura |
Approved revision: | 1004 |
Merged at revision: | 996 |
Proposed branch: | lp:~ralsina/ubuntu-sso-client/change-your-mind |
Merge into: | lp:ubuntu-sso-client |
Diff against target: |
523 lines (+135/-30) 8 files modified
data/qt/current_user_sign_in.ui (+9/-1) data/qt/setup_account.ui (+28/-16) ubuntu_sso/qt/current_user_sign_in_page.py (+13/-0) ubuntu_sso/qt/setup_account_page.py (+6/-0) ubuntu_sso/qt/tests/test_current_user_sign_in_page.py (+18/-1) ubuntu_sso/qt/tests/test_setup_account.py (+40/-1) ubuntu_sso/qt/ubuntu_sso_wizard.py (+19/-11) ubuntu_sso/utils/ui.py (+2/-0) |
To merge this branch: | bzr merge lp:~ralsina/ubuntu-sso-client/change-your-mind |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alejandro J. Cura (community) | Approve | ||
dobey (community) | Approve | ||
Review via email: mp+122904@code.launchpad.net |
Commit message
- Added cross-links from/to signing/signup tabs (Fixes LP:974637)
Description of the change
- Added cross-links from/to signing/signup tabs (Fixes LP:974637)
- 999. By Roberto Alsina
-
use app_name
Roberto Alsina (ralsina) wrote : | # |
> +CREATE_
>
> This cannot say "Ubuntu One" here, as this is ubuntu-sso-client. And this is
> also similar enough to REGISTER_TITLE, that perhaps we should just use it as
> the label instead? Otherwise, this will need to use the app_name variable, as
> REGISTER_TITLE does.
You are correct. Fixed.
dobey (dobey) wrote : | # |
+ logger.debug('About to emit passwordForgotten signal')
I suppose this also needs to say 'createAccount signal' instead?
dobey (dobey) wrote : | # |
Also, shouldn't the strings in the .ui files, and the ui.py match? Is there a reason they need to be different?
- 1000. By Roberto Alsina
-
fixed wrong signal name in log and docstring
Roberto Alsina (ralsina) wrote : | # |
On 09/05/2012 02:33 PM, Rodney Dawes wrote:
> Also, shouldn't the strings in the .ui files, and the ui.py match? Is there a reason they need to be different?
The strings in the .ui files are only there as placeholders, they are
never shown. No need to be different, but I put them there when I didn't
have the real strings ;-)
- 1001. By Roberto Alsina
-
make strings match
dobey (dobey) : | # |
- 1002. By Roberto Alsina
-
added tests
- 1003. By Roberto Alsina
-
added tests
- 1004. By Roberto Alsina
-
lint
Preview Diff
1 | === modified file 'data/qt/current_user_sign_in.ui' |
2 | --- data/qt/current_user_sign_in.ui 2012-03-05 20:40:24 +0000 |
3 | +++ data/qt/current_user_sign_in.ui 2012-09-06 15:23:20 +0000 |
4 | @@ -7,7 +7,7 @@ |
5 | <x>0</x> |
6 | <y>0</y> |
7 | <width>302</width> |
8 | - <height>244</height> |
9 | + <height>295</height> |
10 | </rect> |
11 | </property> |
12 | <layout class="QVBoxLayout" name="verticalLayout_2"> |
13 | @@ -18,6 +18,13 @@ |
14 | <number>0</number> |
15 | </property> |
16 | <item> |
17 | + <widget class="QLabel" name="create_account_label"> |
18 | + <property name="text"> |
19 | + <string>Register with {app_name}.</string> |
20 | + </property> |
21 | + </widget> |
22 | + </item> |
23 | + <item> |
24 | <layout class="QVBoxLayout" name="verticalLayout"> |
25 | <property name="spacing"> |
26 | <number>3</number> |
27 | @@ -140,6 +147,7 @@ |
28 | <zorder>verticalSpacer</zorder> |
29 | <zorder>forgot_password_label</zorder> |
30 | <zorder></zorder> |
31 | + <zorder>create_account_label</zorder> |
32 | </widget> |
33 | <resources/> |
34 | <connections> |
35 | |
36 | === modified file 'data/qt/setup_account.ui' |
37 | --- data/qt/setup_account.ui 2012-03-20 15:05:19 +0000 |
38 | +++ data/qt/setup_account.ui 2012-09-06 15:23:20 +0000 |
39 | @@ -37,7 +37,7 @@ |
40 | <property name="verticalSpacing"> |
41 | <number>6</number> |
42 | </property> |
43 | - <item row="4" column="0" colspan="2"> |
44 | + <item row="5" column="0" colspan="2"> |
45 | <spacer name="verticalSpacer_2"> |
46 | <property name="orientation"> |
47 | <enum>Qt::Vertical</enum> |
48 | @@ -50,7 +50,7 @@ |
49 | </property> |
50 | </spacer> |
51 | </item> |
52 | - <item row="10" column="0" colspan="2"> |
53 | + <item row="11" column="0" colspan="2"> |
54 | <spacer name="verticalSpacer_3"> |
55 | <property name="orientation"> |
56 | <enum>Qt::Vertical</enum> |
57 | @@ -63,7 +63,7 @@ |
58 | </property> |
59 | </spacer> |
60 | </item> |
61 | - <item row="7" column="0" colspan="2"> |
62 | + <item row="8" column="0" colspan="2"> |
63 | <spacer name="verticalSpacer_4"> |
64 | <property name="orientation"> |
65 | <enum>Qt::Vertical</enum> |
66 | @@ -76,7 +76,7 @@ |
67 | </property> |
68 | </spacer> |
69 | </item> |
70 | - <item row="0" column="0"> |
71 | + <item row="1" column="0"> |
72 | <layout class="QVBoxLayout" name="verticalLayout_5"> |
73 | <property name="spacing"> |
74 | <number>3</number> |
75 | @@ -85,6 +85,7 @@ |
76 | <widget class="QLabel" name="name_label"> |
77 | <property name="font"> |
78 | <font> |
79 | + <weight>75</weight> |
80 | <bold>true</bold> |
81 | </font> |
82 | </property> |
83 | @@ -120,7 +121,7 @@ |
84 | </item> |
85 | </layout> |
86 | </item> |
87 | - <item row="2" column="0"> |
88 | + <item row="3" column="0"> |
89 | <layout class="QVBoxLayout" name="verticalLayout_6"> |
90 | <property name="spacing"> |
91 | <number>3</number> |
92 | @@ -129,6 +130,7 @@ |
93 | <widget class="QLabel" name="email_label"> |
94 | <property name="font"> |
95 | <font> |
96 | + <weight>75</weight> |
97 | <bold>true</bold> |
98 | </font> |
99 | </property> |
100 | @@ -167,7 +169,7 @@ |
101 | </item> |
102 | </layout> |
103 | </item> |
104 | - <item row="2" column="1"> |
105 | + <item row="3" column="1"> |
106 | <layout class="QVBoxLayout" name="verticalLayout_8"> |
107 | <property name="spacing"> |
108 | <number>0</number> |
109 | @@ -208,7 +210,7 @@ |
110 | </item> |
111 | </layout> |
112 | </item> |
113 | - <item row="3" column="0"> |
114 | + <item row="4" column="0"> |
115 | <layout class="QVBoxLayout" name="verticalLayout_10"> |
116 | <property name="spacing"> |
117 | <number>3</number> |
118 | @@ -217,6 +219,7 @@ |
119 | <widget class="QLabel" name="confirm_email_label"> |
120 | <property name="font"> |
121 | <font> |
122 | + <weight>75</weight> |
123 | <bold>true</bold> |
124 | </font> |
125 | </property> |
126 | @@ -255,7 +258,7 @@ |
127 | </item> |
128 | </layout> |
129 | </item> |
130 | - <item row="3" column="1"> |
131 | + <item row="4" column="1"> |
132 | <layout class="QVBoxLayout" name="verticalLayout_9"> |
133 | <property name="spacing"> |
134 | <number>0</number> |
135 | @@ -299,7 +302,7 @@ |
136 | </item> |
137 | </layout> |
138 | </item> |
139 | - <item row="11" column="0" colspan="2"> |
140 | + <item row="12" column="0" colspan="2"> |
141 | <layout class="QHBoxLayout" name="hlayout_check"> |
142 | <property name="spacing"> |
143 | <number>6</number> |
144 | @@ -309,7 +312,7 @@ |
145 | </property> |
146 | </layout> |
147 | </item> |
148 | - <item row="0" column="1"> |
149 | + <item row="1" column="1"> |
150 | <layout class="QVBoxLayout" name="verticalLayout_7"> |
151 | <property name="spacing"> |
152 | <number>0</number> |
153 | @@ -350,7 +353,7 @@ |
154 | </item> |
155 | </layout> |
156 | </item> |
157 | - <item row="5" column="0"> |
158 | + <item row="6" column="0"> |
159 | <layout class="QVBoxLayout" name="verticalLayout_3"> |
160 | <property name="spacing"> |
161 | <number>3</number> |
162 | @@ -359,6 +362,7 @@ |
163 | <widget class="QLabel" name="password_label"> |
164 | <property name="font"> |
165 | <font> |
166 | + <weight>75</weight> |
167 | <bold>true</bold> |
168 | </font> |
169 | </property> |
170 | @@ -406,7 +410,7 @@ |
171 | </item> |
172 | </layout> |
173 | </item> |
174 | - <item row="5" column="1" rowspan="2"> |
175 | + <item row="6" column="1" rowspan="2"> |
176 | <layout class="QHBoxLayout" name="horizontalLayout_3"> |
177 | <property name="spacing"> |
178 | <number>0</number> |
179 | @@ -444,7 +448,7 @@ |
180 | </item> |
181 | </layout> |
182 | </item> |
183 | - <item row="6" column="0"> |
184 | + <item row="7" column="0"> |
185 | <layout class="QVBoxLayout" name="verticalLayout_2"> |
186 | <property name="spacing"> |
187 | <number>3</number> |
188 | @@ -453,6 +457,7 @@ |
189 | <widget class="QLabel" name="confirm_password_label"> |
190 | <property name="font"> |
191 | <font> |
192 | + <weight>75</weight> |
193 | <bold>true</bold> |
194 | </font> |
195 | </property> |
196 | @@ -494,7 +499,7 @@ |
197 | </item> |
198 | </layout> |
199 | </item> |
200 | - <item row="8" column="0"> |
201 | + <item row="9" column="0"> |
202 | <layout class="QVBoxLayout" name="verticalLayout_4"> |
203 | <property name="spacing"> |
204 | <number>3</number> |
205 | @@ -569,7 +574,7 @@ |
206 | </item> |
207 | </layout> |
208 | </item> |
209 | - <item row="1" column="0" colspan="2"> |
210 | + <item row="2" column="0" colspan="2"> |
211 | <spacer name="verticalSpacer"> |
212 | <property name="orientation"> |
213 | <enum>Qt::Vertical</enum> |
214 | @@ -582,7 +587,7 @@ |
215 | </property> |
216 | </spacer> |
217 | </item> |
218 | - <item row="8" column="1"> |
219 | + <item row="9" column="1"> |
220 | <layout class="QVBoxLayout" name="verticalLayout_13"> |
221 | <property name="rightMargin"> |
222 | <number>0</number> |
223 | @@ -617,6 +622,13 @@ |
224 | </item> |
225 | </layout> |
226 | </item> |
227 | + <item row="0" column="0"> |
228 | + <widget class="QLabel" name="sign_in_label"> |
229 | + <property name="text"> |
230 | + <string>Log-in with my existing account.</string> |
231 | + </property> |
232 | + </widget> |
233 | + </item> |
234 | </layout> |
235 | </item> |
236 | </layout> |
237 | |
238 | === modified file 'ubuntu_sso/qt/current_user_sign_in_page.py' |
239 | --- ubuntu_sso/qt/current_user_sign_in_page.py 2012-07-03 15:48:59 +0000 |
240 | +++ ubuntu_sso/qt/current_user_sign_in_page.py 2012-09-06 15:23:20 +0000 |
241 | @@ -40,6 +40,7 @@ |
242 | from ubuntu_sso.utils import compat |
243 | from ubuntu_sso.utils.ui import ( |
244 | CANCEL_BUTTON, |
245 | + CREATE_ACCOUNT_LABEL, |
246 | EMAIL_LABEL, |
247 | FORGOTTEN_PASSWORD_BUTTON, |
248 | is_correct_email, |
249 | @@ -59,6 +60,7 @@ |
250 | ui_class = Ui_CurrentUserSignInPage |
251 | userLoggedIn = QtCore.pyqtSignal(compat.text_type) |
252 | passwordForgotten = QtCore.pyqtSignal() |
253 | + createAccount = QtCore.pyqtSignal() |
254 | userNotValidated = QtCore.pyqtSignal(compat.text_type) |
255 | |
256 | @property |
257 | @@ -118,12 +120,17 @@ |
258 | forgotten_text = LINK_STYLE.format(link_url='#', |
259 | link_text=FORGOTTEN_PASSWORD_BUTTON) |
260 | self.ui.forgot_password_label.setText(forgotten_text) |
261 | + account_text = LINK_STYLE.format(link_url='#', |
262 | + link_text=CREATE_ACCOUNT_LABEL % {'app_name': self.app_name}) |
263 | + self.ui.create_account_label.setText(account_text) |
264 | self.ui.sign_in_button.setText(SIGN_IN_BUTTON) |
265 | |
266 | def _connect_ui(self): |
267 | """Connect the buttons to perform actions.""" |
268 | self.ui.forgot_password_label.linkActivated.connect( |
269 | self.on_forgotten_password) |
270 | + self.ui.create_account_label.linkActivated.connect( |
271 | + self.on_create_account) |
272 | self.ui.email_edit.textChanged.connect(self._validate) |
273 | self.ui.password_edit.textChanged.connect(self._validate) |
274 | self.ui.sign_in_button.clicked.connect(self.login) |
275 | @@ -175,3 +182,9 @@ |
276 | self.hide_overlay() |
277 | logger.debug('About to emit passwordForgotten signal') |
278 | self.passwordForgotten.emit() |
279 | + |
280 | + def on_create_account(self, link=None): |
281 | + """Show the user the account creation page.""" |
282 | + self.hide_overlay() |
283 | + logger.debug('About to emit createAccount signal') |
284 | + self.createAccount.emit() |
285 | |
286 | === modified file 'ubuntu_sso/qt/setup_account_page.py' |
287 | --- ubuntu_sso/qt/setup_account_page.py 2012-08-14 16:27:53 +0000 |
288 | +++ ubuntu_sso/qt/setup_account_page.py 2012-09-06 15:23:20 +0000 |
289 | @@ -86,6 +86,7 @@ |
290 | RETYPE_EMAIL, |
291 | RETYPE_PASSWORD, |
292 | SET_UP_ACCOUNT_BUTTON, |
293 | + SIGN_IN_LABEL, |
294 | TERMS_TEXT, |
295 | REGISTER_TITLE, |
296 | ) |
297 | @@ -101,6 +102,7 @@ |
298 | |
299 | ui_class = Ui_SetUpAccountPage |
300 | userRegistered = QtCore.pyqtSignal(compat.text_type) |
301 | + signIn = QtCore.pyqtSignal() |
302 | |
303 | def __init__(self, *args, **kwargs): |
304 | self.captcha_file = None |
305 | @@ -176,6 +178,9 @@ |
306 | self.setSubTitle(self.help_text) |
307 | |
308 | self.ui.name_label.setText(NAME_ENTRY) |
309 | + sign_in_link = LINK_STYLE.format(link_url='#', |
310 | + link_text=SIGN_IN_LABEL) |
311 | + self.ui.sign_in_label.setText(sign_in_link) |
312 | self.ui.email_label.setText(EMAIL1_ENTRY) |
313 | self.ui.confirm_email_label.setText(EMAIL2_ENTRY) |
314 | self.ui.password_label.setText(PASSWORD1_ENTRY) |
315 | @@ -259,6 +264,7 @@ |
316 | self.ui.captcha_solution_edit.textEdited.connect( |
317 | self._enable_setup_button) |
318 | self.terms_checkbox.stateChanged.connect(self._enable_setup_button) |
319 | + self.ui.sign_in_label.linkActivated.connect(self.signIn) |
320 | |
321 | self._refresh_captcha() |
322 | |
323 | |
324 | === modified file 'ubuntu_sso/qt/tests/test_current_user_sign_in_page.py' |
325 | --- ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-07-03 19:13:54 +0000 |
326 | +++ ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-09-06 15:23:20 +0000 |
327 | @@ -48,7 +48,8 @@ |
328 | """Test the SetupAccountPage code.""" |
329 | |
330 | ui_class = gui.CurrentUserSignInPage |
331 | - ui_signals = ('userLoggedIn', 'passwordForgotten', 'userNotValidated') |
332 | + ui_signals = ('userLoggedIn', 'passwordForgotten', 'userNotValidated', |
333 | + 'createAccount') |
334 | ui_backend_signals = ('LoggedIn', 'LoginError', 'UserNotValidated') |
335 | |
336 | def test_initialize_page(self): |
337 | @@ -86,6 +87,10 @@ |
338 | self.assert_subtitle_correct(expected) |
339 | self.assertEqual(compat.text_type(self.ui.ui.email_label.text()), |
340 | gui.EMAIL_LABEL) |
341 | + expected = gui.LINK_STYLE.format(link_url='#', |
342 | + link_text=gui.CREATE_ACCOUNT_LABEL % {'app_name': self.app_name}) |
343 | + self.assertEqual(compat.text_type( |
344 | + self.ui.ui.create_account_label.text()), expected) |
345 | self.assertEqual(compat.text_type(self.ui.ui.password_label.text()), |
346 | gui.LOGIN_PASSWORD_LABEL) |
347 | text = gui.LINK_STYLE.format(link_url='#', |
348 | @@ -107,6 +112,8 @@ |
349 | QtCore.SIGNAL("textChanged(const QString&)")), 1) |
350 | self.assertEqual(self.ui.ui.sign_in_button.receivers( |
351 | QtCore.SIGNAL("clicked()")), 1) |
352 | + self.assertEqual(self.ui.ui.create_account_label.receivers( |
353 | + QtCore.SIGNAL("linkActivated(const QString&)")), 1) |
354 | |
355 | def test_validate_not_valid(self): |
356 | """Test validate method.""" |
357 | @@ -191,3 +198,13 @@ |
358 | """Forgotten passsword clicked emits passwordForgotten signal.""" |
359 | self.assert_signal_emitted(self.ui.passwordForgotten, (), |
360 | self.ui.ui.forgot_password_label.linkActivated.emit, "link") |
361 | + |
362 | + def test_on_create_account(self): |
363 | + """Test the on_create_account method.""" |
364 | + self.assert_signal_emitted(self.ui.createAccount, (), |
365 | + self.ui.on_create_account) |
366 | + |
367 | + def test_on_create_account_link_clicked(self): |
368 | + """Create account clicked emits createAccount signal.""" |
369 | + self.assert_signal_emitted(self.ui.createAccount, (), |
370 | + self.ui.ui.create_account_label.linkActivated.emit, "link") |
371 | |
372 | === modified file 'ubuntu_sso/qt/tests/test_setup_account.py' |
373 | --- ubuntu_sso/qt/tests/test_setup_account.py 2012-08-14 23:15:15 +0000 |
374 | +++ ubuntu_sso/qt/tests/test_setup_account.py 2012-09-06 15:23:20 +0000 |
375 | @@ -41,7 +41,7 @@ |
376 | """Test the SetupAccountPage code.""" |
377 | |
378 | ui_class = gui.SetupAccountPage |
379 | - ui_signals = ('userRegistered',) |
380 | + ui_signals = ('userRegistered', 'signIn') |
381 | ui_backend_signals = ('CaptchaGenerated', 'CaptchaGenerationError', |
382 | 'UserRegistered', 'UserRegistrationError') |
383 | |
384 | @@ -234,6 +234,15 @@ |
385 | self.assertEqual( |
386 | compat.text_type(self.ui.ui.confirm_password_label.text()), |
387 | gui.RETYPE_PASSWORD) |
388 | + expected = gui.LINK_STYLE.format(link_url='#', |
389 | + link_text=gui.SIGN_IN_LABEL) |
390 | + self.assertEqual( |
391 | + compat.text_type(self.ui.ui.sign_in_label.text()), |
392 | + expected) |
393 | + |
394 | + # connections |
395 | + self.assertEqual(self.ui.set_up_button.receivers( |
396 | + QtCore.SIGNAL("clicked(const bool)")), 1) |
397 | |
398 | # assistants |
399 | self.assertFalse(self.ui.ui.name_assistance.isVisible()) |
400 | @@ -242,6 +251,36 @@ |
401 | self.assertFalse(self.ui.ui.password_assistance.isVisible()) |
402 | self.assertTrue(self.ui.ui.refresh_label.isVisible()) |
403 | |
404 | + def test_connect_ui(self): |
405 | + """Test the connect ui method.""" |
406 | + self.assertEqual(self.ui.ui.password_edit.receivers( |
407 | + QtCore.SIGNAL("textEdited(const QString&)")), 2) |
408 | + self.assertEqual(self.ui.ui.refresh_label.receivers( |
409 | + QtCore.SIGNAL("linkActivated(const QString&)")), 2) |
410 | + self.assertEqual(self.ui.ui.name_edit.receivers( |
411 | + QtCore.SIGNAL("textEdited(const QString&)")), 1) |
412 | + self.assertEqual(self.ui.ui.email_edit.receivers( |
413 | + QtCore.SIGNAL("textEdited(const QString&)")), 1) |
414 | + self.assertEqual(self.ui.ui.confirm_email_edit.receivers( |
415 | + QtCore.SIGNAL("textEdited(const QString&)")), 1) |
416 | + self.assertEqual(self.ui.ui.password_edit.receivers( |
417 | + QtCore.SIGNAL("textEdited(const QString&)")), 2) |
418 | + self.assertEqual(self.ui.ui.confirm_password_edit.receivers( |
419 | + QtCore.SIGNAL("textEdited(const QString&)")), 1) |
420 | + self.assertEqual(self.ui.ui.sign_in_label.receivers( |
421 | + QtCore.SIGNAL("linkActivated(const QString&)")), 1) |
422 | + |
423 | + def test_connect_ui_2(self): |
424 | + """Test more connections from connect_ui""" |
425 | + |
426 | + # |
427 | + self.assertEqual(self.ui.ui.captcha_solution_edit.receivers( |
428 | + QtCore.SIGNAL("textEdited(const QString&)")), 1) |
429 | + self.assertEqual(self.ui.terms_checkbox.receivers( |
430 | + QtCore.SIGNAL("stateChanged(bool)")), 1) |
431 | + |
432 | + test_connect_ui_2.skip = "These oscilate 0/1 (LP:1046885)" |
433 | + |
434 | def test_set_up_button_clicked(self): |
435 | """Validation and overlay is shown when the setupbutton is clicked.""" |
436 | self.patch(self.ui, 'set_next_validation', self._set_called) |
437 | |
438 | === modified file 'ubuntu_sso/qt/ubuntu_sso_wizard.py' |
439 | --- ubuntu_sso/qt/ubuntu_sso_wizard.py 2012-07-03 16:31:45 +0000 |
440 | +++ ubuntu_sso/qt/ubuntu_sso_wizard.py 2012-09-06 15:23:20 +0000 |
441 | @@ -96,11 +96,13 @@ |
442 | self.addPage(self.network_page) |
443 | |
444 | # set the diff pages of the QWizard |
445 | - if not self.login_only: |
446 | - self.setup_account = SetupAccountPage(**kwargs) |
447 | - self.setup_account.userRegistered.connect( |
448 | - self._move_to_email_verification_page) |
449 | - self.addPage(self.setup_account) |
450 | + self.setup_account = SetupAccountPage(**kwargs) |
451 | + self.setup_account.userRegistered.connect( |
452 | + self._move_to_email_verification_page) |
453 | + # There are no tests for signal connections on |
454 | + # this file (LP:1046886) |
455 | + self.setup_account.signIn.connect(self._move_to_login_page) |
456 | + self.addPage(self.setup_account) |
457 | |
458 | self.current_user = CurrentUserSignInPage(**kwargs) |
459 | self.current_user.userNotValidated.connect( |
460 | @@ -108,6 +110,8 @@ |
461 | self.current_user.userLoggedIn.connect(self._move_to_success_page) |
462 | self.current_user.passwordForgotten.connect( |
463 | self._move_to_forgotten_page) |
464 | + self.current_user.createAccount.connect( |
465 | + self._move_to_setup_account_page) |
466 | self.addPage(self.current_user) |
467 | |
468 | self.email_verification = EmailVerificationPage(**kwargs) |
469 | @@ -144,6 +148,12 @@ |
470 | self.setMinimumSize(PREFERED_UI_SIZE['width'], |
471 | PREFERED_UI_SIZE['height']) |
472 | |
473 | + # This is missing tests (LP:1046887) |
474 | + if self.login_only: |
475 | + self._move_to_login_page() |
476 | + else: |
477 | + self._move_to_setup_account_page() |
478 | + |
479 | @defer.inlineCallbacks |
480 | def check_network_connection(self): |
481 | """Check if the NetworkDetectionPage is needed to be shown.""" |
482 | @@ -213,17 +223,15 @@ |
483 | """Move to the setup account page wizard.""" |
484 | logger.debug('Moving to SetupAccountPage from: %s', |
485 | self.currentPage()) |
486 | - self._next_id = self.setup_account_page_id |
487 | - self.next() |
488 | - self._next_id = -1 |
489 | + self.setStartId(self.setup_account_page_id) |
490 | + self.restart() |
491 | |
492 | def _move_to_login_page(self): |
493 | """Move to the login page wizard.""" |
494 | logger.debug('Moving to CurrentUserSignInPage from: %s', |
495 | self.currentPage()) |
496 | - self._next_id = self.current_user_page_id |
497 | - self.next() |
498 | - self._next_id = -1 |
499 | + self.setStartId(self.current_user_page_id) |
500 | + self.restart() |
501 | |
502 | def _move_to_success_page(self): |
503 | """Move to the success page wizard.""" |
504 | |
505 | === modified file 'ubuntu_sso/utils/ui.py' |
506 | --- ubuntu_sso/utils/ui.py 2012-08-14 16:30:09 +0000 |
507 | +++ ubuntu_sso/utils/ui.py 2012-09-06 15:23:20 +0000 |
508 | @@ -64,6 +64,7 @@ |
509 | CONGRATULATIONS = _("Congratulations, {app_name} is installed!") |
510 | CONNECT_HELP_LABEL = _('To connect this computer to %(app_name)s enter your ' |
511 | 'details below.') |
512 | +CREATE_ACCOUNT_LABEL = _('Register with {app_name}.') |
513 | EMAIL_LABEL = EMAIL1_ENTRY = _('Email address') |
514 | EMAIL2_ENTRY = _('Re-type Email address') |
515 | EMAIL_INVALID = _('The email must be a valid email address.') |
516 | @@ -146,6 +147,7 @@ |
517 | SET_UP_ACCOUNT_BUTTON = _('Set Up Account') |
518 | SET_UP_ACCOUNT_CHOICE_BUTTON = _('I don\'t have an account yet - sign me up') |
519 | SIGN_IN_BUTTON = _('Sign In') |
520 | +SIGN_IN_LABEL = _('Log-in with my existing account.') |
521 | SSL_APPNAME_HELP = _('the appname whose ssl error we are going to show.') |
522 | SSL_CERT_DETAILS = _('Certificate details') |
523 | SSL_CONNECT_BUTTON = _('Connect') |
+CREATE_ ACCOUNT_ LABEL = _('Register with Ubuntu One.')
This cannot say "Ubuntu One" here, as this is ubuntu-sso-client. And this is also similar enough to REGISTER_TITLE, that perhaps we should just use it as the label instead? Otherwise, this will need to use the app_name variable, as REGISTER_TITLE does.