Merge lp:~diegosarmentero/ubuntu-sso-client/text-style into lp:ubuntu-sso-client

Proposed by Diego Sarmentero
Status: Merged
Approved by: Natalia Bidart
Approved revision: 784
Merged at revision: 783
Proposed branch: lp:~diegosarmentero/ubuntu-sso-client/text-style
Merge into: lp:ubuntu-sso-client
Diff against target: 535 lines (+193/-89)
9 files modified
data/qt/current_user_sign_in.ui (+0/-16)
data/qt/email_verification.ui (+7/-16)
data/qt/forgotten_password.ui (+0/-16)
data/qt/reset_password.ui (+166/-17)
ubuntu_sso/qt/controllers.py (+2/-11)
ubuntu_sso/qt/gui.py (+7/-0)
ubuntu_sso/qt/tests/test_reset_password.py (+8/-0)
ubuntu_sso/qt/tests/test_windows.py (+1/-11)
ubuntu_sso/utils/ui.py (+2/-2)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntu-sso-client/text-style
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Review via email: mp+74640@code.launchpad.net

Commit message

- Fixed line edit style, include label above line edit where its needed, improve general ui style for better consistency (LP: #829358).

Description of the change

Fixed line edit style, include label above line edit where its needed, improve general ui style for better consistency.

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

Let's not remove the placeholdertext for the captcha solution entry. And let's restore the newline in the set password legend, since that string is also used from the GTK app.

review: Needs Fixing
783. By Diego Sarmentero

Some bugs in the branch fixed.

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

I still see this code:

376 - self.view.ui.captcha_solution_edit.setPlaceholderText(
377 - CAPTCHA_SOLUTION_ENTRY)

removed from this branch.

review: Needs Fixing
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

In windows, I'm getting this trace:

===============================================================================
[FAIL]
Traceback (most recent call last):
  File "C:\Python27\lib\unittest\case.py", line 327, in run
    testMethod()
  File "build\bdist.win32\egg\mocker.py", line 162, in test_method_wrapper

  File "build\bdist.win32\egg\mocker.py", line 645, in verify

exceptions.AssertionError: [Mocker] Unmet expectations:

=> view.ui.captcha_solution_edit.setPlaceholderText('Type the characters above')

 - Performed fewer times than expected.

ubuntu_sso.qt.tests.test_windows.SetUpAccountControllerTestCase.test_set_transla
ted_strings
-------------------------------------------------------------------------------

784. By Diego Sarmentero

Restored place holder for captcha, it was fixed in the wrong place in the previous commit.

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

> In windows, I'm getting this trace:
>
> ==============================================================================
> =
> [FAIL]
> Traceback (most recent call last):
> File "C:\Python27\lib\unittest\case.py", line 327, in run
> testMethod()
> File "build\bdist.win32\egg\mocker.py", line 162, in test_method_wrapper
>
> File "build\bdist.win32\egg\mocker.py", line 645, in verify
>
> exceptions.AssertionError: [Mocker] Unmet expectations:
>
> => view.ui.captcha_solution_edit.setPlaceholderText('Type the characters
> above')
>
> - Performed fewer times than expected.
>
>
> ubuntu_sso.qt.tests.test_windows.SetUpAccountControllerTestCase.test_set_trans
> la
> ted_strings
> ------------------------------------------------------------------------------
> -

fixed

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks good now!

review: Approve

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 2011-09-05 18:26:33 +0000
3+++ data/qt/current_user_sign_in.ui 2011-09-08 22:34:24 +0000
4@@ -20,22 +20,6 @@
5 <item>
6 <layout class="QHBoxLayout" name="horizontalLayout_3">
7 <item>
8- <spacer name="horizontalSpacer_2">
9- <property name="orientation">
10- <enum>Qt::Horizontal</enum>
11- </property>
12- <property name="sizeType">
13- <enum>QSizePolicy::Fixed</enum>
14- </property>
15- <property name="sizeHint" stdset="0">
16- <size>
17- <width>40</width>
18- <height>20</height>
19- </size>
20- </property>
21- </spacer>
22- </item>
23- <item>
24 <layout class="QVBoxLayout" name="verticalLayout">
25 <item>
26 <spacer name="verticalSpacer_3">
27
28=== modified file 'data/qt/email_verification.ui'
29--- data/qt/email_verification.ui 2011-09-05 18:29:37 +0000
30+++ data/qt/email_verification.ui 2011-09-08 22:34:24 +0000
31@@ -20,24 +20,15 @@
32 <item>
33 <layout class="QHBoxLayout" name="horizontalLayout_3">
34 <item>
35- <spacer name="horizontalSpacer_2">
36- <property name="orientation">
37- <enum>Qt::Horizontal</enum>
38- </property>
39- <property name="sizeType">
40- <enum>QSizePolicy::Fixed</enum>
41- </property>
42- <property name="sizeHint" stdset="0">
43- <size>
44- <width>40</width>
45- <height>20</height>
46- </size>
47- </property>
48- </spacer>
49- </item>
50- <item>
51 <layout class="QVBoxLayout" name="verticalLayout">
52 <item>
53+ <widget class="QLabel" name="label">
54+ <property name="text">
55+ <string>Verification code</string>
56+ </property>
57+ </widget>
58+ </item>
59+ <item>
60 <widget class="QLineEdit" name="verification_code_edit">
61 <property name="placeholderText">
62 <string/>
63
64=== modified file 'data/qt/forgotten_password.ui'
65--- data/qt/forgotten_password.ui 2011-09-05 18:29:37 +0000
66+++ data/qt/forgotten_password.ui 2011-09-08 22:34:24 +0000
67@@ -41,22 +41,6 @@
68 <widget class="QWidget" name="email_widget" native="true">
69 <layout class="QHBoxLayout" name="horizontalLayout_2">
70 <item>
71- <spacer name="horizontalSpacer_2">
72- <property name="orientation">
73- <enum>Qt::Horizontal</enum>
74- </property>
75- <property name="sizeType">
76- <enum>QSizePolicy::Fixed</enum>
77- </property>
78- <property name="sizeHint" stdset="0">
79- <size>
80- <width>40</width>
81- <height>20</height>
82- </size>
83- </property>
84- </spacer>
85- </item>
86- <item>
87 <layout class="QVBoxLayout" name="verticalLayout">
88 <item>
89 <widget class="QLabel" name="email_address_label">
90
91=== modified file 'data/qt/reset_password.ui'
92--- data/qt/reset_password.ui 2011-09-05 18:29:37 +0000
93+++ data/qt/reset_password.ui 2011-09-08 22:34:24 +0000
94@@ -6,15 +6,21 @@
95 <rect>
96 <x>0</x>
97 <y>0</y>
98- <width>580</width>
99+ <width>543</width>
100 <height>262</height>
101 </rect>
102 </property>
103 <property name="windowTitle">
104 <string>WizardPage</string>
105 </property>
106+ <property name="layoutDirection">
107+ <enum>Qt::LeftToRight</enum>
108+ </property>
109 <layout class="QVBoxLayout" name="verticalLayout">
110- <property name="topMargin">
111+ <property name="spacing">
112+ <number>6</number>
113+ </property>
114+ <property name="margin">
115 <number>0</number>
116 </property>
117 <item>
118@@ -22,23 +28,97 @@
119 <item>
120 <layout class="QVBoxLayout" name="verticalLayout_2">
121 <item>
122+ <widget class="QLabel" name="reset_code">
123+ <property name="sizePolicy">
124+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
125+ <horstretch>0</horstretch>
126+ <verstretch>0</verstretch>
127+ </sizepolicy>
128+ </property>
129+ <property name="minimumSize">
130+ <size>
131+ <width>310</width>
132+ <height>0</height>
133+ </size>
134+ </property>
135+ <property name="maximumSize">
136+ <size>
137+ <width>16777215</width>
138+ <height>16777215</height>
139+ </size>
140+ </property>
141+ <property name="font">
142+ <font>
143+ <weight>75</weight>
144+ <bold>true</bold>
145+ </font>
146+ </property>
147+ <property name="text">
148+ <string>reset_code</string>
149+ </property>
150+ </widget>
151+ </item>
152+ <item>
153 <widget class="QLineEdit" name="reset_code_line_edit">
154- <property name="minimumSize">
155- <size>
156- <width>300</width>
157- <height>0</height>
158- </size>
159- </property>
160- <property name="maximumSize">
161- <size>
162- <width>300</width>
163- <height>16777215</height>
164- </size>
165+ <property name="sizePolicy">
166+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
167+ <horstretch>0</horstretch>
168+ <verstretch>0</verstretch>
169+ </sizepolicy>
170+ </property>
171+ <property name="minimumSize">
172+ <size>
173+ <width>300</width>
174+ <height>0</height>
175+ </size>
176+ </property>
177+ <property name="maximumSize">
178+ <size>
179+ <width>300</width>
180+ <height>16777215</height>
181+ </size>
182+ </property>
183+ </widget>
184+ </item>
185+ <item>
186+ <widget class="QLabel" name="password_label">
187+ <property name="sizePolicy">
188+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
189+ <horstretch>0</horstretch>
190+ <verstretch>0</verstretch>
191+ </sizepolicy>
192+ </property>
193+ <property name="minimumSize">
194+ <size>
195+ <width>310</width>
196+ <height>0</height>
197+ </size>
198+ </property>
199+ <property name="maximumSize">
200+ <size>
201+ <width>16777215</width>
202+ <height>16777215</height>
203+ </size>
204+ </property>
205+ <property name="font">
206+ <font>
207+ <weight>75</weight>
208+ <bold>true</bold>
209+ </font>
210+ </property>
211+ <property name="text">
212+ <string>password_label</string>
213 </property>
214 </widget>
215 </item>
216 <item>
217 <widget class="QLineEdit" name="password_line_edit">
218+ <property name="sizePolicy">
219+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
220+ <horstretch>0</horstretch>
221+ <verstretch>0</verstretch>
222+ </sizepolicy>
223+ </property>
224 <property name="minimumSize">
225 <size>
226 <width>300</width>
227@@ -57,7 +137,38 @@
228 </widget>
229 </item>
230 <item>
231+ <widget class="QLabel" name="confirm_password_label">
232+ <property name="sizePolicy">
233+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
234+ <horstretch>0</horstretch>
235+ <verstretch>0</verstretch>
236+ </sizepolicy>
237+ </property>
238+ <property name="minimumSize">
239+ <size>
240+ <width>310</width>
241+ <height>0</height>
242+ </size>
243+ </property>
244+ <property name="font">
245+ <font>
246+ <weight>75</weight>
247+ <bold>true</bold>
248+ </font>
249+ </property>
250+ <property name="text">
251+ <string>confirm_password_label</string>
252+ </property>
253+ </widget>
254+ </item>
255+ <item>
256 <widget class="QLineEdit" name="confirm_password_line_edit">
257+ <property name="sizePolicy">
258+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
259+ <horstretch>0</horstretch>
260+ <verstretch>0</verstretch>
261+ </sizepolicy>
262+ </property>
263 <property name="minimumSize">
264 <size>
265 <width>300</width>
266@@ -88,21 +199,59 @@
267 </property>
268 </spacer>
269 </item>
270+ <item>
271+ <spacer name="horizontalSpacer_2">
272+ <property name="orientation">
273+ <enum>Qt::Horizontal</enum>
274+ </property>
275+ <property name="sizeType">
276+ <enum>QSizePolicy::Fixed</enum>
277+ </property>
278+ <property name="sizeHint" stdset="0">
279+ <size>
280+ <width>300</width>
281+ <height>0</height>
282+ </size>
283+ </property>
284+ </spacer>
285+ </item>
286 </layout>
287 </item>
288 <item>
289 <layout class="QVBoxLayout" name="verticalLayout_3">
290 <item>
291+ <spacer name="verticalSpacer_3">
292+ <property name="orientation">
293+ <enum>Qt::Vertical</enum>
294+ </property>
295+ <property name="sizeType">
296+ <enum>QSizePolicy::Fixed</enum>
297+ </property>
298+ <property name="sizeHint" stdset="0">
299+ <size>
300+ <width>20</width>
301+ <height>55</height>
302+ </size>
303+ </property>
304+ </spacer>
305+ </item>
306+ <item>
307 <widget class="QLabel" name="password_assistance">
308+ <property name="sizePolicy">
309+ <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
310+ <horstretch>0</horstretch>
311+ <verstretch>0</verstretch>
312+ </sizepolicy>
313+ </property>
314 <property name="minimumSize">
315 <size>
316- <width>250</width>
317+ <width>220</width>
318 <height>100</height>
319 </size>
320 </property>
321 <property name="maximumSize">
322 <size>
323- <width>300</width>
324+ <width>220</width>
325 <height>16777215</height>
326 </size>
327 </property>
328@@ -133,11 +282,11 @@
329 <enum>Qt::Horizontal</enum>
330 </property>
331 <property name="sizeType">
332- <enum>QSizePolicy::Fixed</enum>
333+ <enum>QSizePolicy::Ignored</enum>
334 </property>
335 <property name="sizeHint" stdset="0">
336 <size>
337- <width>250</width>
338+ <width>220</width>
339 <height>0</height>
340 </size>
341 </property>
342
343=== modified file 'ubuntu_sso/qt/controllers.py'
344--- ubuntu_sso/qt/controllers.py 2011-09-07 15:45:45 +0000
345+++ ubuntu_sso/qt/controllers.py 2011-09-08 22:34:24 +0000
346@@ -34,8 +34,8 @@
347 from ubuntu_sso.logger import setup_logging
348 from ubuntu_sso.utils.ui import (
349 CAPTCHA_LOAD_ERROR,
350+ CAPTCHA_REQUIRED_ERROR,
351 CAPTCHA_SOLUTION_ENTRY,
352- CAPTCHA_REQUIRED_ERROR,
353 EMAIL1_ENTRY,
354 EMAIL2_ENTRY,
355 EMAIL_LABEL,
356@@ -54,7 +54,6 @@
357 PASSWORD_TOO_WEAK,
358 REQUEST_PASSWORD_TOKEN_LABEL,
359 RESET_PASSWORD,
360- RESET_CODE_ENTRY,
361 REQUEST_PASSWORD_TOKEN_WRONG_EMAIL,
362 REQUEST_PASSWORD_TOKEN_TECH_ERROR,
363 SET_UP_ACCOUNT_CHOICE_BUTTON,
364@@ -197,9 +196,7 @@
365 """Set the translated strings."""
366 logger.debug('CurrentUserController._set_translated_strings')
367 self.view.ui.email_label.setText(EMAIL_LABEL)
368- self.view.ui.email_edit.setPlaceholderText(EMAIL1_ENTRY)
369 self.view.ui.password_label.setText(LOGIN_PASSWORD_LABEL)
370- self.view.ui.password_edit.setPlaceholderText(PASSWORD1_ENTRY)
371 self.view.ui.forgot_password_label.setText(
372 FAKE_URL % FORGOTTEN_PASSWORD_BUTTON)
373 self.view.ui.sign_in_button.setText(SIGN_IN_BUTTON)
374@@ -292,7 +289,7 @@
375 self.view.ui.confirm_password_label.setText(PASSWORD2_ENTRY)
376 self.view.ui.password_info_label.setText(PASSWORD_HELP)
377 self.view.ui.captcha_solution_edit.setPlaceholderText(
378- CAPTCHA_SOLUTION_ENTRY)
379+ CAPTCHA_SOLUTION_ENTRY)
380 self.view.setButtonText(self.set_up_account, SET_UP_ACCOUNT_BUTTON)
381
382 def _set_line_edits_validations(self):
383@@ -524,8 +521,6 @@
384 def _set_translated_strings(self):
385 """Set the trnaslated strings."""
386 logger.debug('EmailVerificationController._set_translated_strings')
387- self.view.ui.verification_code_edit.setPlaceholderText(
388- VERIFY_EMAIL_TITLE)
389
390 def _connect_ui_elements(self):
391 """Set the connection of signals."""
392@@ -722,10 +717,6 @@
393
394 def _set_translated_strings(self):
395 """Translate the diff strings used in the app."""
396- self.view.ui.reset_code_line_edit.setPlaceholderText(RESET_CODE_ENTRY)
397- self.view.ui.password_line_edit.setPlaceholderText(PASSWORD1_ENTRY)
398- self.view.ui.confirm_password_line_edit.setPlaceholderText(
399- PASSWORD2_ENTRY)
400 self.view.ui.reset_password_button.setText(RESET_PASSWORD)
401 self.view.setSubTitle(PASSWORD_HELP)
402
403
404=== modified file 'ubuntu_sso/qt/gui.py'
405--- ubuntu_sso/qt/gui.py 2011-09-06 12:59:44 +0000
406+++ ubuntu_sso/qt/gui.py 2011-09-08 22:34:24 +0000
407@@ -32,6 +32,10 @@
408 QLabel)
409
410 from ubuntu_sso.logger import setup_logging
411+from ubuntu_sso.utils.ui import (
412+ PASSWORD1_ENTRY,
413+ PASSWORD2_ENTRY,
414+ RESET_CODE_ENTRY)
415 from ubuntu_sso.qt import common
416 # pylint: disable=F0401,E0611
417 from ubuntu_sso.qt.choose_sign_in_ui import Ui_ChooseSignInPage
418@@ -324,6 +328,9 @@
419 self.ui.password_assistance.setVisible(False)
420 self.setTitle(RESET_TITLE)
421 self.setSubTitle(RESET_SUBTITLE)
422+ self.ui.password_label.setText(PASSWORD1_ENTRY)
423+ self.ui.confirm_password_label.setText(PASSWORD2_ENTRY)
424+ self.ui.reset_code.setText(RESET_CODE_ENTRY)
425
426 def showEvent(self, event):
427 """Connect focusChanged signal from the application."""
428
429=== modified file 'ubuntu_sso/qt/tests/test_reset_password.py'
430--- ubuntu_sso/qt/tests/test_reset_password.py 2011-09-06 12:59:44 +0000
431+++ ubuntu_sso/qt/tests/test_reset_password.py 2011-09-08 22:34:24 +0000
432@@ -19,6 +19,10 @@
433 from PyQt4 import QtGui, QtCore
434 from twisted.trial.unittest import TestCase
435
436+from ubuntu_sso.utils.ui import (
437+ PASSWORD1_ENTRY,
438+ PASSWORD2_ENTRY,
439+ RESET_CODE_ENTRY)
440 from ubuntu_sso.qt import common
441 from ubuntu_sso.qt.gui import ResetPasswordPage, RESET_SUBTITLE, RESET_TITLE
442 # pylint: disable=F0401,E0611
443@@ -65,6 +69,10 @@
444 self.assertEqual(self.page.header.title_label.text(), RESET_TITLE)
445 self.assertEqual(self.page.header.subtitle_label.text(),
446 RESET_SUBTITLE)
447+ self.assertEqual(self.page.ui.password_label.text(), PASSWORD1_ENTRY)
448+ self.assertEqual(self.page.ui.confirm_password_label.text(),
449+ PASSWORD2_ENTRY)
450+ self.assertEqual(self.page.ui.reset_code.text(), RESET_CODE_ENTRY)
451
452 def test_focus_changed_password_visibility(self):
453 """Check visibility changes when focus_changed() is executed."""
454
455=== modified file 'ubuntu_sso/qt/tests/test_windows.py'
456--- ubuntu_sso/qt/tests/test_windows.py 2011-09-07 15:45:45 +0000
457+++ ubuntu_sso/qt/tests/test_windows.py 2011-09-08 22:34:24 +0000
458@@ -33,8 +33,8 @@
459 SuccessController,
460 UbuntuSSOWizardController)
461 from ubuntu_sso.utils.ui import (
462+ CAPTCHA_REQUIRED_ERROR,
463 CAPTCHA_SOLUTION_ENTRY,
464- CAPTCHA_REQUIRED_ERROR,
465 EMAIL1_ENTRY,
466 EMAIL2_ENTRY,
467 EMAIL_MISMATCH,
468@@ -51,7 +51,6 @@
469 PASSWORD_TOO_WEAK,
470 PASSWORD_MISMATCH,
471 RESET_PASSWORD,
472- RESET_CODE_ENTRY,
473 REQUEST_PASSWORD_TOKEN_LABEL,
474 SET_UP_ACCOUNT_CHOICE_BUTTON,
475 SET_UP_ACCOUNT_BUTTON,
476@@ -60,7 +59,6 @@
477 REQUEST_PASSWORD_TOKEN_WRONG_EMAIL,
478 REQUEST_PASSWORD_TOKEN_TECH_ERROR,
479 TRY_AGAIN_BUTTON,
480- VERIFY_EMAIL_TITLE,
481 VERIFY_EMAIL_CONTENT,
482 is_min_required_password,
483 is_correct_email)
484@@ -150,9 +148,7 @@
485 def test_translated_strings(self):
486 """test that the ui is correctly set up."""
487 self.view.ui.email_label.setText(EMAIL_LABEL)
488- self.view.ui.email_edit.setPlaceholderText(EMAIL1_ENTRY)
489 self.view.ui.password_label.setText(LOGIN_PASSWORD_LABEL)
490- self.view.ui.password_edit.setPlaceholderText(PASSWORD1_ENTRY)
491 self.view.ui.forgot_password_label.setText(
492 FAKE_URL % FORGOTTEN_PASSWORD_BUTTON)
493 self.view.ui.sign_in_button.setText(SIGN_IN_BUTTON)
494@@ -722,8 +718,6 @@
495
496 def test_set_translated_strings(self):
497 """Test that strings are translated."""
498- self.view.ui.verification_code_edit.setPlaceholderText(
499- VERIFY_EMAIL_TITLE)
500 self.mocker.replay()
501 self.controller._set_translated_strings()
502
503@@ -1123,10 +1117,6 @@
504 def test_set_translated_strings(self):
505 """Ensure that the correct strings are set."""
506 self.controller._subtitle = PASSWORD_HELP
507- self.view.ui.reset_code_line_edit.setPlaceholderText(RESET_CODE_ENTRY)
508- self.view.ui.password_line_edit.setPlaceholderText(PASSWORD1_ENTRY)
509- self.view.ui.confirm_password_line_edit.setPlaceholderText(
510- PASSWORD2_ENTRY)
511 self.view.ui.reset_password_button.setText(RESET_PASSWORD)
512 self.view.setSubTitle(PASSWORD_HELP)
513 self.mocker.replay()
514
515=== modified file 'ubuntu_sso/utils/ui.py'
516--- ubuntu_sso/utils/ui.py 2011-09-01 11:04:23 +0000
517+++ ubuntu_sso/utils/ui.py 2011-09-08 22:34:24 +0000
518@@ -40,7 +40,7 @@
519 'enter your details below.')
520 EMAIL1_ENTRY = _('Email address')
521 EMAIL2_ENTRY = _('Re-type Email address')
522-EMAIL_LABEL = EMAIL1_ENTRY + ':'
523+EMAIL_LABEL = EMAIL1_ENTRY
524 EMAIL_MISMATCH = _('The email addresses don\'t match, please double check '
525 'and try entering them again.')
526 EMAIL_INVALID = _('The email must be a valid email address.')
527@@ -55,7 +55,7 @@
528 LOGIN_EMAIL_ENTRY = _('Email address')
529 LOGIN_HEADER_LABEL = _('Connect to %(app_name)s')
530 LOGIN_PASSWORD_ENTRY = _('Password')
531-LOGIN_PASSWORD_LABEL = LOGIN_PASSWORD_ENTRY + ':'
532+LOGIN_PASSWORD_LABEL = LOGIN_PASSWORD_ENTRY
533 NAME_ENTRY = _('Name')
534 NEXT = _('Next')
535 ONE_MOMENT_PLEASE = _('One moment please...')

Subscribers

People subscribed via source and target branches