Merge lp:~ralsina/ubuntuone-windows-installer/fix-811116 into lp:ubuntuone-windows-installer

Proposed by Roberto Alsina
Status: Merged
Approved by: Roberto Alsina
Approved revision: 21
Merged at revision: 18
Proposed branch: lp:~ralsina/ubuntuone-windows-installer/fix-811116
Merge into: lp:ubuntuone-windows-installer
Diff against target: 51 lines (+14/-2)
2 files modified
ubuntuone_installer/gui/qt/gui.py (+3/-2)
ubuntuone_installer/gui/qt/tests/test_gui.py (+11/-0)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-windows-installer/fix-811116
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Review via email: mp+68125@code.launchpad.net

Commit message

Don't ask for confirmation if the user is in the last page of the wizard.

Description of the change

Don't ask for confirmation if the user is in the last page of the wizard.

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

It works great! all green in windows.

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-08 15:21:50 +0000
3+++ ubuntuone_installer/gui/qt/gui.py 2011-07-15 19:07:26 +0000
4@@ -391,9 +391,10 @@
5
6 def done(self, result):
7 """The main window is being closed, call any custom callback."""
8- if result == 1: # Finished, not cancelled
9+ # Finished, not cancelled
10+ if result == 1: # Cancelled
11 subprocess.Popen(["ubuntuone-control-panel-qt", ])
12- else: # Cancelled
13+ elif self.currentId() != self.CONGRATULATIONS_PAGE:
14 if AreYouSure(self).exec_():
15 return
16 if self.close_callback is not None:
17
18=== modified file 'ubuntuone_installer/gui/qt/tests/test_gui.py'
19--- ubuntuone_installer/gui/qt/tests/test_gui.py 2011-07-08 15:21:50 +0000
20+++ ubuntuone_installer/gui/qt/tests/test_gui.py 2011-07-15 19:07:26 +0000
21@@ -79,12 +79,14 @@
22 """A fake Dialog."""
23
24 result = 0
25+ shown = False
26
27 def __init__(self, *args, **kwargs):
28 self.args = (args, kwargs)
29
30 def exec_(self):
31 """Fake showing the dialog."""
32+ self.shown = True
33 return self.result # Means reject
34
35
36@@ -146,6 +148,15 @@
37 self.ui.done(result=0)
38 self.assertEqual(self.ui.isVisible(), True)
39
40+ def test_user_is_sure_in_last_page(self):
41+ """Cancelling on the last page is ok."""
42+ self.ui.show()
43+ self.patch(self.ui, 'currentId', lambda: self.ui.CONGRATULATIONS_PAGE)
44+ self.patch(gui.subprocess, "Popen", self._set_called)
45+ self.ui.done(result=0)
46+ self.assertEqual(self._called, False)
47+ self.assertEqual(FakeAreYouSure.shown, False)
48+
49 def test_later_accepts_cancel(self):
50 """Clicking 'Later' accepts cancellation."""
51 gui.AreYouSure.result = 0

Subscribers

People subscribed via source and target branches