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

Subscribers

People subscribed via source and target branches