Merge lp:~ralsina/ubuntu-sso-client/fix_804569 into lp:ubuntu-sso-client

Proposed by Roberto Alsina
Status: Merged
Approved by: Roberto Alsina
Approved revision: 736
Merged at revision: 731
Proposed branch: lp:~ralsina/ubuntu-sso-client/fix_804569
Merge into: lp:ubuntu-sso-client
Diff against target: 222 lines (+41/-103)
4 files modified
data/qt/terms_and_conditions.ui (+22/-100)
ubuntu_sso/qt/controllers.py (+6/-2)
ubuntu_sso/qt/tests/test_windows.py (+12/-1)
ubuntu_sso/utils/ui.py (+1/-0)
To merge this branch: bzr merge lp:~ralsina/ubuntu-sso-client/fix_804569
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Alejandro J. Cura (community) Approve
Review via email: mp+66671@code.launchpad.net

Commit message

1) Remove the large margin around the embedded webkit.
2) Add a label giving the user a way to open the TOS in a web browser

Description of the change

1) Remove the large margin around the embedded webkit.
2) Add a label giving the user a way to open the TOS in a web browser

It's mostly a UI change.

To test IRL (windows only):

In one terminal:

set PYTHONPATH=.
python bin\windows-ubuntu-sso-login

In another:

set PYTHONPATH=.
python ubuntu_sso\qt\tests\show_gui.py

Go to "setup new account" -> "Show TOS" and look.

There is one new line of code and it's covered by tests.

To post a comment you must log in.
733. By Roberto Alsina

Changed interpolation style

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

Code looks good, tested irl.

review: Approve
734. By Roberto Alsina

forgt s

735. By Roberto Alsina

merge to trunk

736. By Roberto Alsina

Fix tests to maych current code

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

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/qt/terms_and_conditions.ui'
2--- data/qt/terms_and_conditions.ui 2011-03-22 14:34:42 +0000
3+++ data/qt/terms_and_conditions.ui 2011-07-04 22:28:33 +0000
4@@ -13,106 +13,28 @@
5 <property name="windowTitle">
6 <string>WizardPage</string>
7 </property>
8- <layout class="QHBoxLayout" name="horizontalLayout">
9- <item>
10- <layout class="QHBoxLayout" name="horizontalLayout_3">
11- <item>
12- <spacer name="horizontalSpacer_2">
13- <property name="orientation">
14- <enum>Qt::Horizontal</enum>
15- </property>
16- <property name="sizeType">
17- <enum>QSizePolicy::Fixed</enum>
18- </property>
19- <property name="sizeHint" stdset="0">
20- <size>
21- <width>40</width>
22- <height>20</height>
23- </size>
24- </property>
25- </spacer>
26- </item>
27- <item>
28- <layout class="QVBoxLayout" name="verticalLayout">
29- <item>
30- <spacer name="verticalSpacer_3">
31- <property name="orientation">
32- <enum>Qt::Vertical</enum>
33- </property>
34- <property name="sizeType">
35- <enum>QSizePolicy::Fixed</enum>
36- </property>
37- <property name="sizeHint" stdset="0">
38- <size>
39- <width>20</width>
40- <height>40</height>
41- </size>
42- </property>
43- </spacer>
44- </item>
45- <item>
46- <widget class="QScrollArea" name="scrollArea">
47- <property name="widgetResizable">
48- <bool>true</bool>
49- </property>
50- <widget class="QWidget" name="scrollAreaWidgetContents">
51- <property name="geometry">
52- <rect>
53- <x>0</x>
54- <y>0</y>
55- <width>284</width>
56- <height>184</height>
57- </rect>
58- </property>
59- <layout class="QHBoxLayout" name="horizontalLayout_2">
60- <item>
61- <widget class="QWebView" name="terms_webkit">
62- <property name="url">
63- <url>
64- <string>about:blank</string>
65- </url>
66- </property>
67- </widget>
68- </item>
69- </layout>
70- </widget>
71- </widget>
72- </item>
73- <item>
74- <spacer name="verticalSpacer_2">
75- <property name="orientation">
76- <enum>Qt::Vertical</enum>
77- </property>
78- <property name="sizeType">
79- <enum>QSizePolicy::Fixed</enum>
80- </property>
81- <property name="sizeHint" stdset="0">
82- <size>
83- <width>20</width>
84- <height>40</height>
85- </size>
86- </property>
87- </spacer>
88- </item>
89- </layout>
90- </item>
91- <item>
92- <spacer name="horizontalSpacer">
93- <property name="orientation">
94- <enum>Qt::Horizontal</enum>
95- </property>
96- <property name="sizeType">
97- <enum>QSizePolicy::Fixed</enum>
98- </property>
99- <property name="sizeHint" stdset="0">
100- <size>
101- <width>40</width>
102- <height>20</height>
103- </size>
104- </property>
105- </spacer>
106- </item>
107- </layout>
108+ <layout class="QVBoxLayout" name="verticalLayout">
109+ <property name="margin">
110+ <number>0</number>
111+ </property>
112+ <item>
113+ <widget class="QWebView" name="terms_webkit">
114+ <property name="url">
115+ <url>
116+ <string>about:blank</string>
117+ </url>
118+ </property>
119+ </widget>
120+ </item>
121+ <item>
122+ <widget class="QLabel" name="tos_link_label">
123+ <property name="text">
124+ <string>TextLabel</string>
125+ </property>
126+ <property name="openExternalLinks">
127+ <bool>true</bool>
128+ </property>
129+ </widget>
130 </item>
131 </layout>
132 </widget>
133
134=== modified file 'ubuntu_sso/qt/controllers.py'
135--- ubuntu_sso/qt/controllers.py 2011-07-04 19:53:52 +0000
136+++ ubuntu_sso/qt/controllers.py 2011-07-04 22:28:33 +0000
137@@ -60,6 +60,7 @@
138 SIGN_IN_BUTTON,
139 SUCCESS,
140 TC_BUTTON,
141+ TOS_LABEL,
142 TRY_AGAIN_BUTTON,
143 VERIFY_EMAIL_TITLE,
144 VERIFY_EMAIL_CONTENT,
145@@ -406,8 +407,8 @@
146 password, name, captcha_id,
147 captcha_solution)
148 # Update validation page's title, which contains the email
149- wizard = self.view.wizard()
150- wizard.page(wizard.email_verification_page_id).controller.set_titles()
151+ p_id = self.view.wizard().email_verification_page_id
152+ self.view.wizard().page(p_id).controller.set_titles()
153
154 def is_correct_email(self, email_address):
155 """Return if the email is correct."""
156@@ -458,6 +459,9 @@
157 self.view.setSubTitle(self._subtitle)
158 # load the tos page
159 self.view.ui.terms_webkit.load(QUrl(self._tos_url))
160+ self.view.ui.tos_link_label.setText(
161+ TOS_LABEL %
162+ {'url': self._tos_url})
163 #pylint: enable=C0103
164
165
166
167=== modified file 'ubuntu_sso/qt/tests/test_windows.py'
168--- ubuntu_sso/qt/tests/test_windows.py 2011-06-30 19:07:24 +0000
169+++ ubuntu_sso/qt/tests/test_windows.py 2011-07-04 22:28:33 +0000
170@@ -58,6 +58,7 @@
171 REQUEST_PASSWORD_TOKEN_WRONG_EMAIL,
172 REQUEST_PASSWORD_TOKEN_TECH_ERROR,
173 TC_BUTTON,
174+ TOS_LABEL,
175 TRY_AGAIN_BUTTON,
176 VERIFY_EMAIL_TITLE,
177 VERIFY_EMAIL_CONTENT,
178@@ -304,6 +305,8 @@
179 self.mocker.result(captcha_solution)
180 self.backend.register_user(self.app_name, email, password, name,
181 captcha_id, captcha_solution)
182+ self.view.wizard().email_verification_page_id
183+ self.view.wizard().page(None).controller.set_titles()
184 self.mocker.replay()
185 self.controller.set_next_validation()
186
187@@ -407,6 +410,9 @@
188 self.view.setTitle(self.title)
189 self.view.setSubTitle(self.subtitle)
190 self.view.ui.terms_webkit.load(ANY)
191+ self.view.ui.tos_link_label.setText(
192+ TOS_LABEL %
193+ {'url': self.url})
194 self.mocker.replay()
195 self.controller.setupUi(self.view)
196
197@@ -442,7 +448,12 @@
198 def test_set_titles(self):
199 """Test that the titles are set."""
200 self.view.setTitle(VERIFY_EMAIL_TITLE)
201- self.view.setSubTitle(VERIFY_EMAIL_CONTENT)
202+ self.view.wizard().app_name
203+ self.view.wizard().field("email_address").toString()
204+ self.view.setSubTitle(VERIFY_EMAIL_CONTENT % {
205+ "app_name": None,
206+ "email": None,
207+ })
208 self.mocker.replay()
209 self.controller._set_titles()
210
211
212=== modified file 'ubuntu_sso/utils/ui.py'
213--- ubuntu_sso/utils/ui.py 2011-06-29 22:19:49 +0000
214+++ ubuntu_sso/utils/ui.py 2011-07-04 22:28:33 +0000
215@@ -99,6 +99,7 @@
216 ' to complete creating your %(app_name)s account')
217 VERIFY_EMAIL_LABEL = ('<b>%s</b>\n\n' % VERIFY_EMAIL_TITLE +
218 VERIFY_EMAIL_CONTENT)
219+TOS_LABEL = _("You can also find these terms at <a href='%(url)s'>%(url)s</a>")
220 YES_TO_TC = _('I agree with the %(app_name)s terms and conditions')
221 YES_TO_UPDATES = _('Yes! Email me %(app_name)s tips and updates.')
222 CAPTCHA_RELOAD_TOOLTIP = _('Reload')

Subscribers

People subscribed via source and target branches