Merge lp:~ralsina/ubuntu-sso-client/change-your-mind into lp:ubuntu-sso-client

Proposed by Roberto Alsina
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
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)

To post a comment you must log in.
Revision history for this message
dobey (dobey) wrote :

+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.

review: Needs Fixing
999. By Roberto Alsina

use app_name

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

> +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.

You are correct. Fixed.

Revision history for this message
dobey (dobey) wrote :

+ logger.debug('About to emit passwordForgotten signal')

I suppose this also needs to say 'createAccount signal' instead?

Revision history for this message
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

Revision history for this message
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

Revision history for this message
dobey (dobey) :
review: Approve
1002. By Roberto Alsina

added tests

1003. By Roberto Alsina

added tests

1004. By Roberto Alsina

lint

Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/qt/current_user_sign_in.ui'
--- data/qt/current_user_sign_in.ui 2012-03-05 20:40:24 +0000
+++ data/qt/current_user_sign_in.ui 2012-09-06 15:23:20 +0000
@@ -7,7 +7,7 @@
7 <x>0</x>7 <x>0</x>
8 <y>0</y>8 <y>0</y>
9 <width>302</width>9 <width>302</width>
10 <height>244</height>10 <height>295</height>
11 </rect>11 </rect>
12 </property>12 </property>
13 <layout class="QVBoxLayout" name="verticalLayout_2">13 <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -18,6 +18,13 @@
18 <number>0</number>18 <number>0</number>
19 </property>19 </property>
20 <item>20 <item>
21 <widget class="QLabel" name="create_account_label">
22 <property name="text">
23 <string>Register with {app_name}.</string>
24 </property>
25 </widget>
26 </item>
27 <item>
21 <layout class="QVBoxLayout" name="verticalLayout">28 <layout class="QVBoxLayout" name="verticalLayout">
22 <property name="spacing">29 <property name="spacing">
23 <number>3</number>30 <number>3</number>
@@ -140,6 +147,7 @@
140 <zorder>verticalSpacer</zorder>147 <zorder>verticalSpacer</zorder>
141 <zorder>forgot_password_label</zorder>148 <zorder>forgot_password_label</zorder>
142 <zorder></zorder>149 <zorder></zorder>
150 <zorder>create_account_label</zorder>
143 </widget>151 </widget>
144 <resources/>152 <resources/>
145 <connections>153 <connections>
146154
=== modified file 'data/qt/setup_account.ui'
--- data/qt/setup_account.ui 2012-03-20 15:05:19 +0000
+++ data/qt/setup_account.ui 2012-09-06 15:23:20 +0000
@@ -37,7 +37,7 @@
37 <property name="verticalSpacing">37 <property name="verticalSpacing">
38 <number>6</number>38 <number>6</number>
39 </property>39 </property>
40 <item row="4" column="0" colspan="2">40 <item row="5" column="0" colspan="2">
41 <spacer name="verticalSpacer_2">41 <spacer name="verticalSpacer_2">
42 <property name="orientation">42 <property name="orientation">
43 <enum>Qt::Vertical</enum>43 <enum>Qt::Vertical</enum>
@@ -50,7 +50,7 @@
50 </property>50 </property>
51 </spacer>51 </spacer>
52 </item>52 </item>
53 <item row="10" column="0" colspan="2">53 <item row="11" column="0" colspan="2">
54 <spacer name="verticalSpacer_3">54 <spacer name="verticalSpacer_3">
55 <property name="orientation">55 <property name="orientation">
56 <enum>Qt::Vertical</enum>56 <enum>Qt::Vertical</enum>
@@ -63,7 +63,7 @@
63 </property>63 </property>
64 </spacer>64 </spacer>
65 </item>65 </item>
66 <item row="7" column="0" colspan="2">66 <item row="8" column="0" colspan="2">
67 <spacer name="verticalSpacer_4">67 <spacer name="verticalSpacer_4">
68 <property name="orientation">68 <property name="orientation">
69 <enum>Qt::Vertical</enum>69 <enum>Qt::Vertical</enum>
@@ -76,7 +76,7 @@
76 </property>76 </property>
77 </spacer>77 </spacer>
78 </item>78 </item>
79 <item row="0" column="0">79 <item row="1" column="0">
80 <layout class="QVBoxLayout" name="verticalLayout_5">80 <layout class="QVBoxLayout" name="verticalLayout_5">
81 <property name="spacing">81 <property name="spacing">
82 <number>3</number>82 <number>3</number>
@@ -85,6 +85,7 @@
85 <widget class="QLabel" name="name_label">85 <widget class="QLabel" name="name_label">
86 <property name="font">86 <property name="font">
87 <font>87 <font>
88 <weight>75</weight>
88 <bold>true</bold>89 <bold>true</bold>
89 </font>90 </font>
90 </property>91 </property>
@@ -120,7 +121,7 @@
120 </item>121 </item>
121 </layout>122 </layout>
122 </item>123 </item>
123 <item row="2" column="0">124 <item row="3" column="0">
124 <layout class="QVBoxLayout" name="verticalLayout_6">125 <layout class="QVBoxLayout" name="verticalLayout_6">
125 <property name="spacing">126 <property name="spacing">
126 <number>3</number>127 <number>3</number>
@@ -129,6 +130,7 @@
129 <widget class="QLabel" name="email_label">130 <widget class="QLabel" name="email_label">
130 <property name="font">131 <property name="font">
131 <font>132 <font>
133 <weight>75</weight>
132 <bold>true</bold>134 <bold>true</bold>
133 </font>135 </font>
134 </property>136 </property>
@@ -167,7 +169,7 @@
167 </item>169 </item>
168 </layout>170 </layout>
169 </item>171 </item>
170 <item row="2" column="1">172 <item row="3" column="1">
171 <layout class="QVBoxLayout" name="verticalLayout_8">173 <layout class="QVBoxLayout" name="verticalLayout_8">
172 <property name="spacing">174 <property name="spacing">
173 <number>0</number>175 <number>0</number>
@@ -208,7 +210,7 @@
208 </item>210 </item>
209 </layout>211 </layout>
210 </item>212 </item>
211 <item row="3" column="0">213 <item row="4" column="0">
212 <layout class="QVBoxLayout" name="verticalLayout_10">214 <layout class="QVBoxLayout" name="verticalLayout_10">
213 <property name="spacing">215 <property name="spacing">
214 <number>3</number>216 <number>3</number>
@@ -217,6 +219,7 @@
217 <widget class="QLabel" name="confirm_email_label">219 <widget class="QLabel" name="confirm_email_label">
218 <property name="font">220 <property name="font">
219 <font>221 <font>
222 <weight>75</weight>
220 <bold>true</bold>223 <bold>true</bold>
221 </font>224 </font>
222 </property>225 </property>
@@ -255,7 +258,7 @@
255 </item>258 </item>
256 </layout>259 </layout>
257 </item>260 </item>
258 <item row="3" column="1">261 <item row="4" column="1">
259 <layout class="QVBoxLayout" name="verticalLayout_9">262 <layout class="QVBoxLayout" name="verticalLayout_9">
260 <property name="spacing">263 <property name="spacing">
261 <number>0</number>264 <number>0</number>
@@ -299,7 +302,7 @@
299 </item>302 </item>
300 </layout>303 </layout>
301 </item>304 </item>
302 <item row="11" column="0" colspan="2">305 <item row="12" column="0" colspan="2">
303 <layout class="QHBoxLayout" name="hlayout_check">306 <layout class="QHBoxLayout" name="hlayout_check">
304 <property name="spacing">307 <property name="spacing">
305 <number>6</number>308 <number>6</number>
@@ -309,7 +312,7 @@
309 </property>312 </property>
310 </layout>313 </layout>
311 </item>314 </item>
312 <item row="0" column="1">315 <item row="1" column="1">
313 <layout class="QVBoxLayout" name="verticalLayout_7">316 <layout class="QVBoxLayout" name="verticalLayout_7">
314 <property name="spacing">317 <property name="spacing">
315 <number>0</number>318 <number>0</number>
@@ -350,7 +353,7 @@
350 </item>353 </item>
351 </layout>354 </layout>
352 </item>355 </item>
353 <item row="5" column="0">356 <item row="6" column="0">
354 <layout class="QVBoxLayout" name="verticalLayout_3">357 <layout class="QVBoxLayout" name="verticalLayout_3">
355 <property name="spacing">358 <property name="spacing">
356 <number>3</number>359 <number>3</number>
@@ -359,6 +362,7 @@
359 <widget class="QLabel" name="password_label">362 <widget class="QLabel" name="password_label">
360 <property name="font">363 <property name="font">
361 <font>364 <font>
365 <weight>75</weight>
362 <bold>true</bold>366 <bold>true</bold>
363 </font>367 </font>
364 </property>368 </property>
@@ -406,7 +410,7 @@
406 </item>410 </item>
407 </layout>411 </layout>
408 </item>412 </item>
409 <item row="5" column="1" rowspan="2">413 <item row="6" column="1" rowspan="2">
410 <layout class="QHBoxLayout" name="horizontalLayout_3">414 <layout class="QHBoxLayout" name="horizontalLayout_3">
411 <property name="spacing">415 <property name="spacing">
412 <number>0</number>416 <number>0</number>
@@ -444,7 +448,7 @@
444 </item>448 </item>
445 </layout>449 </layout>
446 </item>450 </item>
447 <item row="6" column="0">451 <item row="7" column="0">
448 <layout class="QVBoxLayout" name="verticalLayout_2">452 <layout class="QVBoxLayout" name="verticalLayout_2">
449 <property name="spacing">453 <property name="spacing">
450 <number>3</number>454 <number>3</number>
@@ -453,6 +457,7 @@
453 <widget class="QLabel" name="confirm_password_label">457 <widget class="QLabel" name="confirm_password_label">
454 <property name="font">458 <property name="font">
455 <font>459 <font>
460 <weight>75</weight>
456 <bold>true</bold>461 <bold>true</bold>
457 </font>462 </font>
458 </property>463 </property>
@@ -494,7 +499,7 @@
494 </item>499 </item>
495 </layout>500 </layout>
496 </item>501 </item>
497 <item row="8" column="0">502 <item row="9" column="0">
498 <layout class="QVBoxLayout" name="verticalLayout_4">503 <layout class="QVBoxLayout" name="verticalLayout_4">
499 <property name="spacing">504 <property name="spacing">
500 <number>3</number>505 <number>3</number>
@@ -569,7 +574,7 @@
569 </item>574 </item>
570 </layout>575 </layout>
571 </item>576 </item>
572 <item row="1" column="0" colspan="2">577 <item row="2" column="0" colspan="2">
573 <spacer name="verticalSpacer">578 <spacer name="verticalSpacer">
574 <property name="orientation">579 <property name="orientation">
575 <enum>Qt::Vertical</enum>580 <enum>Qt::Vertical</enum>
@@ -582,7 +587,7 @@
582 </property>587 </property>
583 </spacer>588 </spacer>
584 </item>589 </item>
585 <item row="8" column="1">590 <item row="9" column="1">
586 <layout class="QVBoxLayout" name="verticalLayout_13">591 <layout class="QVBoxLayout" name="verticalLayout_13">
587 <property name="rightMargin">592 <property name="rightMargin">
588 <number>0</number>593 <number>0</number>
@@ -617,6 +622,13 @@
617 </item>622 </item>
618 </layout>623 </layout>
619 </item>624 </item>
625 <item row="0" column="0">
626 <widget class="QLabel" name="sign_in_label">
627 <property name="text">
628 <string>Log-in with my existing account.</string>
629 </property>
630 </widget>
631 </item>
620 </layout>632 </layout>
621 </item>633 </item>
622 </layout>634 </layout>
623635
=== modified file 'ubuntu_sso/qt/current_user_sign_in_page.py'
--- ubuntu_sso/qt/current_user_sign_in_page.py 2012-07-03 15:48:59 +0000
+++ ubuntu_sso/qt/current_user_sign_in_page.py 2012-09-06 15:23:20 +0000
@@ -40,6 +40,7 @@
40from ubuntu_sso.utils import compat40from ubuntu_sso.utils import compat
41from ubuntu_sso.utils.ui import (41from ubuntu_sso.utils.ui import (
42 CANCEL_BUTTON,42 CANCEL_BUTTON,
43 CREATE_ACCOUNT_LABEL,
43 EMAIL_LABEL,44 EMAIL_LABEL,
44 FORGOTTEN_PASSWORD_BUTTON,45 FORGOTTEN_PASSWORD_BUTTON,
45 is_correct_email,46 is_correct_email,
@@ -59,6 +60,7 @@
59 ui_class = Ui_CurrentUserSignInPage60 ui_class = Ui_CurrentUserSignInPage
60 userLoggedIn = QtCore.pyqtSignal(compat.text_type)61 userLoggedIn = QtCore.pyqtSignal(compat.text_type)
61 passwordForgotten = QtCore.pyqtSignal()62 passwordForgotten = QtCore.pyqtSignal()
63 createAccount = QtCore.pyqtSignal()
62 userNotValidated = QtCore.pyqtSignal(compat.text_type)64 userNotValidated = QtCore.pyqtSignal(compat.text_type)
6365
64 @property66 @property
@@ -118,12 +120,17 @@
118 forgotten_text = LINK_STYLE.format(link_url='#',120 forgotten_text = LINK_STYLE.format(link_url='#',
119 link_text=FORGOTTEN_PASSWORD_BUTTON)121 link_text=FORGOTTEN_PASSWORD_BUTTON)
120 self.ui.forgot_password_label.setText(forgotten_text)122 self.ui.forgot_password_label.setText(forgotten_text)
123 account_text = LINK_STYLE.format(link_url='#',
124 link_text=CREATE_ACCOUNT_LABEL % {'app_name': self.app_name})
125 self.ui.create_account_label.setText(account_text)
121 self.ui.sign_in_button.setText(SIGN_IN_BUTTON)126 self.ui.sign_in_button.setText(SIGN_IN_BUTTON)
122127
123 def _connect_ui(self):128 def _connect_ui(self):
124 """Connect the buttons to perform actions."""129 """Connect the buttons to perform actions."""
125 self.ui.forgot_password_label.linkActivated.connect(130 self.ui.forgot_password_label.linkActivated.connect(
126 self.on_forgotten_password)131 self.on_forgotten_password)
132 self.ui.create_account_label.linkActivated.connect(
133 self.on_create_account)
127 self.ui.email_edit.textChanged.connect(self._validate)134 self.ui.email_edit.textChanged.connect(self._validate)
128 self.ui.password_edit.textChanged.connect(self._validate)135 self.ui.password_edit.textChanged.connect(self._validate)
129 self.ui.sign_in_button.clicked.connect(self.login)136 self.ui.sign_in_button.clicked.connect(self.login)
@@ -175,3 +182,9 @@
175 self.hide_overlay()182 self.hide_overlay()
176 logger.debug('About to emit passwordForgotten signal')183 logger.debug('About to emit passwordForgotten signal')
177 self.passwordForgotten.emit()184 self.passwordForgotten.emit()
185
186 def on_create_account(self, link=None):
187 """Show the user the account creation page."""
188 self.hide_overlay()
189 logger.debug('About to emit createAccount signal')
190 self.createAccount.emit()
178191
=== modified file 'ubuntu_sso/qt/setup_account_page.py'
--- ubuntu_sso/qt/setup_account_page.py 2012-08-14 16:27:53 +0000
+++ ubuntu_sso/qt/setup_account_page.py 2012-09-06 15:23:20 +0000
@@ -86,6 +86,7 @@
86 RETYPE_EMAIL,86 RETYPE_EMAIL,
87 RETYPE_PASSWORD,87 RETYPE_PASSWORD,
88 SET_UP_ACCOUNT_BUTTON,88 SET_UP_ACCOUNT_BUTTON,
89 SIGN_IN_LABEL,
89 TERMS_TEXT,90 TERMS_TEXT,
90 REGISTER_TITLE,91 REGISTER_TITLE,
91)92)
@@ -101,6 +102,7 @@
101102
102 ui_class = Ui_SetUpAccountPage103 ui_class = Ui_SetUpAccountPage
103 userRegistered = QtCore.pyqtSignal(compat.text_type)104 userRegistered = QtCore.pyqtSignal(compat.text_type)
105 signIn = QtCore.pyqtSignal()
104106
105 def __init__(self, *args, **kwargs):107 def __init__(self, *args, **kwargs):
106 self.captcha_file = None108 self.captcha_file = None
@@ -176,6 +178,9 @@
176 self.setSubTitle(self.help_text)178 self.setSubTitle(self.help_text)
177179
178 self.ui.name_label.setText(NAME_ENTRY)180 self.ui.name_label.setText(NAME_ENTRY)
181 sign_in_link = LINK_STYLE.format(link_url='#',
182 link_text=SIGN_IN_LABEL)
183 self.ui.sign_in_label.setText(sign_in_link)
179 self.ui.email_label.setText(EMAIL1_ENTRY)184 self.ui.email_label.setText(EMAIL1_ENTRY)
180 self.ui.confirm_email_label.setText(EMAIL2_ENTRY)185 self.ui.confirm_email_label.setText(EMAIL2_ENTRY)
181 self.ui.password_label.setText(PASSWORD1_ENTRY)186 self.ui.password_label.setText(PASSWORD1_ENTRY)
@@ -259,6 +264,7 @@
259 self.ui.captcha_solution_edit.textEdited.connect(264 self.ui.captcha_solution_edit.textEdited.connect(
260 self._enable_setup_button)265 self._enable_setup_button)
261 self.terms_checkbox.stateChanged.connect(self._enable_setup_button)266 self.terms_checkbox.stateChanged.connect(self._enable_setup_button)
267 self.ui.sign_in_label.linkActivated.connect(self.signIn)
262268
263 self._refresh_captcha()269 self._refresh_captcha()
264270
265271
=== modified file 'ubuntu_sso/qt/tests/test_current_user_sign_in_page.py'
--- ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-07-03 19:13:54 +0000
+++ ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-09-06 15:23:20 +0000
@@ -48,7 +48,8 @@
48 """Test the SetupAccountPage code."""48 """Test the SetupAccountPage code."""
4949
50 ui_class = gui.CurrentUserSignInPage50 ui_class = gui.CurrentUserSignInPage
51 ui_signals = ('userLoggedIn', 'passwordForgotten', 'userNotValidated')51 ui_signals = ('userLoggedIn', 'passwordForgotten', 'userNotValidated',
52 'createAccount')
52 ui_backend_signals = ('LoggedIn', 'LoginError', 'UserNotValidated')53 ui_backend_signals = ('LoggedIn', 'LoginError', 'UserNotValidated')
5354
54 def test_initialize_page(self):55 def test_initialize_page(self):
@@ -86,6 +87,10 @@
86 self.assert_subtitle_correct(expected)87 self.assert_subtitle_correct(expected)
87 self.assertEqual(compat.text_type(self.ui.ui.email_label.text()),88 self.assertEqual(compat.text_type(self.ui.ui.email_label.text()),
88 gui.EMAIL_LABEL)89 gui.EMAIL_LABEL)
90 expected = gui.LINK_STYLE.format(link_url='#',
91 link_text=gui.CREATE_ACCOUNT_LABEL % {'app_name': self.app_name})
92 self.assertEqual(compat.text_type(
93 self.ui.ui.create_account_label.text()), expected)
89 self.assertEqual(compat.text_type(self.ui.ui.password_label.text()),94 self.assertEqual(compat.text_type(self.ui.ui.password_label.text()),
90 gui.LOGIN_PASSWORD_LABEL)95 gui.LOGIN_PASSWORD_LABEL)
91 text = gui.LINK_STYLE.format(link_url='#',96 text = gui.LINK_STYLE.format(link_url='#',
@@ -107,6 +112,8 @@
107 QtCore.SIGNAL("textChanged(const QString&)")), 1)112 QtCore.SIGNAL("textChanged(const QString&)")), 1)
108 self.assertEqual(self.ui.ui.sign_in_button.receivers(113 self.assertEqual(self.ui.ui.sign_in_button.receivers(
109 QtCore.SIGNAL("clicked()")), 1)114 QtCore.SIGNAL("clicked()")), 1)
115 self.assertEqual(self.ui.ui.create_account_label.receivers(
116 QtCore.SIGNAL("linkActivated(const QString&)")), 1)
110117
111 def test_validate_not_valid(self):118 def test_validate_not_valid(self):
112 """Test validate method."""119 """Test validate method."""
@@ -191,3 +198,13 @@
191 """Forgotten passsword clicked emits passwordForgotten signal."""198 """Forgotten passsword clicked emits passwordForgotten signal."""
192 self.assert_signal_emitted(self.ui.passwordForgotten, (),199 self.assert_signal_emitted(self.ui.passwordForgotten, (),
193 self.ui.ui.forgot_password_label.linkActivated.emit, "link")200 self.ui.ui.forgot_password_label.linkActivated.emit, "link")
201
202 def test_on_create_account(self):
203 """Test the on_create_account method."""
204 self.assert_signal_emitted(self.ui.createAccount, (),
205 self.ui.on_create_account)
206
207 def test_on_create_account_link_clicked(self):
208 """Create account clicked emits createAccount signal."""
209 self.assert_signal_emitted(self.ui.createAccount, (),
210 self.ui.ui.create_account_label.linkActivated.emit, "link")
194211
=== modified file 'ubuntu_sso/qt/tests/test_setup_account.py'
--- ubuntu_sso/qt/tests/test_setup_account.py 2012-08-14 23:15:15 +0000
+++ ubuntu_sso/qt/tests/test_setup_account.py 2012-09-06 15:23:20 +0000
@@ -41,7 +41,7 @@
41 """Test the SetupAccountPage code."""41 """Test the SetupAccountPage code."""
4242
43 ui_class = gui.SetupAccountPage43 ui_class = gui.SetupAccountPage
44 ui_signals = ('userRegistered',)44 ui_signals = ('userRegistered', 'signIn')
45 ui_backend_signals = ('CaptchaGenerated', 'CaptchaGenerationError',45 ui_backend_signals = ('CaptchaGenerated', 'CaptchaGenerationError',
46 'UserRegistered', 'UserRegistrationError')46 'UserRegistered', 'UserRegistrationError')
4747
@@ -234,6 +234,15 @@
234 self.assertEqual(234 self.assertEqual(
235 compat.text_type(self.ui.ui.confirm_password_label.text()),235 compat.text_type(self.ui.ui.confirm_password_label.text()),
236 gui.RETYPE_PASSWORD)236 gui.RETYPE_PASSWORD)
237 expected = gui.LINK_STYLE.format(link_url='#',
238 link_text=gui.SIGN_IN_LABEL)
239 self.assertEqual(
240 compat.text_type(self.ui.ui.sign_in_label.text()),
241 expected)
242
243 # connections
244 self.assertEqual(self.ui.set_up_button.receivers(
245 QtCore.SIGNAL("clicked(const bool)")), 1)
237246
238 # assistants247 # assistants
239 self.assertFalse(self.ui.ui.name_assistance.isVisible())248 self.assertFalse(self.ui.ui.name_assistance.isVisible())
@@ -242,6 +251,36 @@
242 self.assertFalse(self.ui.ui.password_assistance.isVisible())251 self.assertFalse(self.ui.ui.password_assistance.isVisible())
243 self.assertTrue(self.ui.ui.refresh_label.isVisible())252 self.assertTrue(self.ui.ui.refresh_label.isVisible())
244253
254 def test_connect_ui(self):
255 """Test the connect ui method."""
256 self.assertEqual(self.ui.ui.password_edit.receivers(
257 QtCore.SIGNAL("textEdited(const QString&)")), 2)
258 self.assertEqual(self.ui.ui.refresh_label.receivers(
259 QtCore.SIGNAL("linkActivated(const QString&)")), 2)
260 self.assertEqual(self.ui.ui.name_edit.receivers(
261 QtCore.SIGNAL("textEdited(const QString&)")), 1)
262 self.assertEqual(self.ui.ui.email_edit.receivers(
263 QtCore.SIGNAL("textEdited(const QString&)")), 1)
264 self.assertEqual(self.ui.ui.confirm_email_edit.receivers(
265 QtCore.SIGNAL("textEdited(const QString&)")), 1)
266 self.assertEqual(self.ui.ui.password_edit.receivers(
267 QtCore.SIGNAL("textEdited(const QString&)")), 2)
268 self.assertEqual(self.ui.ui.confirm_password_edit.receivers(
269 QtCore.SIGNAL("textEdited(const QString&)")), 1)
270 self.assertEqual(self.ui.ui.sign_in_label.receivers(
271 QtCore.SIGNAL("linkActivated(const QString&)")), 1)
272
273 def test_connect_ui_2(self):
274 """Test more connections from connect_ui"""
275
276 #
277 self.assertEqual(self.ui.ui.captcha_solution_edit.receivers(
278 QtCore.SIGNAL("textEdited(const QString&)")), 1)
279 self.assertEqual(self.ui.terms_checkbox.receivers(
280 QtCore.SIGNAL("stateChanged(bool)")), 1)
281
282 test_connect_ui_2.skip = "These oscilate 0/1 (LP:1046885)"
283
245 def test_set_up_button_clicked(self):284 def test_set_up_button_clicked(self):
246 """Validation and overlay is shown when the setupbutton is clicked."""285 """Validation and overlay is shown when the setupbutton is clicked."""
247 self.patch(self.ui, 'set_next_validation', self._set_called)286 self.patch(self.ui, 'set_next_validation', self._set_called)
248287
=== modified file 'ubuntu_sso/qt/ubuntu_sso_wizard.py'
--- ubuntu_sso/qt/ubuntu_sso_wizard.py 2012-07-03 16:31:45 +0000
+++ ubuntu_sso/qt/ubuntu_sso_wizard.py 2012-09-06 15:23:20 +0000
@@ -96,11 +96,13 @@
96 self.addPage(self.network_page)96 self.addPage(self.network_page)
9797
98 # set the diff pages of the QWizard98 # set the diff pages of the QWizard
99 if not self.login_only:99 self.setup_account = SetupAccountPage(**kwargs)
100 self.setup_account = SetupAccountPage(**kwargs)100 self.setup_account.userRegistered.connect(
101 self.setup_account.userRegistered.connect(101 self._move_to_email_verification_page)
102 self._move_to_email_verification_page)102 # There are no tests for signal connections on
103 self.addPage(self.setup_account)103 # this file (LP:1046886)
104 self.setup_account.signIn.connect(self._move_to_login_page)
105 self.addPage(self.setup_account)
104106
105 self.current_user = CurrentUserSignInPage(**kwargs)107 self.current_user = CurrentUserSignInPage(**kwargs)
106 self.current_user.userNotValidated.connect(108 self.current_user.userNotValidated.connect(
@@ -108,6 +110,8 @@
108 self.current_user.userLoggedIn.connect(self._move_to_success_page)110 self.current_user.userLoggedIn.connect(self._move_to_success_page)
109 self.current_user.passwordForgotten.connect(111 self.current_user.passwordForgotten.connect(
110 self._move_to_forgotten_page)112 self._move_to_forgotten_page)
113 self.current_user.createAccount.connect(
114 self._move_to_setup_account_page)
111 self.addPage(self.current_user)115 self.addPage(self.current_user)
112116
113 self.email_verification = EmailVerificationPage(**kwargs)117 self.email_verification = EmailVerificationPage(**kwargs)
@@ -144,6 +148,12 @@
144 self.setMinimumSize(PREFERED_UI_SIZE['width'],148 self.setMinimumSize(PREFERED_UI_SIZE['width'],
145 PREFERED_UI_SIZE['height'])149 PREFERED_UI_SIZE['height'])
146150
151 # This is missing tests (LP:1046887)
152 if self.login_only:
153 self._move_to_login_page()
154 else:
155 self._move_to_setup_account_page()
156
147 @defer.inlineCallbacks157 @defer.inlineCallbacks
148 def check_network_connection(self):158 def check_network_connection(self):
149 """Check if the NetworkDetectionPage is needed to be shown."""159 """Check if the NetworkDetectionPage is needed to be shown."""
@@ -213,17 +223,15 @@
213 """Move to the setup account page wizard."""223 """Move to the setup account page wizard."""
214 logger.debug('Moving to SetupAccountPage from: %s',224 logger.debug('Moving to SetupAccountPage from: %s',
215 self.currentPage())225 self.currentPage())
216 self._next_id = self.setup_account_page_id226 self.setStartId(self.setup_account_page_id)
217 self.next()227 self.restart()
218 self._next_id = -1
219228
220 def _move_to_login_page(self):229 def _move_to_login_page(self):
221 """Move to the login page wizard."""230 """Move to the login page wizard."""
222 logger.debug('Moving to CurrentUserSignInPage from: %s',231 logger.debug('Moving to CurrentUserSignInPage from: %s',
223 self.currentPage())232 self.currentPage())
224 self._next_id = self.current_user_page_id233 self.setStartId(self.current_user_page_id)
225 self.next()234 self.restart()
226 self._next_id = -1
227235
228 def _move_to_success_page(self):236 def _move_to_success_page(self):
229 """Move to the success page wizard."""237 """Move to the success page wizard."""
230238
=== modified file 'ubuntu_sso/utils/ui.py'
--- ubuntu_sso/utils/ui.py 2012-08-14 16:30:09 +0000
+++ ubuntu_sso/utils/ui.py 2012-09-06 15:23:20 +0000
@@ -64,6 +64,7 @@
64CONGRATULATIONS = _("Congratulations, {app_name} is installed!")64CONGRATULATIONS = _("Congratulations, {app_name} is installed!")
65CONNECT_HELP_LABEL = _('To connect this computer to %(app_name)s enter your '65CONNECT_HELP_LABEL = _('To connect this computer to %(app_name)s enter your '
66 'details below.')66 'details below.')
67CREATE_ACCOUNT_LABEL = _('Register with {app_name}.')
67EMAIL_LABEL = EMAIL1_ENTRY = _('Email address')68EMAIL_LABEL = EMAIL1_ENTRY = _('Email address')
68EMAIL2_ENTRY = _('Re-type Email address')69EMAIL2_ENTRY = _('Re-type Email address')
69EMAIL_INVALID = _('The email must be a valid email address.')70EMAIL_INVALID = _('The email must be a valid email address.')
@@ -146,6 +147,7 @@
146SET_UP_ACCOUNT_BUTTON = _('Set Up Account')147SET_UP_ACCOUNT_BUTTON = _('Set Up Account')
147SET_UP_ACCOUNT_CHOICE_BUTTON = _('I don\'t have an account yet - sign me up')148SET_UP_ACCOUNT_CHOICE_BUTTON = _('I don\'t have an account yet - sign me up')
148SIGN_IN_BUTTON = _('Sign In')149SIGN_IN_BUTTON = _('Sign In')
150SIGN_IN_LABEL = _('Log-in with my existing account.')
149SSL_APPNAME_HELP = _('the appname whose ssl error we are going to show.')151SSL_APPNAME_HELP = _('the appname whose ssl error we are going to show.')
150SSL_CERT_DETAILS = _('Certificate details')152SSL_CERT_DETAILS = _('Certificate details')
151SSL_CONNECT_BUTTON = _('Connect')153SSL_CONNECT_BUTTON = _('Connect')

Subscribers

People subscribed via source and target branches