Merge lp:~diegosarmentero/ubuntuone-windows-installer/setup-button-fix into lp:ubuntuone-windows-installer

Proposed by Diego Sarmentero
Status: Merged
Approved by: Natalia Bidart
Approved revision: 51
Merged at revision: 55
Proposed branch: lp:~diegosarmentero/ubuntuone-windows-installer/setup-button-fix
Merge into: lp:ubuntuone-windows-installer
Diff against target: 79 lines (+32/-5)
2 files modified
ubuntuone_installer/gui/qt/setup_account.py (+6/-3)
ubuntuone_installer/gui/qt/tests/test_gui.py (+26/-2)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-windows-installer/setup-button-fix
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+74118@code.launchpad.net

Commit message

Removed Setup Account button when the user move to another page.

Description of the change

Removed Setup Account button when the user move to another page.

To post a comment you must log in.
48. By Diego Sarmentero

Adding associated bug.

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

+1

review: Approve
49. By Diego Sarmentero

adding missing docstrings.

50. By Diego Sarmentero

Added initializePage.

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

I'm getting this test failures:

[FAIL]
Traceback (most recent call last):
  File "/home/nessita/canonical/u1/windows-installer/review_setup-button-fix/ubuntuone_installer/gui/qt/tests/test_gui.py", line 332, in test_overlay_connection_setup_account
    self.assertEqual(self.ui.overlay.show_counter, 1)
twisted.trial.unittest.FailTest: not equal:
a = 2
b = 1

ubuntuone_installer.gui.qt.tests.test_gui.MainWindowTestCase.test_overlay_connection_setup_account

(but not in trunk)

review: Needs Fixing
51. By Diego Sarmentero

Fixed test (to avoid double signal connection).

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

Looks good!

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/setup_account.py'
--- ubuntuone_installer/gui/qt/setup_account.py 2011-09-01 11:15:49 +0000
+++ ubuntuone_installer/gui/qt/setup_account.py 2011-09-07 12:05:57 +0000
@@ -178,16 +178,19 @@
178 """Set set_up_button as default button when the page is shown."""178 """Set set_up_button as default button when the page is shown."""
179 # This method should stays here because if we move it to initializePage179 # This method should stays here because if we move it to initializePage
180 # set_up_button won't take the proper style for hover and press180 # set_up_button won't take the proper style for hover and press
181 self.set_up_button.setVisible(True)
181 self.set_up_button.setDefault(True)182 self.set_up_button.setDefault(True)
182 self.set_up_button.setProperty("DisabledState", True)183 if not self.set_up_button.isEnabled():
183 self.set_up_button.style().unpolish(self.set_up_button)184 self.set_up_button.setProperty("DisabledState", True)
184 self.set_up_button.style().polish(self.set_up_button)185 self.set_up_button.style().unpolish(self.set_up_button)
186 self.set_up_button.style().polish(self.set_up_button)
185 self.connect(QtGui.QApplication.instance(),187 self.connect(QtGui.QApplication.instance(),
186 QtCore.SIGNAL("focusChanged(QWidget*, QWidget*)"),188 QtCore.SIGNAL("focusChanged(QWidget*, QWidget*)"),
187 self.focus_changed)189 self.focus_changed)
188190
189 def hideEvent(self, event):191 def hideEvent(self, event):
190 """Disconnect the focusChanged signal when the page change."""192 """Disconnect the focusChanged signal when the page change."""
193 self.set_up_button.setVisible(False)
191 try:194 try:
192 self.disconnect(QtGui.QApplication.instance(),195 self.disconnect(QtGui.QApplication.instance(),
193 QtCore.SIGNAL("focusChanged(QWidget*, QWidget*)"),196 QtCore.SIGNAL("focusChanged(QWidget*, QWidget*)"),
194197
=== modified file 'ubuntuone_installer/gui/qt/tests/test_gui.py'
--- ubuntuone_installer/gui/qt/tests/test_gui.py 2011-09-06 16:25:25 +0000
+++ ubuntuone_installer/gui/qt/tests/test_gui.py 2011-09-07 12:05:57 +0000
@@ -150,6 +150,8 @@
150 self.patch(qt.preferences, "PreferencesPanel", FakePreferencesPanel)150 self.patch(qt.preferences, "PreferencesPanel", FakePreferencesPanel)
151 self.patch(qt.folders, "FoldersPanel", FakeFoldersPanel)151 self.patch(qt.folders, "FoldersPanel", FakeFoldersPanel)
152 super(MainWindowTestCase, self).setUp()152 super(MainWindowTestCase, self).setUp()
153 setup_page = self.ui.page(self.ui.setup_account_page_id)
154 setup_page.initializePage()
153155
154 def test_wizard_init(self):156 def test_wizard_init(self):
155 """Check the Wizard flags regarding to the context help button."""157 """Check the Wizard flags regarding to the context help button."""
@@ -169,6 +171,30 @@
169 self.assertFalse(setup_page.ui.confirm_email_assistance.isVisible())171 self.assertFalse(setup_page.ui.confirm_email_assistance.isVisible())
170 self.assertFalse(setup_page.ui.password_assistance.isVisible())172 self.assertFalse(setup_page.ui.password_assistance.isVisible())
171173
174 def test_setup_account_show_event_enabled_false(self):
175 """Check the proper state of the Setup Account button on shown."""
176 setup_page = self.ui.page(self.ui.setup_account_page_id)
177 self.ui.setStartId(self.ui.setup_account_page_id)
178 self.ui.restart()
179 setup_page.set_up_button.setEnabled(False)
180 self.ui.show()
181 self.addCleanup(self.ui.hide)
182 self.assertTrue(setup_page.set_up_button.isVisible())
183 self.assertTrue(setup_page.set_up_button.isDefault())
184 self.assertFalse(setup_page.set_up_button.isEnabled())
185 self.assertTrue(setup_page.set_up_button.property("DisabledState"))
186
187 def test_setup_account_hide_event_enabled_false(self):
188 """Check the proper state of the Setup Account button on hide."""
189 setup_page = self.ui.page(self.ui.setup_account_page_id)
190 self.ui.setStartId(self.ui.setup_account_page_id)
191 self.ui.restart()
192 self.ui.show()
193 self.ui.hide()
194 self.addCleanup(self.ui.hide)
195 self.assertFalse(setup_page.set_up_button.isVisible())
196 self.assertTrue(setup_page.set_up_button.isDefault())
197
172 def test_execute_uninstall_on_licence_cancel(self):198 def test_execute_uninstall_on_licence_cancel(self):
173 """Pressing Disagree button from license page the uninstall is exec."""199 """Pressing Disagree button from license page the uninstall is exec."""
174 self.ui.setStartId(self.ui.LICENSE_PAGE_ID)200 self.ui.setStartId(self.ui.LICENSE_PAGE_ID)
@@ -300,8 +326,6 @@
300 """Make sure we don't lose connections to the overlay."""326 """Make sure we don't lose connections to the overlay."""
301 # Show the setup account page327 # Show the setup account page
302 setup_page = self.ui.page(self.ui.setup_account_page_id)328 setup_page = self.ui.page(self.ui.setup_account_page_id)
303 self.ui.setStartId(self.ui.setup_account_page_id)
304 self.ui.restart()
305 self.ui.show()329 self.ui.show()
306 self.addCleanup(self.ui.hide)330 self.addCleanup(self.ui.hide)
307 self.assertEqual(self.ui.overlay.show_counter, 0)331 self.assertEqual(self.ui.overlay.show_counter, 0)

Subscribers

People subscribed via source and target branches