Merge lp:~ralsina/ubuntuone-windows-installer/fix_804562 into lp:ubuntuone-windows-installer

Proposed by Roberto Alsina
Status: Merged
Approved by: Roberto Alsina
Approved revision: 20
Merged at revision: 14
Proposed branch: lp:~ralsina/ubuntuone-windows-installer/fix_804562
Merge into: lp:ubuntuone-windows-installer
Diff against target: 95 lines (+64/-2)
2 files modified
ubuntuone_installer/gui/qt/gui.py (+3/-2)
ubuntuone_installer/gui/qt/tos.py (+61/-0)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-windows-installer/fix_804562
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Alejandro J. Cura (community) Approve
Review via email: mp+66672@code.launchpad.net

Commit message

Bring the TOS page up to spec.

Description of the change

Bring the TOS page up to spec.

It only does that in part:

* Set the right buttons
* Add print button for TOS

The rest of the spec is implented in bug #804569

* Add a label with a link to the TOS on the web
* Smaller margins around the embedded browser

The spec: https://launchpadlibrarian.net/74418482/tos_wireframe.png
The product (includes proposed fix from bug #804569): https://launchpadlibrarian.net/74420219/implemented_tos_page.png

To test IRL (Windows):

In one terminal, start ubuntu-sso-client

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

In another terminal, start ubuntuone-windows-installer

set PYTHONPATH=..\ubuntuone-client;..\ubuntuone-control-panel;..\ubuntu-sso-client;.
python bin\ubuntuone-installer-qt

You should have a working print button, and the button order should be:

[Print] [-----------------------] [Disagree & Cancel] [Back]

You should see the correct TOS for Ubuntu One, and all the buttons should work.

To post a comment you must log in.
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Code looks good. Also tested IRL, works fine.

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

Voting does not meet specified criteria. Required: Approve >= 1, Disapprove == 0, Needs Fixing == 0, Needs Information == 0, Resubmit == 0, Pending == 0. Got: 1 Approve, 1 Pending.

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

+1 we are switching to 1-approve in the installer.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntuone_installer/gui/qt/gui.py'
--- ubuntuone_installer/gui/qt/gui.py 2011-07-01 21:08:26 +0000
+++ ubuntuone_installer/gui/qt/gui.py 2011-07-04 20:12:35 +0000
@@ -32,7 +32,6 @@
32 ErrorPage,32 ErrorPage,
33 ForgottenPasswordPage,33 ForgottenPasswordPage,
34 ResetPasswordPage,34 ResetPasswordPage,
35 TosPage,
36)35)
37from ubuntu_sso.qt.choose_sign_in_ui import \36from ubuntu_sso.qt.choose_sign_in_ui import \
38 Ui_ChooseSignInPage37 Ui_ChooseSignInPage
@@ -74,6 +73,7 @@
74from ubuntuone_installer.gui.qt.local_folders import LocalFoldersPage73from ubuntuone_installer.gui.qt.local_folders import LocalFoldersPage
75from ubuntuone_installer.gui.qt.sync_now_or_later import SyncNowOrLaterPage74from ubuntuone_installer.gui.qt.sync_now_or_later import SyncNowOrLaterPage
76from ubuntuone_installer.gui.qt.setup_account import SetupAccountPage75from ubuntuone_installer.gui.qt.setup_account import SetupAccountPage
76from ubuntuone_installer.gui.qt.tos import TosPage
7777
78_ = gettext.gettext78_ = gettext.gettext
79SIGN_IN = _("Sign in to Ubuntu One")79SIGN_IN = _("Sign in to Ubuntu One")
@@ -317,7 +317,8 @@
317 self.setup_controller,317 self.setup_controller,
318 parent=self)318 parent=self)
319 self.tos = TosPage(Ui_TosPage(),319 self.tos = TosPage(Ui_TosPage(),
320 TosController(tos_url=TC_URL),320 TosController(tos_url=TC_URL,
321 title=_("Ubuntu One Terms of Service")),
321 parent=self)322 parent=self)
322 self.email_verification = EmailVerificationPage(323 self.email_verification = EmailVerificationPage(
323 Ui_EmailVerificationPage(),324 Ui_EmailVerificationPage(),
324325
=== added file 'ubuntuone_installer/gui/qt/tos.py'
--- ubuntuone_installer/gui/qt/tos.py 1970-01-01 00:00:00 +0000
+++ ubuntuone_installer/gui/qt/tos.py 2011-07-04 20:12:35 +0000
@@ -0,0 +1,61 @@
1# -*- coding: utf-8 -*-
2
3# Authors: Roberto Alsina <roberto.alsina@canonical.com>
4#
5# Copyright 2011 Canonical Ltd.
6#
7# This program is free software: you can redistribute it and/or modify it
8# under the terms of the GNU General Public License version 3, as published
9# by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranties of
13# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14# PURPOSE. See the GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program. If not, see <http://www.gnu.org/licenses/>.
18
19"""Widget to view the Terms Of Service."""
20
21import gettext
22
23from PyQt4 import QtGui
24
25import ubuntu_sso.qt.gui as sso_gui
26
27_ = gettext.gettext
28
29
30class TosPage(sso_gui.TosPage):
31 def initializePage(self):
32 """Setup UI details."""
33 # Set the right texts and connections for buttons
34 self.setButtonText(QtGui.QWizard.NextButton, _("Agree && Install"))
35 self.setButtonText(QtGui.QWizard.CancelButton,
36 _("Disagree && Cancel"))
37 self.setButtonText(QtGui.QWizard.CustomButton1, _("&Print"))
38
39 # This is just to catch an exception thrown when nothing
40 # is connected to the signal. It's not an exceptional
41 # condition at all.
42 try:
43 self.wizard().customButtonClicked.disconnect()
44 except TypeError:
45 pass
46
47 self.wizard().customButtonClicked.connect(self.print_document)
48
49 self.wizard().setButtonLayout([
50 QtGui.QWizard.CustomButton1,
51 QtGui.QWizard.Stretch,
52 QtGui.QWizard.CancelButton,
53 QtGui.QWizard.BackButton,
54 ])
55
56 def print_document(self, button_id):
57 """Print the document displayed in textBrowser."""
58 if button_id == QtGui.QWizard.CustomButton1:
59 self.previewer = QtGui.QPrintPreviewDialog(
60 paintRequested=self.ui.terms_webkit.print_)
61 self.previewer.exec_()

Subscribers

People subscribed via source and target branches