Merge lp:~diegosarmentero/ubuntu-sso-client/sso-styling into lp:ubuntu-sso-client
- sso-styling
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Natalia Bidart |
Approved revision: | 879 |
Merged at revision: | 881 |
Proposed branch: | lp:~diegosarmentero/ubuntu-sso-client/sso-styling |
Merge into: | lp:ubuntu-sso-client |
Prerequisite: | lp:~diegosarmentero/ubuntu-sso-client/931452 |
Diff against target: |
593 lines (+231/-21) 14 files modified
data/qt/resources.qrc (+10/-0) data/qt/setup_account.ui (+35/-2) data/qt/stylesheet.qss (+119/-0) ubuntu_sso/qt/common.py (+1/-0) ubuntu_sso/qt/current_user_sign_in_page.py (+9/-1) ubuntu_sso/qt/enhanced_check_box.py (+5/-2) ubuntu_sso/qt/forgotten_password_page.py (+10/-4) ubuntu_sso/qt/gui.py (+4/-3) ubuntu_sso/qt/main.py (+13/-1) ubuntu_sso/qt/reset_password_page.py (+3/-1) ubuntu_sso/qt/tests/test_current_user_sign_in_page.py (+6/-0) ubuntu_sso/qt/tests/test_enhanced_check_box.py (+0/-7) ubuntu_sso/qt/tests/test_forgotten_password.py (+15/-0) ubuntu_sso/qt/ubuntu_sso_wizard.py (+1/-0) |
To merge this branch: | bzr merge lp:~diegosarmentero/ubuntu-sso-client/sso-styling |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Natalia Bidart (community) | Approve | ||
Review via email: mp+93475@code.launchpad.net |
Commit message
- Add stylesheets for the Qt UI.
Description of the change
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
The attempt to merge lp:~diegosarmentero/ubuntu-sso-client/sso-styling into lp:ubuntu-sso-client failed. Below is the output from the failed tests.
*** Running GTK test suite for ubuntu_sso ***
twisted.
TestCase
runTest ... [OK]
ubuntu_
TestGetHostname
test_
test_
TestTokenName
test_
test_
test_
test_
test_
twisted.
TestCase
runTest ... [OK]
ubuntu_
TestKeyring
test_
test_
test_
test_
test_
test_
test_
ubuntu_
NetworkManage
test_
test_
NetworkManage
test_
test_
test_
test_
test_nm_offline ... [OK]
test_
test_
test_
test_
test_
ubuntu_sso.tests
TestCase
runTest ... [OK]
ubuntu_
TestConnection
test_
test_
test_
test_
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
The attempt to merge lp:~diegosarmentero/ubuntu-sso-client/sso-styling into lp:ubuntu-sso-client failed. Below is the output from the failed tests.
*** Running GTK test suite for ubuntu_sso ***
twisted.
TestCase
runTest ... [OK]
ubuntu_
TestGetHostname
test_
test_
TestTokenName
test_
test_
test_
test_
test_
twisted.
TestCase
runTest ... [OK]
ubuntu_
TestKeyring
test_
test_
test_
test_
test_
test_
test_
ubuntu_
NetworkManage
test_
test_
NetworkManage
test_
test_
test_
test_
test_nm_offline ... [OK]
test_
test_
test_
test_
test_
ubuntu_sso.tests
TestCase
runTest ... [OK]
ubuntu_
TestConnection
test_
test_
test_
test_
Ubuntu One Auto Pilot (otto-pilot) wrote : | # |
No proposals found for merge of lp:~diegosarmentero/ubuntu-sso-client/931452 into lp:ubuntu-sso-client.
Preview Diff
1 | === added file 'data/Ubuntu-B.ttf' |
2 | Binary files data/Ubuntu-B.ttf 1970-01-01 00:00:00 +0000 and data/Ubuntu-B.ttf 2012-02-17 21:24:20 +0000 differ |
3 | === added file 'data/Ubuntu-R.ttf' |
4 | Binary files data/Ubuntu-R.ttf 1970-01-01 00:00:00 +0000 and data/Ubuntu-R.ttf 2012-02-17 21:24:20 +0000 differ |
5 | === added file 'data/balloon_shape.png' |
6 | Binary files data/balloon_shape.png 1970-01-01 00:00:00 +0000 and data/balloon_shape.png 2012-02-17 21:24:20 +0000 differ |
7 | === added file 'data/password_hint_ok.png' |
8 | Binary files data/password_hint_ok.png 1970-01-01 00:00:00 +0000 and data/password_hint_ok.png 2012-02-17 21:24:20 +0000 differ |
9 | === added file 'data/password_hint_warning.png' |
10 | Binary files data/password_hint_warning.png 1970-01-01 00:00:00 +0000 and data/password_hint_warning.png 2012-02-17 21:24:20 +0000 differ |
11 | === added file 'data/qt/resources.qrc' |
12 | --- data/qt/resources.qrc 1970-01-01 00:00:00 +0000 |
13 | +++ data/qt/resources.qrc 2012-02-17 21:24:20 +0000 |
14 | @@ -0,0 +1,10 @@ |
15 | +<RCC> |
16 | + <qresource prefix="/"> |
17 | + <file>../password_hint_ok.png</file> |
18 | + <file>../password_hint_warning.png</file> |
19 | + <file>../Ubuntu-R.ttf</file> |
20 | + <file>../Ubuntu-B.ttf</file> |
21 | + <file>../balloon_shape.png</file> |
22 | + <file>stylesheet.qss</file> |
23 | + </qresource> |
24 | +</RCC> |
25 | |
26 | === modified file 'data/qt/setup_account.ui' |
27 | --- data/qt/setup_account.ui 2012-02-02 15:44:18 +0000 |
28 | +++ data/qt/setup_account.ui 2012-02-17 21:24:20 +0000 |
29 | @@ -221,6 +221,22 @@ |
30 | <number>3</number> |
31 | </property> |
32 | <item> |
33 | + <spacer name="verticalSpacer_4"> |
34 | + <property name="orientation"> |
35 | + <enum>Qt::Vertical</enum> |
36 | + </property> |
37 | + <property name="sizeType"> |
38 | + <enum>QSizePolicy::Fixed</enum> |
39 | + </property> |
40 | + <property name="sizeHint" stdset="0"> |
41 | + <size> |
42 | + <width>20</width> |
43 | + <height>10</height> |
44 | + </size> |
45 | + </property> |
46 | + </spacer> |
47 | + </item> |
48 | + <item> |
49 | <widget class="QLabel" name="password_label"> |
50 | <property name="font"> |
51 | <font> |
52 | @@ -283,6 +299,22 @@ |
53 | <number>3</number> |
54 | </property> |
55 | <item> |
56 | + <spacer name="verticalSpacer_5"> |
57 | + <property name="orientation"> |
58 | + <enum>Qt::Vertical</enum> |
59 | + </property> |
60 | + <property name="sizeType"> |
61 | + <enum>QSizePolicy::Fixed</enum> |
62 | + </property> |
63 | + <property name="sizeHint" stdset="0"> |
64 | + <size> |
65 | + <width>20</width> |
66 | + <height>10</height> |
67 | + </size> |
68 | + </property> |
69 | + </spacer> |
70 | + </item> |
71 | + <item> |
72 | <widget class="QLabel" name="confirm_password_label"> |
73 | <property name="font"> |
74 | <font> |
75 | @@ -576,7 +608,7 @@ |
76 | <item row="6" column="1" rowspan="2"> |
77 | <widget class="QLabel" name="password_assistance"> |
78 | <property name="sizePolicy"> |
79 | - <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> |
80 | + <sizepolicy hsizetype="Maximum" vsizetype="Minimum"> |
81 | <horstretch>0</horstretch> |
82 | <verstretch>0</verstretch> |
83 | </sizepolicy> |
84 | @@ -584,7 +616,7 @@ |
85 | <property name="minimumSize"> |
86 | <size> |
87 | <width>220</width> |
88 | - <height>0</height> |
89 | + <height>100</height> |
90 | </size> |
91 | </property> |
92 | <property name="maximumSize"> |
93 | @@ -663,5 +695,6 @@ |
94 | </item> |
95 | </layout> |
96 | </widget> |
97 | + <resources/> |
98 | <connections/> |
99 | </ui> |
100 | |
101 | === added file 'data/qt/stylesheet.qss' |
102 | --- data/qt/stylesheet.qss 1970-01-01 00:00:00 +0000 |
103 | +++ data/qt/stylesheet.qss 2012-02-17 21:24:20 +0000 |
104 | @@ -0,0 +1,119 @@ |
105 | +QWidget { |
106 | + font-family: "Ubuntu"; |
107 | + color: #333333; |
108 | +} |
109 | + |
110 | +QWizard, |
111 | +QDialog { |
112 | + background-color: white; |
113 | +} |
114 | + |
115 | +QLabel#password_assistance { |
116 | + border-image: url(":/balloon_shape.png"); |
117 | +} |
118 | + |
119 | +QLineEdit { |
120 | + border: 1px solid #aea79f; |
121 | +} |
122 | + |
123 | +QPushButton { |
124 | + border-radius: 5px; |
125 | + border-style: solid; |
126 | + padding: 6px; |
127 | + padding-left: 20px; |
128 | + padding-right: 20px; |
129 | + border-width: 1px; |
130 | + height: 14px; |
131 | +} |
132 | + |
133 | +QPushButton[default="true"] { |
134 | + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, |
135 | + stop: 0 #fe9e84,stop: 1.0 #dd4814); |
136 | + color: white; |
137 | + border-color: #999999; |
138 | +} |
139 | + |
140 | +QPushButton:hover[default="true"] { |
141 | + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, |
142 | + stop: 0 #ffb19c,stop: 1.0 #dd4814); |
143 | + color: white; |
144 | + border-color: #999999; |
145 | +} |
146 | + |
147 | +QPushButton:pressed[default="true"] { |
148 | + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, |
149 | + stop: 0 #b93f14,stop: 1.0 #dd4814); |
150 | + color: white; |
151 | + border-color: #999999; |
152 | +} |
153 | + |
154 | +QPushButton[default="false"] { |
155 | + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, |
156 | + stop: 0 #ffffff,stop: 1.0 #e6e6e6); |
157 | + color: #333333; |
158 | + border-color: #999999; |
159 | +} |
160 | + |
161 | +QPushButton:hover[default="false"] { |
162 | + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, |
163 | + stop: 0 #ffffff,stop: 1.0 #ededed); |
164 | + color: #333333; |
165 | + border-color: #999999; |
166 | +} |
167 | + |
168 | +QPushButton:pressed[default="false"] { |
169 | + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, |
170 | + stop: 0 #d9d9d9,stop: 1.0 #fefefe); |
171 | + color: #333333; |
172 | + border-color: #999999; |
173 | +} |
174 | + |
175 | +QPushButton[DisabledState="true"] { |
176 | + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, |
177 | + stop: 0 #eaeaea, stop: 1.0 #cacaca); |
178 | + color: #595959; |
179 | + border-color: #939389; |
180 | +} |
181 | + |
182 | +QPushButton[DisabledState="false"] { |
183 | + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, |
184 | + stop: 0 #fe9e84,stop: 1.0 #dd4814); |
185 | + color: white; |
186 | + border-color: #999999; |
187 | +} |
188 | + |
189 | +QPushButton:hover[DisabledState="false"] { |
190 | + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, |
191 | + stop: 0 #ffb19c,stop: 1.0 #dd4814); |
192 | + color: white; |
193 | + border-color: #999999; |
194 | +} |
195 | + |
196 | +QPushButton:pressed[DisabledState="false"] { |
197 | + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, |
198 | + stop: 0 #b93f14,stop: 1.0 #dd4814); |
199 | + color: white; |
200 | + border-color: #999999; |
201 | +} |
202 | + |
203 | +QFrame#frm_box { |
204 | + background: #ffffff; |
205 | + border-radius: 5px; |
206 | + border-style: solid; |
207 | + border-color: #939389; |
208 | + border-width: 1px; |
209 | + color: white; |
210 | + min-height: 100px; |
211 | +} |
212 | + |
213 | +QFrame#frm_box > QLabel { |
214 | + font-size: 20px; |
215 | +} |
216 | + |
217 | +QLabel#title_label { |
218 | + font-size: 20px; |
219 | +} |
220 | + |
221 | +QFrame#header { |
222 | + padding: 10px; |
223 | +} |
224 | |
225 | === modified file 'ubuntu_sso/qt/common.py' |
226 | --- ubuntu_sso/qt/common.py 2012-02-09 19:21:09 +0000 |
227 | +++ ubuntu_sso/qt/common.py 2012-02-17 21:24:20 +0000 |
228 | @@ -18,6 +18,7 @@ |
229 | """Common functionality used by the UI modules.""" |
230 | |
231 | import re |
232 | + |
233 | from ubuntu_sso.utils.ui import ( |
234 | PASSWORD_DIGIT, |
235 | PASSWORD_LENGTH, |
236 | |
237 | === modified file 'ubuntu_sso/qt/current_user_sign_in_page.py' |
238 | --- ubuntu_sso/qt/current_user_sign_in_page.py 2012-02-14 14:38:23 +0000 |
239 | +++ ubuntu_sso/qt/current_user_sign_in_page.py 2012-02-17 21:24:20 +0000 |
240 | @@ -35,7 +35,8 @@ |
241 | ) |
242 | |
243 | |
244 | -FORGOTTEN_PASSWORD_LINK_STYLE = '<a href="#">{forgotten_text}</a>' |
245 | +FORGOTTEN_PASSWORD_LINK_STYLE = ('<a href="#" style="color:#dd4814;">' |
246 | + '{forgotten_text}</a>') |
247 | |
248 | |
249 | _ = gettext.gettext |
250 | @@ -105,6 +106,10 @@ |
251 | self.ui.sign_in_button.style().polish( |
252 | self.ui.sign_in_button) |
253 | |
254 | + def cleanupPage(self): |
255 | + """Reset the wizard buttons.""" |
256 | + self.wizard().setButtonLayout([QtGui.QWizard.Stretch]) |
257 | + |
258 | def _set_translated_strings(self): |
259 | """Set the translated strings.""" |
260 | logger.debug('CurrentUserSignInPage._set_translated_strings') |
261 | @@ -150,6 +155,7 @@ |
262 | else: |
263 | f = self.backend.login |
264 | |
265 | + self.overlay.show() |
266 | error_handler = partial(self._handle_error, f, self.on_login_error) |
267 | f(*args, reply_handler=NO_OP, error_handler=error_handler) |
268 | |
269 | @@ -158,12 +164,14 @@ |
270 | # let the user know |
271 | logger.error('Got error when login %s, error: %s', |
272 | self.app_name, error) |
273 | + self.overlay.hide() |
274 | self.message_box.critical(self, self.app_name, |
275 | build_general_error_message(error)) |
276 | |
277 | def on_logged_in(self, app_name, result): |
278 | """We managed to log in.""" |
279 | logger.info('Logged in for %s', app_name) |
280 | + self.overlay.hide() |
281 | email = unicode(self.ui.email_edit.text()) |
282 | self.userLoggedIn.emit(app_name, email) |
283 | logger.debug('Wizard.loginSuccess emitted.') |
284 | |
285 | === modified file 'ubuntu_sso/qt/enhanced_check_box.py' |
286 | --- ubuntu_sso/qt/enhanced_check_box.py 2012-02-02 15:57:02 +0000 |
287 | +++ ubuntu_sso/qt/enhanced_check_box.py 2012-02-17 21:24:20 +0000 |
288 | @@ -18,7 +18,7 @@ |
289 | |
290 | """Customized Check Box to support links.""" |
291 | |
292 | -from PyQt4 import QtGui |
293 | +from PyQt4 import QtGui, QtCore |
294 | |
295 | |
296 | class EnhancedCheckBox(QtGui.QCheckBox): |
297 | @@ -28,9 +28,12 @@ |
298 | QtGui.QCheckBox.__init__(self) |
299 | hbox = QtGui.QHBoxLayout() |
300 | self.text_label = QtGui.QLabel(text) |
301 | + self.text_label.setAlignment(QtCore.Qt.AlignTop) |
302 | self.text_label.setOpenExternalLinks(True) |
303 | padding = self.iconSize().width() |
304 | - self.text_label.setStyleSheet("padding-left: {0}px;".format(padding)) |
305 | + self.text_label.setStyleSheet("margin-top: -3px;" |
306 | + "padding-left: {0}px;".format(padding)) |
307 | + hbox.setContentsMargins(padding, 0, 0, 0) |
308 | hbox.addWidget(self.text_label) |
309 | self.setLayout(hbox) |
310 | |
311 | |
312 | === modified file 'ubuntu_sso/qt/forgotten_password_page.py' |
313 | --- ubuntu_sso/qt/forgotten_password_page.py 2012-02-15 18:07:10 +0000 |
314 | +++ ubuntu_sso/qt/forgotten_password_page.py 2012-02-17 21:24:20 +0000 |
315 | @@ -142,16 +142,20 @@ |
316 | def _connect_ui(self): |
317 | """Connect the diff signals from the Ui.""" |
318 | self.email_address_line_edit.textChanged.connect(self._validate) |
319 | + |
320 | + self.send_button.clicked.connect(self.request_new_password) |
321 | + self.try_again_button.clicked.connect(self.on_try_again) |
322 | + |
323 | + def request_new_password(self): |
324 | + """Send the request password operation.""" |
325 | args = (self.app_name, self.email_address) |
326 | f = self.backend.request_password_reset_token |
327 | |
328 | error_handler = partial(self._handle_error, f, |
329 | self.on_password_reset_error) |
330 | |
331 | - self.send_button.clicked.connect( |
332 | - lambda: f(*args, reply_handler=NO_OP, |
333 | - error_handler=error_handler)) |
334 | - self.try_again_button.clicked.connect(self.on_try_again) |
335 | + self.overlay.show() |
336 | + f(*args, reply_handler=NO_OP, error_handler=error_handler) |
337 | |
338 | def _validate(self): |
339 | """Validate that we have an email.""" |
340 | @@ -171,12 +175,14 @@ |
341 | def on_password_reset_token_sent(self, app_name, result): |
342 | """Action taken when we managed to get the password reset done.""" |
343 | # ignore the result and move to the reset page |
344 | + self.overlay.hide() |
345 | self.passwordResetTokenSent.emit() |
346 | # pylint: enable=W0212 |
347 | |
348 | def on_password_reset_error(self, app_name, error): |
349 | """Action taken when there was an error requesting the reset.""" |
350 | # set the error message |
351 | + self.overlay.hide() |
352 | msg = REQUEST_PASSWORD_TOKEN_TECH_ERROR |
353 | if error['errtype'] == 'ResetPasswordTokenError': |
354 | # the account provided is wrong, lets tell the user to try |
355 | |
356 | === modified file 'ubuntu_sso/qt/gui.py' |
357 | --- ubuntu_sso/qt/gui.py 2012-02-14 14:38:23 +0000 |
358 | +++ ubuntu_sso/qt/gui.py 2012-02-17 21:24:20 +0000 |
359 | @@ -23,8 +23,8 @@ |
360 | from PyQt4.QtCore import Qt |
361 | from PyQt4.QtGui import ( |
362 | QApplication, |
363 | - QWidget, |
364 | QCursor, |
365 | + QFrame, |
366 | QHBoxLayout, |
367 | QVBoxLayout, |
368 | QMessageBox, |
369 | @@ -44,12 +44,13 @@ |
370 | logger = setup_logging('ubuntu_sso.gui') |
371 | |
372 | |
373 | -class Header(QWidget): |
374 | +class Header(QFrame): |
375 | """Header Class for Title and Subtitle in all wizard pages.""" |
376 | |
377 | def __init__(self): |
378 | """Create a new instance.""" |
379 | - QWidget.__init__(self) |
380 | + super(Header, self).__init__() |
381 | + self.setObjectName('header') |
382 | vbox = QVBoxLayout(self) |
383 | vbox.setContentsMargins(0, 0, 0, 10) |
384 | self.title_label = QLabel() |
385 | |
386 | === modified file 'ubuntu_sso/qt/main.py' |
387 | --- ubuntu_sso/qt/main.py 2012-02-13 15:43:59 +0000 |
388 | +++ ubuntu_sso/qt/main.py 2012-02-17 21:24:20 +0000 |
389 | @@ -18,14 +18,26 @@ |
390 | |
391 | import sys |
392 | |
393 | -from PyQt4 import QtGui |
394 | +from PyQt4 import QtGui, QtCore |
395 | |
396 | +# Module used to include the resources into this file |
397 | +# Unused import resources_rc, pylint: disable=W0611 |
398 | +from ubuntu_sso.qt.ui import resources_rc |
399 | +# pylint: enable=W0611 |
400 | from ubuntu_sso.qt.ubuntu_sso_wizard import UbuntuSSOClientGUI |
401 | |
402 | |
403 | def main(**kwargs): |
404 | """Start the QT mainloop and open the main window.""" |
405 | app = QtGui.QApplication(sys.argv) |
406 | + |
407 | + QtGui.QFontDatabase.addApplicationFont(':/Ubuntu-R.ttf') |
408 | + QtGui.QFontDatabase.addApplicationFont(':/Ubuntu-B.ttf') |
409 | + |
410 | + # Apply Style Sheet -- The windows version may be different |
411 | + qss = QtCore.QResource(":/stylesheet.qss") |
412 | + app.setStyleSheet(qss.data()) |
413 | + |
414 | # Unused variable 'ui', pylint: disable=W0612 |
415 | ui = UbuntuSSOClientGUI(close_callback=app.exit, **kwargs) |
416 | app.exec_() |
417 | |
418 | === modified file 'ubuntu_sso/qt/reset_password_page.py' |
419 | --- ubuntu_sso/qt/reset_password_page.py 2012-02-15 17:33:40 +0000 |
420 | +++ ubuntu_sso/qt/reset_password_page.py 2012-02-17 21:24:20 +0000 |
421 | @@ -178,14 +178,15 @@ |
422 | |
423 | def on_password_changed(self, app_name, result): |
424 | """Let user know that the password was changed.""" |
425 | + self.overlay.hide() |
426 | email = unicode(self.wizard().forgotten.ui.email_line_edit.text()) |
427 | - self.overlay.hide() |
428 | self.passwordChanged.emit(email) |
429 | |
430 | def on_password_change_error(self, app_name, error): |
431 | """Let the user know that there was an error.""" |
432 | logger.error('Got error changing password for %s, error: %s', |
433 | self.app_name, error) |
434 | + self.overlay.hide() |
435 | self.message_box.critical(self, self.app_name, |
436 | build_general_error_message(error)) |
437 | |
438 | @@ -200,6 +201,7 @@ |
439 | f = self.backend.set_new_password |
440 | error_handler = partial(self._handle_error, f, |
441 | self.on_password_change_error) |
442 | + self.overlay.show() |
443 | f(*args, reply_handler=NO_OP, error_handler=error_handler) |
444 | |
445 | def is_correct_password_confirmation(self, password): |
446 | |
447 | === modified file 'ubuntu_sso/qt/tests/test_current_user_sign_in_page.py' |
448 | --- ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-02-15 17:33:40 +0000 |
449 | +++ ubuntu_sso/qt/tests/test_current_user_sign_in_page.py 2012-02-17 21:24:20 +0000 |
450 | @@ -25,6 +25,7 @@ |
451 | BaseTestCase, |
452 | FakedBackend, |
453 | FakedObject, |
454 | + FakeOverlay, |
455 | FakePageUiStyle, |
456 | FakeSignal, |
457 | FakeWizard, |
458 | @@ -40,6 +41,7 @@ |
459 | @defer.inlineCallbacks |
460 | def setUp(self): |
461 | yield super(CurrentUserSignInTestCase, self).setUp() |
462 | + self.patch(gui, "LoadingOverlay", FakeOverlay) |
463 | self.patch(gui.main, "get_sso_client", FakedBackend) |
464 | self.signals_results = [] |
465 | self.patch(current_user_sign_in_page.CurrentUserSignInPage, |
466 | @@ -185,6 +187,7 @@ |
467 | self.ui.ui.email_edit.setText(email) |
468 | self.ui.ui.password_edit.setText(password) |
469 | self.ui.login() |
470 | + self.assertEqual(self.ui.overlay.show_counter, 1) |
471 | self.assert_backend_called('login_and_ping', |
472 | self.app_name, email, password, ping) |
473 | |
474 | @@ -200,6 +203,7 @@ |
475 | self.ui.ui.email_edit.setText(email) |
476 | self.ui.ui.password_edit.setText(password) |
477 | self.ui.login() |
478 | + self.assertEqual(self.ui.overlay.show_counter, 1) |
479 | self.assert_backend_called('login', |
480 | self.app_name, email, password) |
481 | |
482 | @@ -210,6 +214,7 @@ |
483 | self.ui.app_name = app_name |
484 | error = {'errtype': 'UserNotValidated'} |
485 | self.ui.on_login_error(app_name, error) |
486 | + self.assertEqual(self.ui.overlay.hide_counter, 2) |
487 | expected = ((self.ui, 'my_app', ''), {}) |
488 | self.assertTrue(expected, self._called) |
489 | |
490 | @@ -225,6 +230,7 @@ |
491 | self.signals_results.append((app, email)) |
492 | self.ui.userLoggedIn.connect(slot) |
493 | self.ui.on_logged_in(app_name, None) |
494 | + self.assertEqual(self.ui.overlay.hide_counter, 2) |
495 | self.assertIn((app_name, email), self.signals_results) |
496 | |
497 | def test_on_forgotten_password(self): |
498 | |
499 | === modified file 'ubuntu_sso/qt/tests/test_enhanced_check_box.py' |
500 | --- ubuntu_sso/qt/tests/test_enhanced_check_box.py 2012-02-02 15:57:02 +0000 |
501 | +++ ubuntu_sso/qt/tests/test_enhanced_check_box.py 2012-02-17 21:24:20 +0000 |
502 | @@ -1,6 +1,4 @@ |
503 | # -*- coding: utf-8 -*- |
504 | - |
505 | -# Authors: Diego Sarmentero <diego.sarmentero@canonical.com> |
506 | # |
507 | # Copyright 2011 Canonical Ltd. |
508 | # |
509 | @@ -18,8 +16,6 @@ |
510 | |
511 | """Tests for the EnhancedCheckBox widget.""" |
512 | |
513 | -import re |
514 | - |
515 | from PyQt4 import QtCore |
516 | |
517 | from ubuntu_sso.qt import enhanced_check_box |
518 | @@ -34,9 +30,6 @@ |
519 | check = enhanced_check_box.EnhancedCheckBox("text") |
520 | self.assertEqual(check.text(), "text") |
521 | self.assertTrue(check.text_label.openExternalLinks()) |
522 | - style_sheet = unicode(check.text_label.styleSheet()) |
523 | - size = re.sub("\D", "", style_sheet) |
524 | - self.assertEqual(check.iconSize().width(), int(size)) |
525 | self.assertEqual(check.receivers( |
526 | QtCore.SIGNAL('stateChanged(int)')), 1) |
527 | |
528 | |
529 | === modified file 'ubuntu_sso/qt/tests/test_forgotten_password.py' |
530 | --- ubuntu_sso/qt/tests/test_forgotten_password.py 2012-02-17 12:59:24 +0000 |
531 | +++ ubuntu_sso/qt/tests/test_forgotten_password.py 2012-02-17 21:24:20 +0000 |
532 | @@ -25,6 +25,7 @@ |
533 | BaseTestCase, |
534 | FakedBackend, |
535 | FakedObject, |
536 | + FakeOverlay, |
537 | FakePageUiStyle, |
538 | FakeSignal, |
539 | FakeWizard, |
540 | @@ -40,6 +41,7 @@ |
541 | def setUp(self): |
542 | yield super(ForgottenPasswordTestCase, self).setUp() |
543 | self.signals_results = [] |
544 | + self.patch(gui, "LoadingOverlay", FakeOverlay) |
545 | self.patch(gui.main, "get_sso_client", FakedBackend) |
546 | self.patch(forgotten_password_page.ForgottenPasswordPage, |
547 | "passwordResetTokenSent", FakeSignal()) |
548 | @@ -58,6 +60,17 @@ |
549 | self.assertTrue(callable(self.ui._signals['PasswordResetError'])) |
550 | self.assertEqual(self.ui.backend, FakedBackend.sso_login) |
551 | |
552 | + def test_request_new_password(self): |
553 | + """Test the request_new_password function.""" |
554 | + app_name = 'my_app' |
555 | + email = 'email@example.com' |
556 | + self.ui.app_name = app_name |
557 | + self.ui.ui.email_line_edit.setText(email) |
558 | + self.ui.request_new_password() |
559 | + self.assertEqual(self.ui.overlay.show_counter, 1) |
560 | + self.assert_backend_called('request_password_reset_token', |
561 | + app_name, email) |
562 | + |
563 | def test_setup_page(self): |
564 | """Test that the backend is received and the methods are called.""" |
565 | exposed_methods = [ |
566 | @@ -218,6 +231,7 @@ |
567 | self.signals_results.append(1) |
568 | self.ui.passwordResetTokenSent.connect(slot) |
569 | self.ui.on_password_reset_token_sent('app_name', {}) |
570 | + self.assertEqual(self.ui.overlay.hide_counter, 2) |
571 | self.assertTrue(1 in self.signals_results) |
572 | |
573 | def test_on_password_reset_error(self): |
574 | @@ -234,6 +248,7 @@ |
575 | self.assertFalse(self.ui.email_widget.isVisible()) |
576 | self.assertFalse(self.ui.forgotted_password_intro_label.isVisible()) |
577 | self.assertTrue(self.ui.try_again_widget.isVisible()) |
578 | + self.assertEqual(self.ui.overlay.hide_counter, 2) |
579 | |
580 | def test_on_password_reset_error_with_token_error(self): |
581 | """Test on_password_reset_error method.""" |
582 | |
583 | === modified file 'ubuntu_sso/qt/ubuntu_sso_wizard.py' |
584 | --- ubuntu_sso/qt/ubuntu_sso_wizard.py 2012-02-14 18:42:00 +0000 |
585 | +++ ubuntu_sso/qt/ubuntu_sso_wizard.py 2012-02-17 21:24:20 +0000 |
586 | @@ -151,6 +151,7 @@ |
587 | self.setWizardStyle(QWizard.ModernStyle) |
588 | self.button(QWizard.CancelButton).clicked.connect( |
589 | self.on_user_cancelation) |
590 | + self.resize(550, 500) |
591 | |
592 | # pylint: disable=C0103 |
593 | def nextId(self): |
Looks good! There are some minor details that will be addressed in some other branches.