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 | 7 | <x>0</x> | 7 | <x>0</x> |
6 | 8 | <y>0</y> | 8 | <y>0</y> |
7 | 9 | <width>302</width> | 9 | <width>302</width> |
9 | 10 | <height>244</height> | 10 | <height>295</height> |
10 | 11 | </rect> | 11 | </rect> |
11 | 12 | </property> | 12 | </property> |
12 | 13 | <layout class="QVBoxLayout" name="verticalLayout_2"> | 13 | <layout class="QVBoxLayout" name="verticalLayout_2"> |
13 | @@ -18,6 +18,13 @@ | |||
14 | 18 | <number>0</number> | 18 | <number>0</number> |
15 | 19 | </property> | 19 | </property> |
16 | 20 | <item> | 20 | <item> |
17 | 21 | <widget class="QLabel" name="create_account_label"> | ||
18 | 22 | <property name="text"> | ||
19 | 23 | <string>Register with {app_name}.</string> | ||
20 | 24 | </property> | ||
21 | 25 | </widget> | ||
22 | 26 | </item> | ||
23 | 27 | <item> | ||
24 | 21 | <layout class="QVBoxLayout" name="verticalLayout"> | 28 | <layout class="QVBoxLayout" name="verticalLayout"> |
25 | 22 | <property name="spacing"> | 29 | <property name="spacing"> |
26 | 23 | <number>3</number> | 30 | <number>3</number> |
27 | @@ -140,6 +147,7 @@ | |||
28 | 140 | <zorder>verticalSpacer</zorder> | 147 | <zorder>verticalSpacer</zorder> |
29 | 141 | <zorder>forgot_password_label</zorder> | 148 | <zorder>forgot_password_label</zorder> |
30 | 142 | <zorder></zorder> | 149 | <zorder></zorder> |
31 | 150 | <zorder>create_account_label</zorder> | ||
32 | 143 | </widget> | 151 | </widget> |
33 | 144 | <resources/> | 152 | <resources/> |
34 | 145 | <connections> | 153 | <connections> |
35 | 146 | 154 | ||
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 | 37 | <property name="verticalSpacing"> | 37 | <property name="verticalSpacing"> |
41 | 38 | <number>6</number> | 38 | <number>6</number> |
42 | 39 | </property> | 39 | </property> |
44 | 40 | <item row="4" column="0" colspan="2"> | 40 | <item row="5" column="0" colspan="2"> |
45 | 41 | <spacer name="verticalSpacer_2"> | 41 | <spacer name="verticalSpacer_2"> |
46 | 42 | <property name="orientation"> | 42 | <property name="orientation"> |
47 | 43 | <enum>Qt::Vertical</enum> | 43 | <enum>Qt::Vertical</enum> |
48 | @@ -50,7 +50,7 @@ | |||
49 | 50 | </property> | 50 | </property> |
50 | 51 | </spacer> | 51 | </spacer> |
51 | 52 | </item> | 52 | </item> |
53 | 53 | <item row="10" column="0" colspan="2"> | 53 | <item row="11" column="0" colspan="2"> |
54 | 54 | <spacer name="verticalSpacer_3"> | 54 | <spacer name="verticalSpacer_3"> |
55 | 55 | <property name="orientation"> | 55 | <property name="orientation"> |
56 | 56 | <enum>Qt::Vertical</enum> | 56 | <enum>Qt::Vertical</enum> |
57 | @@ -63,7 +63,7 @@ | |||
58 | 63 | </property> | 63 | </property> |
59 | 64 | </spacer> | 64 | </spacer> |
60 | 65 | </item> | 65 | </item> |
62 | 66 | <item row="7" column="0" colspan="2"> | 66 | <item row="8" column="0" colspan="2"> |
63 | 67 | <spacer name="verticalSpacer_4"> | 67 | <spacer name="verticalSpacer_4"> |
64 | 68 | <property name="orientation"> | 68 | <property name="orientation"> |
65 | 69 | <enum>Qt::Vertical</enum> | 69 | <enum>Qt::Vertical</enum> |
66 | @@ -76,7 +76,7 @@ | |||
67 | 76 | </property> | 76 | </property> |
68 | 77 | </spacer> | 77 | </spacer> |
69 | 78 | </item> | 78 | </item> |
71 | 79 | <item row="0" column="0"> | 79 | <item row="1" column="0"> |
72 | 80 | <layout class="QVBoxLayout" name="verticalLayout_5"> | 80 | <layout class="QVBoxLayout" name="verticalLayout_5"> |
73 | 81 | <property name="spacing"> | 81 | <property name="spacing"> |
74 | 82 | <number>3</number> | 82 | <number>3</number> |
75 | @@ -85,6 +85,7 @@ | |||
76 | 85 | <widget class="QLabel" name="name_label"> | 85 | <widget class="QLabel" name="name_label"> |
77 | 86 | <property name="font"> | 86 | <property name="font"> |
78 | 87 | <font> | 87 | <font> |
79 | 88 | <weight>75</weight> | ||
80 | 88 | <bold>true</bold> | 89 | <bold>true</bold> |
81 | 89 | </font> | 90 | </font> |
82 | 90 | </property> | 91 | </property> |
83 | @@ -120,7 +121,7 @@ | |||
84 | 120 | </item> | 121 | </item> |
85 | 121 | </layout> | 122 | </layout> |
86 | 122 | </item> | 123 | </item> |
88 | 123 | <item row="2" column="0"> | 124 | <item row="3" column="0"> |
89 | 124 | <layout class="QVBoxLayout" name="verticalLayout_6"> | 125 | <layout class="QVBoxLayout" name="verticalLayout_6"> |
90 | 125 | <property name="spacing"> | 126 | <property name="spacing"> |
91 | 126 | <number>3</number> | 127 | <number>3</number> |
92 | @@ -129,6 +130,7 @@ | |||
93 | 129 | <widget class="QLabel" name="email_label"> | 130 | <widget class="QLabel" name="email_label"> |
94 | 130 | <property name="font"> | 131 | <property name="font"> |
95 | 131 | <font> | 132 | <font> |
96 | 133 | <weight>75</weight> | ||
97 | 132 | <bold>true</bold> | 134 | <bold>true</bold> |
98 | 133 | </font> | 135 | </font> |
99 | 134 | </property> | 136 | </property> |
100 | @@ -167,7 +169,7 @@ | |||
101 | 167 | </item> | 169 | </item> |
102 | 168 | </layout> | 170 | </layout> |
103 | 169 | </item> | 171 | </item> |
105 | 170 | <item row="2" column="1"> | 172 | <item row="3" column="1"> |
106 | 171 | <layout class="QVBoxLayout" name="verticalLayout_8"> | 173 | <layout class="QVBoxLayout" name="verticalLayout_8"> |
107 | 172 | <property name="spacing"> | 174 | <property name="spacing"> |
108 | 173 | <number>0</number> | 175 | <number>0</number> |
109 | @@ -208,7 +210,7 @@ | |||
110 | 208 | </item> | 210 | </item> |
111 | 209 | </layout> | 211 | </layout> |
112 | 210 | </item> | 212 | </item> |
114 | 211 | <item row="3" column="0"> | 213 | <item row="4" column="0"> |
115 | 212 | <layout class="QVBoxLayout" name="verticalLayout_10"> | 214 | <layout class="QVBoxLayout" name="verticalLayout_10"> |
116 | 213 | <property name="spacing"> | 215 | <property name="spacing"> |
117 | 214 | <number>3</number> | 216 | <number>3</number> |
118 | @@ -217,6 +219,7 @@ | |||
119 | 217 | <widget class="QLabel" name="confirm_email_label"> | 219 | <widget class="QLabel" name="confirm_email_label"> |
120 | 218 | <property name="font"> | 220 | <property name="font"> |
121 | 219 | <font> | 221 | <font> |
122 | 222 | <weight>75</weight> | ||
123 | 220 | <bold>true</bold> | 223 | <bold>true</bold> |
124 | 221 | </font> | 224 | </font> |
125 | 222 | </property> | 225 | </property> |
126 | @@ -255,7 +258,7 @@ | |||
127 | 255 | </item> | 258 | </item> |
128 | 256 | </layout> | 259 | </layout> |
129 | 257 | </item> | 260 | </item> |
131 | 258 | <item row="3" column="1"> | 261 | <item row="4" column="1"> |
132 | 259 | <layout class="QVBoxLayout" name="verticalLayout_9"> | 262 | <layout class="QVBoxLayout" name="verticalLayout_9"> |
133 | 260 | <property name="spacing"> | 263 | <property name="spacing"> |
134 | 261 | <number>0</number> | 264 | <number>0</number> |
135 | @@ -299,7 +302,7 @@ | |||
136 | 299 | </item> | 302 | </item> |
137 | 300 | </layout> | 303 | </layout> |
138 | 301 | </item> | 304 | </item> |
140 | 302 | <item row="11" column="0" colspan="2"> | 305 | <item row="12" column="0" colspan="2"> |
141 | 303 | <layout class="QHBoxLayout" name="hlayout_check"> | 306 | <layout class="QHBoxLayout" name="hlayout_check"> |
142 | 304 | <property name="spacing"> | 307 | <property name="spacing"> |
143 | 305 | <number>6</number> | 308 | <number>6</number> |
144 | @@ -309,7 +312,7 @@ | |||
145 | 309 | </property> | 312 | </property> |
146 | 310 | </layout> | 313 | </layout> |
147 | 311 | </item> | 314 | </item> |
149 | 312 | <item row="0" column="1"> | 315 | <item row="1" column="1"> |
150 | 313 | <layout class="QVBoxLayout" name="verticalLayout_7"> | 316 | <layout class="QVBoxLayout" name="verticalLayout_7"> |
151 | 314 | <property name="spacing"> | 317 | <property name="spacing"> |
152 | 315 | <number>0</number> | 318 | <number>0</number> |
153 | @@ -350,7 +353,7 @@ | |||
154 | 350 | </item> | 353 | </item> |
155 | 351 | </layout> | 354 | </layout> |
156 | 352 | </item> | 355 | </item> |
158 | 353 | <item row="5" column="0"> | 356 | <item row="6" column="0"> |
159 | 354 | <layout class="QVBoxLayout" name="verticalLayout_3"> | 357 | <layout class="QVBoxLayout" name="verticalLayout_3"> |
160 | 355 | <property name="spacing"> | 358 | <property name="spacing"> |
161 | 356 | <number>3</number> | 359 | <number>3</number> |
162 | @@ -359,6 +362,7 @@ | |||
163 | 359 | <widget class="QLabel" name="password_label"> | 362 | <widget class="QLabel" name="password_label"> |
164 | 360 | <property name="font"> | 363 | <property name="font"> |
165 | 361 | <font> | 364 | <font> |
166 | 365 | <weight>75</weight> | ||
167 | 362 | <bold>true</bold> | 366 | <bold>true</bold> |
168 | 363 | </font> | 367 | </font> |
169 | 364 | </property> | 368 | </property> |
170 | @@ -406,7 +410,7 @@ | |||
171 | 406 | </item> | 410 | </item> |
172 | 407 | </layout> | 411 | </layout> |
173 | 408 | </item> | 412 | </item> |
175 | 409 | <item row="5" column="1" rowspan="2"> | 413 | <item row="6" column="1" rowspan="2"> |
176 | 410 | <layout class="QHBoxLayout" name="horizontalLayout_3"> | 414 | <layout class="QHBoxLayout" name="horizontalLayout_3"> |
177 | 411 | <property name="spacing"> | 415 | <property name="spacing"> |
178 | 412 | <number>0</number> | 416 | <number>0</number> |
179 | @@ -444,7 +448,7 @@ | |||
180 | 444 | </item> | 448 | </item> |
181 | 445 | </layout> | 449 | </layout> |
182 | 446 | </item> | 450 | </item> |
184 | 447 | <item row="6" column="0"> | 451 | <item row="7" column="0"> |
185 | 448 | <layout class="QVBoxLayout" name="verticalLayout_2"> | 452 | <layout class="QVBoxLayout" name="verticalLayout_2"> |
186 | 449 | <property name="spacing"> | 453 | <property name="spacing"> |
187 | 450 | <number>3</number> | 454 | <number>3</number> |
188 | @@ -453,6 +457,7 @@ | |||
189 | 453 | <widget class="QLabel" name="confirm_password_label"> | 457 | <widget class="QLabel" name="confirm_password_label"> |
190 | 454 | <property name="font"> | 458 | <property name="font"> |
191 | 455 | <font> | 459 | <font> |
192 | 460 | <weight>75</weight> | ||
193 | 456 | <bold>true</bold> | 461 | <bold>true</bold> |
194 | 457 | </font> | 462 | </font> |
195 | 458 | </property> | 463 | </property> |
196 | @@ -494,7 +499,7 @@ | |||
197 | 494 | </item> | 499 | </item> |
198 | 495 | </layout> | 500 | </layout> |
199 | 496 | </item> | 501 | </item> |
201 | 497 | <item row="8" column="0"> | 502 | <item row="9" column="0"> |
202 | 498 | <layout class="QVBoxLayout" name="verticalLayout_4"> | 503 | <layout class="QVBoxLayout" name="verticalLayout_4"> |
203 | 499 | <property name="spacing"> | 504 | <property name="spacing"> |
204 | 500 | <number>3</number> | 505 | <number>3</number> |
205 | @@ -569,7 +574,7 @@ | |||
206 | 569 | </item> | 574 | </item> |
207 | 570 | </layout> | 575 | </layout> |
208 | 571 | </item> | 576 | </item> |
210 | 572 | <item row="1" column="0" colspan="2"> | 577 | <item row="2" column="0" colspan="2"> |
211 | 573 | <spacer name="verticalSpacer"> | 578 | <spacer name="verticalSpacer"> |
212 | 574 | <property name="orientation"> | 579 | <property name="orientation"> |
213 | 575 | <enum>Qt::Vertical</enum> | 580 | <enum>Qt::Vertical</enum> |
214 | @@ -582,7 +587,7 @@ | |||
215 | 582 | </property> | 587 | </property> |
216 | 583 | </spacer> | 588 | </spacer> |
217 | 584 | </item> | 589 | </item> |
219 | 585 | <item row="8" column="1"> | 590 | <item row="9" column="1"> |
220 | 586 | <layout class="QVBoxLayout" name="verticalLayout_13"> | 591 | <layout class="QVBoxLayout" name="verticalLayout_13"> |
221 | 587 | <property name="rightMargin"> | 592 | <property name="rightMargin"> |
222 | 588 | <number>0</number> | 593 | <number>0</number> |
223 | @@ -617,6 +622,13 @@ | |||
224 | 617 | </item> | 622 | </item> |
225 | 618 | </layout> | 623 | </layout> |
226 | 619 | </item> | 624 | </item> |
227 | 625 | <item row="0" column="0"> | ||
228 | 626 | <widget class="QLabel" name="sign_in_label"> | ||
229 | 627 | <property name="text"> | ||
230 | 628 | <string>Log-in with my existing account.</string> | ||
231 | 629 | </property> | ||
232 | 630 | </widget> | ||
233 | 631 | </item> | ||
234 | 620 | </layout> | 632 | </layout> |
235 | 621 | </item> | 633 | </item> |
236 | 622 | </layout> | 634 | </layout> |
237 | 623 | 635 | ||
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 | 40 | from ubuntu_sso.utils import compat | 40 | from ubuntu_sso.utils import compat |
243 | 41 | from ubuntu_sso.utils.ui import ( | 41 | from ubuntu_sso.utils.ui import ( |
244 | 42 | CANCEL_BUTTON, | 42 | CANCEL_BUTTON, |
245 | 43 | CREATE_ACCOUNT_LABEL, | ||
246 | 43 | EMAIL_LABEL, | 44 | EMAIL_LABEL, |
247 | 44 | FORGOTTEN_PASSWORD_BUTTON, | 45 | FORGOTTEN_PASSWORD_BUTTON, |
248 | 45 | is_correct_email, | 46 | is_correct_email, |
249 | @@ -59,6 +60,7 @@ | |||
250 | 59 | ui_class = Ui_CurrentUserSignInPage | 60 | ui_class = Ui_CurrentUserSignInPage |
251 | 60 | userLoggedIn = QtCore.pyqtSignal(compat.text_type) | 61 | userLoggedIn = QtCore.pyqtSignal(compat.text_type) |
252 | 61 | passwordForgotten = QtCore.pyqtSignal() | 62 | passwordForgotten = QtCore.pyqtSignal() |
253 | 63 | createAccount = QtCore.pyqtSignal() | ||
254 | 62 | userNotValidated = QtCore.pyqtSignal(compat.text_type) | 64 | userNotValidated = QtCore.pyqtSignal(compat.text_type) |
255 | 63 | 65 | ||
256 | 64 | @property | 66 | @property |
257 | @@ -118,12 +120,17 @@ | |||
258 | 118 | forgotten_text = LINK_STYLE.format(link_url='#', | 120 | forgotten_text = LINK_STYLE.format(link_url='#', |
259 | 119 | link_text=FORGOTTEN_PASSWORD_BUTTON) | 121 | link_text=FORGOTTEN_PASSWORD_BUTTON) |
260 | 120 | self.ui.forgot_password_label.setText(forgotten_text) | 122 | self.ui.forgot_password_label.setText(forgotten_text) |
261 | 123 | account_text = LINK_STYLE.format(link_url='#', | ||
262 | 124 | link_text=CREATE_ACCOUNT_LABEL % {'app_name': self.app_name}) | ||
263 | 125 | self.ui.create_account_label.setText(account_text) | ||
264 | 121 | self.ui.sign_in_button.setText(SIGN_IN_BUTTON) | 126 | self.ui.sign_in_button.setText(SIGN_IN_BUTTON) |
265 | 122 | 127 | ||
266 | 123 | def _connect_ui(self): | 128 | def _connect_ui(self): |
267 | 124 | """Connect the buttons to perform actions.""" | 129 | """Connect the buttons to perform actions.""" |
268 | 125 | self.ui.forgot_password_label.linkActivated.connect( | 130 | self.ui.forgot_password_label.linkActivated.connect( |
269 | 126 | self.on_forgotten_password) | 131 | self.on_forgotten_password) |
270 | 132 | self.ui.create_account_label.linkActivated.connect( | ||
271 | 133 | self.on_create_account) | ||
272 | 127 | self.ui.email_edit.textChanged.connect(self._validate) | 134 | self.ui.email_edit.textChanged.connect(self._validate) |
273 | 128 | self.ui.password_edit.textChanged.connect(self._validate) | 135 | self.ui.password_edit.textChanged.connect(self._validate) |
274 | 129 | self.ui.sign_in_button.clicked.connect(self.login) | 136 | self.ui.sign_in_button.clicked.connect(self.login) |
275 | @@ -175,3 +182,9 @@ | |||
276 | 175 | self.hide_overlay() | 182 | self.hide_overlay() |
277 | 176 | logger.debug('About to emit passwordForgotten signal') | 183 | logger.debug('About to emit passwordForgotten signal') |
278 | 177 | self.passwordForgotten.emit() | 184 | self.passwordForgotten.emit() |
279 | 185 | |||
280 | 186 | def on_create_account(self, link=None): | ||
281 | 187 | """Show the user the account creation page.""" | ||
282 | 188 | self.hide_overlay() | ||
283 | 189 | logger.debug('About to emit createAccount signal') | ||
284 | 190 | self.createAccount.emit() | ||
285 | 178 | 191 | ||
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 | 86 | RETYPE_EMAIL, | 86 | RETYPE_EMAIL, |
291 | 87 | RETYPE_PASSWORD, | 87 | RETYPE_PASSWORD, |
292 | 88 | SET_UP_ACCOUNT_BUTTON, | 88 | SET_UP_ACCOUNT_BUTTON, |
293 | 89 | SIGN_IN_LABEL, | ||
294 | 89 | TERMS_TEXT, | 90 | TERMS_TEXT, |
295 | 90 | REGISTER_TITLE, | 91 | REGISTER_TITLE, |
296 | 91 | ) | 92 | ) |
297 | @@ -101,6 +102,7 @@ | |||
298 | 101 | 102 | ||
299 | 102 | ui_class = Ui_SetUpAccountPage | 103 | ui_class = Ui_SetUpAccountPage |
300 | 103 | userRegistered = QtCore.pyqtSignal(compat.text_type) | 104 | userRegistered = QtCore.pyqtSignal(compat.text_type) |
301 | 105 | signIn = QtCore.pyqtSignal() | ||
302 | 104 | 106 | ||
303 | 105 | def __init__(self, *args, **kwargs): | 107 | def __init__(self, *args, **kwargs): |
304 | 106 | self.captcha_file = None | 108 | self.captcha_file = None |
305 | @@ -176,6 +178,9 @@ | |||
306 | 176 | self.setSubTitle(self.help_text) | 178 | self.setSubTitle(self.help_text) |
307 | 177 | 179 | ||
308 | 178 | self.ui.name_label.setText(NAME_ENTRY) | 180 | self.ui.name_label.setText(NAME_ENTRY) |
309 | 181 | sign_in_link = LINK_STYLE.format(link_url='#', | ||
310 | 182 | link_text=SIGN_IN_LABEL) | ||
311 | 183 | self.ui.sign_in_label.setText(sign_in_link) | ||
312 | 179 | self.ui.email_label.setText(EMAIL1_ENTRY) | 184 | self.ui.email_label.setText(EMAIL1_ENTRY) |
313 | 180 | self.ui.confirm_email_label.setText(EMAIL2_ENTRY) | 185 | self.ui.confirm_email_label.setText(EMAIL2_ENTRY) |
314 | 181 | self.ui.password_label.setText(PASSWORD1_ENTRY) | 186 | self.ui.password_label.setText(PASSWORD1_ENTRY) |
315 | @@ -259,6 +264,7 @@ | |||
316 | 259 | self.ui.captcha_solution_edit.textEdited.connect( | 264 | self.ui.captcha_solution_edit.textEdited.connect( |
317 | 260 | self._enable_setup_button) | 265 | self._enable_setup_button) |
318 | 261 | self.terms_checkbox.stateChanged.connect(self._enable_setup_button) | 266 | self.terms_checkbox.stateChanged.connect(self._enable_setup_button) |
319 | 267 | self.ui.sign_in_label.linkActivated.connect(self.signIn) | ||
320 | 262 | 268 | ||
321 | 263 | self._refresh_captcha() | 269 | self._refresh_captcha() |
322 | 264 | 270 | ||
323 | 265 | 271 | ||
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 | 48 | """Test the SetupAccountPage code.""" | 48 | """Test the SetupAccountPage code.""" |
329 | 49 | 49 | ||
330 | 50 | ui_class = gui.CurrentUserSignInPage | 50 | ui_class = gui.CurrentUserSignInPage |
332 | 51 | ui_signals = ('userLoggedIn', 'passwordForgotten', 'userNotValidated') | 51 | ui_signals = ('userLoggedIn', 'passwordForgotten', 'userNotValidated', |
333 | 52 | 'createAccount') | ||
334 | 52 | ui_backend_signals = ('LoggedIn', 'LoginError', 'UserNotValidated') | 53 | ui_backend_signals = ('LoggedIn', 'LoginError', 'UserNotValidated') |
335 | 53 | 54 | ||
336 | 54 | def test_initialize_page(self): | 55 | def test_initialize_page(self): |
337 | @@ -86,6 +87,10 @@ | |||
338 | 86 | self.assert_subtitle_correct(expected) | 87 | self.assert_subtitle_correct(expected) |
339 | 87 | self.assertEqual(compat.text_type(self.ui.ui.email_label.text()), | 88 | self.assertEqual(compat.text_type(self.ui.ui.email_label.text()), |
340 | 88 | gui.EMAIL_LABEL) | 89 | gui.EMAIL_LABEL) |
341 | 90 | expected = gui.LINK_STYLE.format(link_url='#', | ||
342 | 91 | link_text=gui.CREATE_ACCOUNT_LABEL % {'app_name': self.app_name}) | ||
343 | 92 | self.assertEqual(compat.text_type( | ||
344 | 93 | self.ui.ui.create_account_label.text()), expected) | ||
345 | 89 | self.assertEqual(compat.text_type(self.ui.ui.password_label.text()), | 94 | self.assertEqual(compat.text_type(self.ui.ui.password_label.text()), |
346 | 90 | gui.LOGIN_PASSWORD_LABEL) | 95 | gui.LOGIN_PASSWORD_LABEL) |
347 | 91 | text = gui.LINK_STYLE.format(link_url='#', | 96 | text = gui.LINK_STYLE.format(link_url='#', |
348 | @@ -107,6 +112,8 @@ | |||
349 | 107 | QtCore.SIGNAL("textChanged(const QString&)")), 1) | 112 | QtCore.SIGNAL("textChanged(const QString&)")), 1) |
350 | 108 | self.assertEqual(self.ui.ui.sign_in_button.receivers( | 113 | self.assertEqual(self.ui.ui.sign_in_button.receivers( |
351 | 109 | QtCore.SIGNAL("clicked()")), 1) | 114 | QtCore.SIGNAL("clicked()")), 1) |
352 | 115 | self.assertEqual(self.ui.ui.create_account_label.receivers( | ||
353 | 116 | QtCore.SIGNAL("linkActivated(const QString&)")), 1) | ||
354 | 110 | 117 | ||
355 | 111 | def test_validate_not_valid(self): | 118 | def test_validate_not_valid(self): |
356 | 112 | """Test validate method.""" | 119 | """Test validate method.""" |
357 | @@ -191,3 +198,13 @@ | |||
358 | 191 | """Forgotten passsword clicked emits passwordForgotten signal.""" | 198 | """Forgotten passsword clicked emits passwordForgotten signal.""" |
359 | 192 | self.assert_signal_emitted(self.ui.passwordForgotten, (), | 199 | self.assert_signal_emitted(self.ui.passwordForgotten, (), |
360 | 193 | self.ui.ui.forgot_password_label.linkActivated.emit, "link") | 200 | self.ui.ui.forgot_password_label.linkActivated.emit, "link") |
361 | 201 | |||
362 | 202 | def test_on_create_account(self): | ||
363 | 203 | """Test the on_create_account method.""" | ||
364 | 204 | self.assert_signal_emitted(self.ui.createAccount, (), | ||
365 | 205 | self.ui.on_create_account) | ||
366 | 206 | |||
367 | 207 | def test_on_create_account_link_clicked(self): | ||
368 | 208 | """Create account clicked emits createAccount signal.""" | ||
369 | 209 | self.assert_signal_emitted(self.ui.createAccount, (), | ||
370 | 210 | self.ui.ui.create_account_label.linkActivated.emit, "link") | ||
371 | 194 | 211 | ||
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 | 41 | """Test the SetupAccountPage code.""" | 41 | """Test the SetupAccountPage code.""" |
377 | 42 | 42 | ||
378 | 43 | ui_class = gui.SetupAccountPage | 43 | ui_class = gui.SetupAccountPage |
380 | 44 | ui_signals = ('userRegistered',) | 44 | ui_signals = ('userRegistered', 'signIn') |
381 | 45 | ui_backend_signals = ('CaptchaGenerated', 'CaptchaGenerationError', | 45 | ui_backend_signals = ('CaptchaGenerated', 'CaptchaGenerationError', |
382 | 46 | 'UserRegistered', 'UserRegistrationError') | 46 | 'UserRegistered', 'UserRegistrationError') |
383 | 47 | 47 | ||
384 | @@ -234,6 +234,15 @@ | |||
385 | 234 | self.assertEqual( | 234 | self.assertEqual( |
386 | 235 | compat.text_type(self.ui.ui.confirm_password_label.text()), | 235 | compat.text_type(self.ui.ui.confirm_password_label.text()), |
387 | 236 | gui.RETYPE_PASSWORD) | 236 | gui.RETYPE_PASSWORD) |
388 | 237 | expected = gui.LINK_STYLE.format(link_url='#', | ||
389 | 238 | link_text=gui.SIGN_IN_LABEL) | ||
390 | 239 | self.assertEqual( | ||
391 | 240 | compat.text_type(self.ui.ui.sign_in_label.text()), | ||
392 | 241 | expected) | ||
393 | 242 | |||
394 | 243 | # connections | ||
395 | 244 | self.assertEqual(self.ui.set_up_button.receivers( | ||
396 | 245 | QtCore.SIGNAL("clicked(const bool)")), 1) | ||
397 | 237 | 246 | ||
398 | 238 | # assistants | 247 | # assistants |
399 | 239 | self.assertFalse(self.ui.ui.name_assistance.isVisible()) | 248 | self.assertFalse(self.ui.ui.name_assistance.isVisible()) |
400 | @@ -242,6 +251,36 @@ | |||
401 | 242 | self.assertFalse(self.ui.ui.password_assistance.isVisible()) | 251 | self.assertFalse(self.ui.ui.password_assistance.isVisible()) |
402 | 243 | self.assertTrue(self.ui.ui.refresh_label.isVisible()) | 252 | self.assertTrue(self.ui.ui.refresh_label.isVisible()) |
403 | 244 | 253 | ||
404 | 254 | def test_connect_ui(self): | ||
405 | 255 | """Test the connect ui method.""" | ||
406 | 256 | self.assertEqual(self.ui.ui.password_edit.receivers( | ||
407 | 257 | QtCore.SIGNAL("textEdited(const QString&)")), 2) | ||
408 | 258 | self.assertEqual(self.ui.ui.refresh_label.receivers( | ||
409 | 259 | QtCore.SIGNAL("linkActivated(const QString&)")), 2) | ||
410 | 260 | self.assertEqual(self.ui.ui.name_edit.receivers( | ||
411 | 261 | QtCore.SIGNAL("textEdited(const QString&)")), 1) | ||
412 | 262 | self.assertEqual(self.ui.ui.email_edit.receivers( | ||
413 | 263 | QtCore.SIGNAL("textEdited(const QString&)")), 1) | ||
414 | 264 | self.assertEqual(self.ui.ui.confirm_email_edit.receivers( | ||
415 | 265 | QtCore.SIGNAL("textEdited(const QString&)")), 1) | ||
416 | 266 | self.assertEqual(self.ui.ui.password_edit.receivers( | ||
417 | 267 | QtCore.SIGNAL("textEdited(const QString&)")), 2) | ||
418 | 268 | self.assertEqual(self.ui.ui.confirm_password_edit.receivers( | ||
419 | 269 | QtCore.SIGNAL("textEdited(const QString&)")), 1) | ||
420 | 270 | self.assertEqual(self.ui.ui.sign_in_label.receivers( | ||
421 | 271 | QtCore.SIGNAL("linkActivated(const QString&)")), 1) | ||
422 | 272 | |||
423 | 273 | def test_connect_ui_2(self): | ||
424 | 274 | """Test more connections from connect_ui""" | ||
425 | 275 | |||
426 | 276 | # | ||
427 | 277 | self.assertEqual(self.ui.ui.captcha_solution_edit.receivers( | ||
428 | 278 | QtCore.SIGNAL("textEdited(const QString&)")), 1) | ||
429 | 279 | self.assertEqual(self.ui.terms_checkbox.receivers( | ||
430 | 280 | QtCore.SIGNAL("stateChanged(bool)")), 1) | ||
431 | 281 | |||
432 | 282 | test_connect_ui_2.skip = "These oscilate 0/1 (LP:1046885)" | ||
433 | 283 | |||
434 | 245 | def test_set_up_button_clicked(self): | 284 | def test_set_up_button_clicked(self): |
435 | 246 | """Validation and overlay is shown when the setupbutton is clicked.""" | 285 | """Validation and overlay is shown when the setupbutton is clicked.""" |
436 | 247 | self.patch(self.ui, 'set_next_validation', self._set_called) | 286 | self.patch(self.ui, 'set_next_validation', self._set_called) |
437 | 248 | 287 | ||
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 | 96 | self.addPage(self.network_page) | 96 | self.addPage(self.network_page) |
443 | 97 | 97 | ||
444 | 98 | # set the diff pages of the QWizard | 98 | # set the diff pages of the QWizard |
450 | 99 | if not self.login_only: | 99 | self.setup_account = SetupAccountPage(**kwargs) |
451 | 100 | self.setup_account = SetupAccountPage(**kwargs) | 100 | self.setup_account.userRegistered.connect( |
452 | 101 | self.setup_account.userRegistered.connect( | 101 | self._move_to_email_verification_page) |
453 | 102 | self._move_to_email_verification_page) | 102 | # There are no tests for signal connections on |
454 | 103 | self.addPage(self.setup_account) | 103 | # this file (LP:1046886) |
455 | 104 | self.setup_account.signIn.connect(self._move_to_login_page) | ||
456 | 105 | self.addPage(self.setup_account) | ||
457 | 104 | 106 | ||
458 | 105 | self.current_user = CurrentUserSignInPage(**kwargs) | 107 | self.current_user = CurrentUserSignInPage(**kwargs) |
459 | 106 | self.current_user.userNotValidated.connect( | 108 | self.current_user.userNotValidated.connect( |
460 | @@ -108,6 +110,8 @@ | |||
461 | 108 | self.current_user.userLoggedIn.connect(self._move_to_success_page) | 110 | self.current_user.userLoggedIn.connect(self._move_to_success_page) |
462 | 109 | self.current_user.passwordForgotten.connect( | 111 | self.current_user.passwordForgotten.connect( |
463 | 110 | self._move_to_forgotten_page) | 112 | self._move_to_forgotten_page) |
464 | 113 | self.current_user.createAccount.connect( | ||
465 | 114 | self._move_to_setup_account_page) | ||
466 | 111 | self.addPage(self.current_user) | 115 | self.addPage(self.current_user) |
467 | 112 | 116 | ||
468 | 113 | self.email_verification = EmailVerificationPage(**kwargs) | 117 | self.email_verification = EmailVerificationPage(**kwargs) |
469 | @@ -144,6 +148,12 @@ | |||
470 | 144 | self.setMinimumSize(PREFERED_UI_SIZE['width'], | 148 | self.setMinimumSize(PREFERED_UI_SIZE['width'], |
471 | 145 | PREFERED_UI_SIZE['height']) | 149 | PREFERED_UI_SIZE['height']) |
472 | 146 | 150 | ||
473 | 151 | # This is missing tests (LP:1046887) | ||
474 | 152 | if self.login_only: | ||
475 | 153 | self._move_to_login_page() | ||
476 | 154 | else: | ||
477 | 155 | self._move_to_setup_account_page() | ||
478 | 156 | |||
479 | 147 | @defer.inlineCallbacks | 157 | @defer.inlineCallbacks |
480 | 148 | def check_network_connection(self): | 158 | def check_network_connection(self): |
481 | 149 | """Check if the NetworkDetectionPage is needed to be shown.""" | 159 | """Check if the NetworkDetectionPage is needed to be shown.""" |
482 | @@ -213,17 +223,15 @@ | |||
483 | 213 | """Move to the setup account page wizard.""" | 223 | """Move to the setup account page wizard.""" |
484 | 214 | logger.debug('Moving to SetupAccountPage from: %s', | 224 | logger.debug('Moving to SetupAccountPage from: %s', |
485 | 215 | self.currentPage()) | 225 | self.currentPage()) |
489 | 216 | self._next_id = self.setup_account_page_id | 226 | self.setStartId(self.setup_account_page_id) |
490 | 217 | self.next() | 227 | self.restart() |
488 | 218 | self._next_id = -1 | ||
491 | 219 | 228 | ||
492 | 220 | def _move_to_login_page(self): | 229 | def _move_to_login_page(self): |
493 | 221 | """Move to the login page wizard.""" | 230 | """Move to the login page wizard.""" |
494 | 222 | logger.debug('Moving to CurrentUserSignInPage from: %s', | 231 | logger.debug('Moving to CurrentUserSignInPage from: %s', |
495 | 223 | self.currentPage()) | 232 | self.currentPage()) |
499 | 224 | self._next_id = self.current_user_page_id | 233 | self.setStartId(self.current_user_page_id) |
500 | 225 | self.next() | 234 | self.restart() |
498 | 226 | self._next_id = -1 | ||
501 | 227 | 235 | ||
502 | 228 | def _move_to_success_page(self): | 236 | def _move_to_success_page(self): |
503 | 229 | """Move to the success page wizard.""" | 237 | """Move to the success page wizard.""" |
504 | 230 | 238 | ||
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 | 64 | CONGRATULATIONS = _("Congratulations, {app_name} is installed!") | 64 | CONGRATULATIONS = _("Congratulations, {app_name} is installed!") |
510 | 65 | CONNECT_HELP_LABEL = _('To connect this computer to %(app_name)s enter your ' | 65 | CONNECT_HELP_LABEL = _('To connect this computer to %(app_name)s enter your ' |
511 | 66 | 'details below.') | 66 | 'details below.') |
512 | 67 | CREATE_ACCOUNT_LABEL = _('Register with {app_name}.') | ||
513 | 67 | EMAIL_LABEL = EMAIL1_ENTRY = _('Email address') | 68 | EMAIL_LABEL = EMAIL1_ENTRY = _('Email address') |
514 | 68 | EMAIL2_ENTRY = _('Re-type Email address') | 69 | EMAIL2_ENTRY = _('Re-type Email address') |
515 | 69 | EMAIL_INVALID = _('The email must be a valid email address.') | 70 | EMAIL_INVALID = _('The email must be a valid email address.') |
516 | @@ -146,6 +147,7 @@ | |||
517 | 146 | SET_UP_ACCOUNT_BUTTON = _('Set Up Account') | 147 | SET_UP_ACCOUNT_BUTTON = _('Set Up Account') |
518 | 147 | SET_UP_ACCOUNT_CHOICE_BUTTON = _('I don\'t have an account yet - sign me up') | 148 | SET_UP_ACCOUNT_CHOICE_BUTTON = _('I don\'t have an account yet - sign me up') |
519 | 148 | SIGN_IN_BUTTON = _('Sign In') | 149 | SIGN_IN_BUTTON = _('Sign In') |
520 | 150 | SIGN_IN_LABEL = _('Log-in with my existing account.') | ||
521 | 149 | SSL_APPNAME_HELP = _('the appname whose ssl error we are going to show.') | 151 | SSL_APPNAME_HELP = _('the appname whose ssl error we are going to show.') |
522 | 150 | SSL_CERT_DETAILS = _('Certificate details') | 152 | SSL_CERT_DETAILS = _('Certificate details') |
523 | 151 | SSL_CONNECT_BUTTON = _('Connect') | 153 | 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.