Merge lp:~ralsina/ubuntuone-control-panel/installer-option into lp:ubuntuone-control-panel

Proposed by Roberto Alsina
Status: Merged
Approved by: Roberto Alsina
Approved revision: 308
Merged at revision: 295
Proposed branch: lp:~ralsina/ubuntuone-control-panel/installer-option
Merge into: lp:ubuntuone-control-panel
Prerequisite: lp:~nataliabidart/ubuntuone-control-panel/license-page
Diff against target: 335 lines (+62/-45)
8 files modified
ubuntuone/controlpanel/gui/qt/controlpanel.py (+8/-0)
ubuntuone/controlpanel/gui/qt/gui.py (+8/-4)
ubuntuone/controlpanel/gui/qt/main/__init__.py (+6/-1)
ubuntuone/controlpanel/gui/qt/main/tests/test_main.py (+9/-3)
ubuntuone/controlpanel/gui/qt/tests/test_controlpanel.py (+10/-0)
ubuntuone/controlpanel/gui/qt/tests/test_start.py (+1/-1)
ubuntuone/controlpanel/gui/qt/tests/test_wizard.py (+11/-23)
ubuntuone/controlpanel/gui/qt/wizard.py (+9/-13)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-control-panel/installer-option
Reviewer Review Type Date Requested Status
Natalia Bidart Approve
Diego Sarmentero (community) Approve
Review via email: mp+98503@code.launchpad.net

Commit message

- Made the license page from the wizard be shown (only when called with --installer) (LP: #933697).

Description of the change

- Added the license page to the wizard (only when called with --installer) (LP: #933697).

To test IRL:

* remove credentials
* If you start u1cp, you will get the "sign in/sign up" page
* Start u1cp again with the --installer option, and you should get a license page, for which the "next" page is "signin / signup"

To post a comment you must log in.
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

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

* I wonder why you added a new method start_from_license instead of redefining setStartId in the QWizard. Any reason not to do that?

* I think that the test_first_page should not be removed, it may need some tweaks so it remains as:

    def test_first_page(self):
        """The first page is the correct one."""
        expected = self.ui.pages[self.ui.signin_page]
        self.assertEqual(self.ui.startId(), expected)

* Can you please fix the indentation of test_start_from_license so the whole 79-columns width are used? Something like (the following may need tweaking if we move to setStartId):

    def test_start_from_license(self):
        """Test the start_from_license method."""
        # Before, we start on sign_in
        assert self.ui.startId() == self.ui.pages[self.ui.signin_page]

        # After calling start_from_license, we start on license_page
        self.ui.start_from_license()
        self.assertEqual(self.ui.startId(), self.ui.pages[self.ui.license_page])

* Why did you need to change the page_id of the buttons dict in UbuntuOneWizardCloudToComputerTestCase, UbuntuOneWizardComputerToCloudTestCase and UbuntuOneWizardSettingsTestCase?

* Why the test_buttons_behavior is skipped for UbuntuOneWizardLicensePage? I see the comment you added but that does not explain to me why you need to redefine/skip it instead of making it pass. Also, why does the NextButton need to be a CommitButton?

* If we're leaving the license 'next' button to be a commit button, we don't need to store the string text of the Next button, so that can be safely removed.

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

> * I wonder why you added a new method start_from_license instead of redefining
> setStartId in the QWizard. Any reason not to do that?

Moed start_from_license into the controlpanel as suggested.

>
> * I think that the test_first_page should not be removed, it may need some
> tweaks so it remains as:
>
> def test_first_page(self):
> """The first page is the correct one."""
> expected = self.ui.pages[self.ui.signin_page]
> self.assertEqual(self.ui.startId(), expected)

That was already covered by the new test_start_from_license test (had that exact assert).
Readded this test now since start_from_license moved, and moved the test for start_from_license
to control panel tests.

> * Can you please fix the indentation of test_start_from_license so the whole
> 79-columns width are used? Something like (the following may need tweaking if
> we move to setStartId):
>
> def test_start_from_license(self):
> """Test the start_from_license method."""
> # Before, we start on sign_in
> assert self.ui.startId() == self.ui.pages[self.ui.signin_page]
>
> # After calling start_from_license, we start on license_page
> self.ui.start_from_license()
> self.assertEqual(self.ui.startId(),
> self.ui.pages[self.ui.license_page])

Ermmmm I like the way I wrote it? It's wider now anyway because the names are longer.

>
> * Why did you need to change the page_id of the buttons dict in
> UbuntuOneWizardCloudToComputerTestCase, UbuntuOneWizardComputerToCloudTestCase
> and UbuntuOneWizardSettingsTestCase?

Because they didn't work. Those are page IDs, and since now the license page is
added as first page, all those tests failed because they IDs moved.

> * Why the test_buttons_behavior is skipped for UbuntuOneWizardLicensePage? I
> see the comment you added but that does not explain to me why you need to
> redefine/skip it instead of making it pass. Also, why does the NextButton need
> to be a CommitButton?

It has to be a CommitButton so the user can't go back to the license page.
The CommitButton doesn't trigger the same signals as NextButton, and can't find
anywhere in the docs what we may expect there. I changed the test slightly so that
we can check the text of the buttons even if they don't trigger anything by
passing None as signal name.

> * If we're leaving the license 'next' button to be a commit button, we don't
> need to store the string text of the Next button, so that can be safely
> removed.

Can't remove it, causes errors later on. Moved it so it doesn't appear to be part
of the license_page setup.

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

> > * If we're leaving the license 'next' button to be a commit button, we don't
> > need to store the string text of the Next button, so that can be safely
> > removed.
>
> Can't remove it, causes errors later on. Moved it so it doesn't appear to be
> part
> of the license_page setup.

The line:

self.next_button_text = self.button(self.NextButton).text()

was added by me so we could restore the text in the NextButton in another page, since before we were cutomizing the text in the NextButton for the license page.

As how this branch is, the NextButton text is never changed, so there is no need to keep that hack in place. You can indeed remove it, but you have to removed from all the methods that is being used on (I tried this myself).

Thanks!

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

> As how this branch is, the NextButton text is never changed, so there is no
> need to keep that hack in place. You can indeed remove it, but you have to
> removed from all the methods that is being used on (I tried this myself).

Ok, removing it everywhere in revno 308

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

Looks great! Also works as expected.

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (94.2 KiB)

The attempt to merge lp:~ralsina/ubuntuone-control-panel/installer-option into lp:ubuntuone-control-panel failed. Below is the output from the failed tests.

*** Running test suite for ubuntuone/controlpanel ***
ubuntuone.controlpanel.utils.tests.test_utils
  ExceptionHandlingTestCase
    test_exception_to_error_dict ... [OK]
    test_failure_to_error_dict ... [OK]
  GetDataFileTestCase
    test_get_data_file ... [OK]
  GetProjectDirTestCase
    test_get_project_dir_none_exists ... [OK]
    test_get_project_dir_relative ... [OK]
  GetProjectDirWithConstantsTestCase
    test_get_project_dir ... [OK]
    test_get_project_dir_none_exists ... [OK]
    test_get_project_dir_relative ... [OK]
ubuntuone.controlpanel.tests
  TestCase
    runTest ... [OK]
ubuntuone.controlpanel.utils.tests.test_linux
  AutoupdaterTestCase
    test_are_updates_present ... [OK]
    test_perform_update ... [OK]
  DefaultFoldersTestCase
    test_default_folders_bad_encoding ... [OK]
    test_default_folders_empty_file ... [OK]
    test_default_folders_non_ascii ... [OK]
    test_default_folders_not_file ... [OK]
    test_default_folders_only_comments ... [OK]
    test_default_folders_parsed ... [OK]
    test_default_folders_syntax_error ... [OK]
ubuntuone.controlpanel.tests
  TestCase
    runTest ... [OK]
ubuntuone.controlpanel.tests.test_replication_client
  ReplicationsTestCase
    test_exclude ... [OK]
    test_exclude_name_in_exclusions ... [OK]
    test_exclude_name_not_in_replications ... [OK]
    test_get_exclusions ... [OK]
    test_get_replications ... [OK]
    test_no_pairing_record ... [OK]
    test_replicate ... [OK]
    test_replicate_name_not_in_exclusions ... [OK]
    test_replicate_name_not_in_replications ... [OK]
ubuntuone.controlpanel.tests
  TestCase
    runTest ... [OK]
ubuntuone.controlpanel.tests.test_sd_client
  AutoconnectTestCase
    test_disable ... [OK]
    test_disable_throws_an_error ... [...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntuone/controlpanel/gui/qt/controlpanel.py'
--- ubuntuone/controlpanel/gui/qt/controlpanel.py 2012-03-19 20:55:52 +0000
+++ ubuntuone/controlpanel/gui/qt/controlpanel.py 2012-03-22 12:49:18 +0000
@@ -170,3 +170,11 @@
170 def on_wizard_finished(self, status):170 def on_wizard_finished(self, status):
171 """Move to controlpanel if wizard ended successfully."""171 """Move to controlpanel if wizard ended successfully."""
172 self.on_credentials_found()172 self.on_credentials_found()
173
174 @log_call(logger.info)
175 def start_from_license(self):
176 """Use the license page as first page."""
177 # license
178 self.ui.wizard.setStartId(self.ui.wizard.pages[
179 self.ui.wizard.license_page])
180 self.ui.wizard.restart()
173181
=== modified file 'ubuntuone/controlpanel/gui/qt/gui.py'
--- ubuntuone/controlpanel/gui/qt/gui.py 2012-03-06 21:33:23 +0000
+++ ubuntuone/controlpanel/gui/qt/gui.py 2012-03-22 12:49:18 +0000
@@ -35,7 +35,7 @@
35class MainWindow(QtGui.QMainWindow):35class MainWindow(QtGui.QMainWindow):
36 """The Main Window of the Control Panel."""36 """The Main Window of the Control Panel."""
3737
38 def __init__(self, close_callback=None):38 def __init__(self, close_callback=None, installer=False):
39 """Initialize this instance with the UI layout."""39 """Initialize this instance with the UI layout."""
40 super(MainWindow, self).__init__()40 super(MainWindow, self).__init__()
41 self.ui = mainwindow_ui.Ui_MainWindow()41 self.ui = mainwindow_ui.Ui_MainWindow()
@@ -46,6 +46,9 @@
46 triggered=self.close)46 triggered=self.close)
47 self.quit_action.setShortcuts(["Ctrl+q", "Ctrl+w"])47 self.quit_action.setShortcuts(["Ctrl+q", "Ctrl+w"])
48 self.addAction(self.quit_action)48 self.addAction(self.quit_action)
49 self.installer = installer
50 if installer:
51 self.ui.control_panel.start_from_license()
49 if USE_LIBUNITY:52 if USE_LIBUNITY:
50 self.entry = Unity.LauncherEntry.get_for_desktop_id(U1_DOTDESKTOP)53 self.entry = Unity.LauncherEntry.get_for_desktop_id(U1_DOTDESKTOP)
51 else:54 else:
@@ -84,14 +87,15 @@
84 # pylint: enable=C010387 # pylint: enable=C0103
8588
8689
87def start(close_callback, minimized=False, with_icon=False):90def start(close_callback, minimized=False, with_icon=False, installer=False):
88 """Show the UI elements."""91 """Show the UI elements."""
89 # pylint: disable=W0404, F040192 # pylint: disable=W0404, F0401
90 if not minimized:93 if not minimized:
91 if with_icon or minimized:94 if with_icon or minimized:
92 window = MainWindow()95 window = MainWindow(installer=installer)
93 else:96 else:
94 window = MainWindow(close_callback=close_callback)97 window = MainWindow(close_callback=close_callback,
98 installer=installer)
95 app = QtGui.QApplication.instance()99 app = QtGui.QApplication.instance()
96 style = QtGui.QStyle.alignedRect(100 style = QtGui.QStyle.alignedRect(
97 QtCore.Qt.LeftToRight, QtCore.Qt.AlignCenter,101 QtCore.Qt.LeftToRight, QtCore.Qt.AlignCenter,
98102
=== modified file 'ubuntuone/controlpanel/gui/qt/main/__init__.py'
--- ubuntuone/controlpanel/gui/qt/main/__init__.py 2012-03-16 21:09:40 +0000
+++ ubuntuone/controlpanel/gui/qt/main/__init__.py 2012-03-22 12:49:18 +0000
@@ -55,6 +55,9 @@
55 default=False,55 default=False,
56 help="Start Ubuntu One "56 help="Start Ubuntu One "
57 "with an icon in the notification area.")57 "with an icon in the notification area.")
58 result.add_argument("--installer", dest="installer", action="store_true",
59 default=False,
60 help="Show the license agreement page first.")
58 return result61 return result
5962
6063
@@ -82,6 +85,7 @@
82 switch_to = args.switch_to85 switch_to = args.switch_to
83 minimized = args.minimized86 minimized = args.minimized
84 with_icon = args.with_icon87 with_icon = args.with_icon
88 installer = args.installer
85 source.main(app)89 source.main(app)
8690
87 data = []91 data = []
@@ -92,7 +96,8 @@
9296
93 # Unused variable 'window', 'icon', pylint: disable=W061297 # Unused variable 'window', 'icon', pylint: disable=W0612
94 icon, window = start(lambda: source.main_quit(app),98 icon, window = start(lambda: source.main_quit(app),
95 minimized=minimized, with_icon=with_icon)99 minimized=minimized, with_icon=with_icon,
100 installer=installer)
96 window.switch_to(switch_to)101 window.switch_to(switch_to)
97 # pylint: enable=W0612102 # pylint: enable=W0612
98 if icon:103 if icon:
99104
=== modified file 'ubuntuone/controlpanel/gui/qt/main/tests/test_main.py'
--- ubuntuone/controlpanel/gui/qt/main/tests/test_main.py 2012-03-16 21:14:20 +0000
+++ ubuntuone/controlpanel/gui/qt/main/tests/test_main.py 2012-03-22 12:49:18 +0000
@@ -132,19 +132,19 @@
132 """Ensure the binary name is not given to argparse."""132 """Ensure the binary name is not given to argparse."""
133 main.main(["foo", "bar", sys.argv[0], "--minimized"])133 main.main(["foo", "bar", sys.argv[0], "--minimized"])
134 self.assertEqual(self.start.args[1],134 self.assertEqual(self.start.args[1],
135 {'minimized': True, 'with_icon': False})135 {'minimized': True, 'with_icon': False, 'installer': False})
136136
137 def test_minimized_option(self):137 def test_minimized_option(self):
138 """Ensure the --minimized option is parsed and passed correctly."""138 """Ensure the --minimized option is parsed and passed correctly."""
139 main.main([sys.argv[0], "--minimized"])139 main.main([sys.argv[0], "--minimized"])
140 self.assertEqual(self.start.args[1],140 self.assertEqual(self.start.args[1],
141 {'minimized': True, 'with_icon': False})141 {'minimized': True, 'with_icon': False, 'installer': False})
142142
143 def test_with_icon_option(self):143 def test_with_icon_option(self):
144 """Ensure the --minimized option is parsed and passed correctly."""144 """Ensure the --minimized option is parsed and passed correctly."""
145 main.main([sys.argv[0], "--with-icon"])145 main.main([sys.argv[0], "--with-icon"])
146 self.assertEqual(self.start.args[1],146 self.assertEqual(self.start.args[1],
147 {'minimized': False, 'with_icon': True})147 {'minimized': False, 'with_icon': True, 'installer': False})
148148
149 def test_all_styles_load(self):149 def test_all_styles_load(self):
150 """Ensure the platform style is loaded."""150 """Ensure the platform style is loaded."""
@@ -160,6 +160,12 @@
160 main.main([sys.argv[0], "--switch-to", "folders"])160 main.main([sys.argv[0], "--switch-to", "folders"])
161 self.assertEqual(self.start.window.tabname, "folders")161 self.assertEqual(self.start.window.tabname, "folders")
162162
163 def test_installer_option(self):
164 """Ensure the --installer option is parsed and passed correctly."""
165 main.main([sys.argv[0], "--installer"])
166 self.assertEqual(self.start.args[1],
167 {'minimized': False, 'with_icon': False, 'installer': True})
168
163 def test_translator(self):169 def test_translator(self):
164 """Ensure the Qt translator is loaded."""170 """Ensure the Qt translator is loaded."""
165 main.main([sys.argv[0]])171 main.main([sys.argv[0]])
166172
=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_controlpanel.py'
--- ubuntuone/controlpanel/gui/qt/tests/test_controlpanel.py 2012-03-19 15:50:31 +0000
+++ ubuntuone/controlpanel/gui/qt/tests/test_controlpanel.py 2012-03-22 12:49:18 +0000
@@ -186,6 +186,16 @@
186 remote = self.ui.ui.folders_tab.remote_folders186 remote = self.ui.ui.folders_tab.remote_folders
187 self.assertFalse(remote)187 self.assertFalse(remote)
188188
189 def test_start_from_license(self):
190 """Ensure we change the starting page correctly."""
191 # Before, we start on sign_in
192 self.assertEqual(self.ui.ui.wizard.startId(),
193 self.ui.ui.wizard.pages[self.ui.ui.wizard.signin_page])
194 # After, we start on license_page
195 self.ui.start_from_license()
196 self.assertEqual(self.ui.ui.wizard.startId(),
197 self.ui.ui.wizard.pages[self.ui.ui.wizard.license_page])
198
189199
190class ExternalLinkButtonsTestCase(ControlPanelTestCase):200class ExternalLinkButtonsTestCase(ControlPanelTestCase):
191 """The link in the go-to-web buttons are correct."""201 """The link in the go-to-web buttons are correct."""
192202
=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_start.py'
--- ubuntuone/controlpanel/gui/qt/tests/test_start.py 2012-02-17 14:42:57 +0000
+++ ubuntuone/controlpanel/gui/qt/tests/test_start.py 2012-03-22 12:49:18 +0000
@@ -78,7 +78,7 @@
78 gui.start(close_callback=self.close_cb,78 gui.start(close_callback=self.close_cb,
79 with_icon=True, minimized=False)79 with_icon=True, minimized=False)
80 kwargs = {'close_callback': self.close_cb, 'window': self.main_window}80 kwargs = {'close_callback': self.close_cb, 'window': self.main_window}
81 self.assertEqual(self.main_window.args, [((), {})])81 self.assertEqual(self.main_window.args, [((), {'installer': False})])
82 self.assertEqual(self.tray_icon.args, [((), kwargs)])82 self.assertEqual(self.tray_icon.args, [((), kwargs)])
8383
84 def test_both_false(self):84 def test_both_false(self):
8585
=== modified file 'ubuntuone/controlpanel/gui/qt/tests/test_wizard.py'
--- ubuntuone/controlpanel/gui/qt/tests/test_wizard.py 2012-03-20 15:14:24 +0000
+++ ubuntuone/controlpanel/gui/qt/tests/test_wizard.py 2012-03-22 12:49:18 +0000
@@ -153,11 +153,9 @@
153153
154 class_ui = gui.UbuntuOneWizard154 class_ui = gui.UbuntuOneWizard
155 confirm_response = gui.QtGui.QDialog.Accepted155 confirm_response = gui.QtGui.QDialog.Accepted
156 show_license = False
157156
158 @defer.inlineCallbacks157 @defer.inlineCallbacks
159 def setUp(self):158 def setUp(self):
160 self.patch(self.class_ui, 'show_license', self.show_license)
161 yield super(UbuntuOneWizardTestCase, self).setUp()159 yield super(UbuntuOneWizardTestCase, self).setUp()
162 self.patch(self.ui.confirm_dialog, 'exec_',160 self.patch(self.ui.confirm_dialog, 'exec_',
163 lambda: self.confirm_response)161 lambda: self.confirm_response)
@@ -186,11 +184,7 @@
186184
187 def test_first_page(self):185 def test_first_page(self):
188 """The first page is the correct one."""186 """The first page is the correct one."""
189 if self.show_license:187 expected = self.ui.pages[self.ui.signin_page]
190 expected = self.ui.pages[self.ui.license_page]
191 else:
192 expected = self.ui.pages[self.ui.signin_page]
193
194 self.assertEqual(self.ui.startId(), expected)188 self.assertEqual(self.ui.startId(), expected)
195189
196 def test_done_accepted(self):190 def test_done_accepted(self):
@@ -202,12 +196,6 @@
202 self.assertEqual(self._called, ((gui.QtGui.QDialog.Accepted,), {}))196 self.assertEqual(self._called, ((gui.QtGui.QDialog.Accepted,), {}))
203197
204198
205class LicensedUbuntuOneWizardTestCase(UbuntuOneWizardTestCase):
206 """Test the LicensedUbuntuOneWizard."""
207
208 show_license = True
209
210
211class UbuntuOneWizardSignInTestCase(UbuntuOneWizardTestCase):199class UbuntuOneWizardSignInTestCase(UbuntuOneWizardTestCase):
212 """Test the SignInPage wizard page."""200 """Test the SignInPage wizard page."""
213201
@@ -267,12 +255,13 @@
267 if text is not None:255 if text is not None:
268 self.assertEqual(unicode(button.text()), text)256 self.assertEqual(unicode(button.text()), text)
269257
270 getattr(self.ui, signal).connect(self._set_called)258 if signal:
271 button.click()259 getattr(self.ui, signal).connect(self._set_called)
260 button.click()
272261
273 self.assertEqual(self._called, (signal_args, {}),262 self.assertEqual(self._called, (signal_args, {}),
274 msg % (name, signal, signal_args))263 msg % (name, signal, signal_args))
275 self._called = False264 self._called = False
276265
277 def test_done_rejected(self):266 def test_done_rejected(self):
278 """When the wizard was cancelled and user confirmed, finish."""267 """When the wizard was cancelled and user confirmed, finish."""
@@ -300,7 +289,7 @@
300class UbuntuOneWizardCloudToComputerTestCase(UbuntuOneWizardSignInTestCase):289class UbuntuOneWizardCloudToComputerTestCase(UbuntuOneWizardSignInTestCase):
301 """Test the CloudToComputerPage wizard page."""290 """Test the CloudToComputerPage wizard page."""
302291
303 buttons = {'NextButton': (None, 'currentIdChanged', (3,))}292 buttons = {'NextButton': (None, 'currentIdChanged', (4,))}
304 page_name = 'cloud_folders'293 page_name = 'cloud_folders'
305 stage_name = 'folders'294 stage_name = 'folders'
306295
@@ -308,7 +297,7 @@
308class UbuntuOneWizardSettingsTestCase(UbuntuOneWizardSignInTestCase):297class UbuntuOneWizardSettingsTestCase(UbuntuOneWizardSignInTestCase):
309 """Test the CloudToComputerPage wizard page."""298 """Test the CloudToComputerPage wizard page."""
310299
311 buttons = {'BackButton': (None, 'currentIdChanged', (0,))}300 buttons = {'BackButton': (None, 'currentIdChanged', (1,))}
312 page_name = 'settings'301 page_name = 'settings'
313 stage_name = 'folders'302 stage_name = 'folders'
314303
@@ -318,7 +307,7 @@
318307
319 buttons = {308 buttons = {
320 'FinishButton': (None, 'finished', (gui.QtGui.QDialog.Accepted,)),309 'FinishButton': (None, 'finished', (gui.QtGui.QDialog.Accepted,)),
321 'BackButton': (None, 'currentIdChanged', (0,)),310 'BackButton': (None, 'currentIdChanged', (1,)),
322 }311 }
323 page_name = 'local_folders'312 page_name = 'local_folders'
324 stage_name = 'sync'313 stage_name = 'sync'
@@ -341,11 +330,10 @@
341 """Test the LicensePage wizard page."""330 """Test the LicensePage wizard page."""
342331
343 buttons = {332 buttons = {
344 'NextButton': (gui.LICENSE_AGREE, 'currentIdChanged', (1,)),333 'CommitButton': (gui.LICENSE_AGREE, None, ()),
345 'CancelButton': (gui.LICENSE_DISAGREE, 'rejected', ()),334 'CancelButton': (gui.LICENSE_DISAGREE, 'rejected', ()),
346 }335 }
347 page_name = 'license'336 page_name = 'license'
348 show_license = True
349 stage_name = 'install'337 stage_name = 'install'
350338
351339
352340
=== modified file 'ubuntuone/controlpanel/gui/qt/wizard.py'
--- ubuntuone/controlpanel/gui/qt/wizard.py 2012-03-20 15:11:56 +0000
+++ ubuntuone/controlpanel/gui/qt/wizard.py 2012-03-22 12:49:18 +0000
@@ -167,8 +167,6 @@
167class UbuntuOneWizard(cache.Cache, QtGui.QWizard):167class UbuntuOneWizard(cache.Cache, QtGui.QWizard):
168 """The Ubuntu One wizard."""168 """The Ubuntu One wizard."""
169169
170 show_license = False # do not change unless you know what you're doing
171
172 def __init__(self, *args, **kwargs):170 def __init__(self, *args, **kwargs):
173 super(UbuntuOneWizard, self).__init__(*args, **kwargs)171 super(UbuntuOneWizard, self).__init__(*args, **kwargs)
174 self.pages = {}172 self.pages = {}
@@ -185,9 +183,8 @@
185183
186 # license184 # license
187 self.license_page = LicensePage()185 self.license_page = LicensePage()
188 self.next_button_text = self.button(self.NextButton).text()186 self.license_page.setCommitPage(True)
189 if self.show_license:187 self.addPage(self.license_page)
190 self.addPage(self.license_page)
191188
192 # sign in189 # sign in
193 self.signin_page = SignInPage()190 self.signin_page = SignInPage()
@@ -213,7 +210,7 @@
213 self.addPage(self.local_folders_page)210 self.addPage(self.local_folders_page)
214211
215 self._next_id = self.pages[self.signin_page]212 self._next_id = self.pages[self.signin_page]
216 self.next()213 self.setStartId(self._next_id)
217214
218 # pylint: disable=C0103215 # pylint: disable=C0103
219216
@@ -231,12 +228,14 @@
231 button_layout = button_to = button = stage = None228 button_layout = button_to = button = stage = None
232229
233 if page is self.license_page:230 if page is self.license_page:
234 button_layout = [self.Stretch, self.CancelButton, self.NextButton]231 button_layout = [self.Stretch, self.CancelButton,
235 button = self.button(self.NextButton)232 self.CommitButton]
233 button = self.button(self.CommitButton)
236 button_to = self.button(self.CancelButton)234 button_to = self.button(self.CancelButton)
237 stage = self.side_widget.install_stage235 stage = self.side_widget.install_stage
236 self._next_id = self.pages[self.signin_page]
238237
239 self.setButtonText(self.NextButton, LICENSE_AGREE)238 self.setButtonText(self.CommitButton, LICENSE_AGREE)
240 self.setButtonText(self.CancelButton, LICENSE_DISAGREE)239 self.setButtonText(self.CancelButton, LICENSE_DISAGREE)
241240
242 elif page is self.signin_page:241 elif page is self.signin_page:
@@ -250,8 +249,6 @@
250 self.setTabOrder(self.signin_page.panel.ui.login_button, button)249 self.setTabOrder(self.signin_page.panel.ui.login_button, button)
251250
252 elif page is self.cloud_folders_page:251 elif page is self.cloud_folders_page:
253 self.setButtonText(self.NextButton, self.next_button_text)
254
255 button_layout = [self.Stretch, self.NextButton]252 button_layout = [self.Stretch, self.NextButton]
256 button = self.cloud_folders_page.panel.ui.check_settings_button253 button = self.cloud_folders_page.panel.ui.check_settings_button
257 button_to = self.button(self.NextButton)254 button_to = self.button(self.NextButton)
@@ -339,8 +336,7 @@
339 if response == QtGui.QDialog.Accepted:336 if response == QtGui.QDialog.Accepted:
340 logger.warning('UbuntuOneWizard: user canceled setup.')337 logger.warning('UbuntuOneWizard: user canceled setup.')
341 self.rejected.emit()338 self.rejected.emit()
342 elif (self.show_license and339 elif (self.currentId() == self.pages[self.license_page]):
343 self.currentId() == self.pages[self.license_page]):
344 response = self.confirm_dialog.exec_()340 response = self.confirm_dialog.exec_()
345 if response == QtGui.QDialog.Accepted:341 if response == QtGui.QDialog.Accepted:
346 logger.warning('UbuntuOneWizard: user wants to uninstall.')342 logger.warning('UbuntuOneWizard: user wants to uninstall.')

Subscribers

People subscribed via source and target branches