Merge lp:~ralsina/ubuntuone-windows-installer/no-icon-without-arguments into lp:ubuntuone-windows-installer

Proposed by Roberto Alsina
Status: Merged
Approved by: Alejandro J. Cura
Approved revision: 72
Merged at revision: 71
Proposed branch: lp:~ralsina/ubuntuone-windows-installer/no-icon-without-arguments
Merge into: lp:ubuntuone-windows-installer
Diff against target: 78 lines (+15/-7)
4 files modified
ubuntuone_installer/gui/qt/main/tests/test_windows.py (+1/-1)
ubuntuone_installer/gui/qt/main/windows.py (+1/-1)
ubuntuone_installer/gui/qt/utils/tests/test_windows.py (+8/-3)
ubuntuone_installer/gui/qt/utils/windows.py (+5/-2)
To merge this branch: bzr merge lp:~ralsina/ubuntuone-windows-installer/no-icon-without-arguments
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+76129@code.launchpad.net

Commit message

When launching control panel at the end of setup: launch with icon
When launching control panel because there are credentials: launch without icon

Description of the change

When launching control panel at the end of setup: launch with icon
When launching control panel because there are credentials: launch without icon

Trying this IRL involves:

* Build an installer
* Delete credentials
* Start installer, reach a point where it starts control panel

The control panel should show an icon in the notification area

* Close the notification area icon
* Start ubuntu one from the windows menu

There should *not* be an ubuntu one icon in the notification area

----------------

Since I don't expect anyone to do that, trust the tests ;-)

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
Alejandro J. Cura (alecu) wrote :

Code looks great.

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/main/tests/test_windows.py'
2--- ubuntuone_installer/gui/qt/main/tests/test_windows.py 2011-09-07 20:03:40 +0000
3+++ ubuntuone_installer/gui/qt/main/tests/test_windows.py 2011-09-19 23:12:25 +0000
4@@ -123,7 +123,7 @@
5 # Should not log errors
6 self.assertEqual(logger.error_args, None)
7 # Should start u1cp
8- self.assertEqual(self._called, ((), {}))
9+ self.assertEqual(self._called, ((), {'with_icon': False}))
10 # Should stop the app
11 self.assertTrue(self.stopped)
12
13
14=== modified file 'ubuntuone_installer/gui/qt/main/windows.py'
15--- ubuntuone_installer/gui/qt/main/windows.py 2011-09-14 14:12:02 +0000
16+++ ubuntuone_installer/gui/qt/main/windows.py 2011-09-19 23:12:25 +0000
17@@ -48,7 +48,7 @@
18 """Handle credentials success."""
19 if creds: # Have credentials already
20 from ubuntuone_installer.gui.qt import utils
21- utils.start_control_panel()
22+ utils.start_control_panel(with_icon=False)
23 stop()
24 else: # No credentials
25 window = gui.MainWindow(close_callback=stop, installing=installing)
26
27=== modified file 'ubuntuone_installer/gui/qt/utils/tests/test_windows.py'
28--- ubuntuone_installer/gui/qt/utils/tests/test_windows.py 2011-09-15 19:33:35 +0000
29+++ ubuntuone_installer/gui/qt/utils/tests/test_windows.py 2011-09-19 23:12:25 +0000
30@@ -92,15 +92,20 @@
31
32 """Test the start of the control panel."""
33
34- def test_start_control_panel(self):
35+ def test_start_control_panel_with_icon(self):
36 """The proper process is started."""
37 self.patch(subprocess, "Popen", self._set_called)
38-
39 utils.start_control_panel()
40-
41 expected = ((['ubuntuone-control-panel-qt', '--with-icon'],), {})
42 self.assertEqual(self._called, expected)
43
44+ def test_start_control_panel_without_icon(self):
45+ """The proper process is started."""
46+ self.patch(subprocess, "Popen", self._set_called)
47+ utils.start_control_panel(with_icon=False)
48+ expected = ((['ubuntuone-control-panel-qt'],), {})
49+ self.assertEqual(self._called, expected)
50+
51 def test_start_control_panel_frozen(self):
52 """When frozen, the control-panel has a path."""
53 # I can't patch sys because frozen is not there by default
54
55=== modified file 'ubuntuone_installer/gui/qt/utils/windows.py'
56--- ubuntuone_installer/gui/qt/utils/windows.py 2011-09-15 19:33:35 +0000
57+++ ubuntuone_installer/gui/qt/utils/windows.py 2011-09-19 23:12:25 +0000
58@@ -47,7 +47,7 @@
59 '--mode win32', '', 0)
60
61
62-def start_control_panel():
63+def start_control_panel(with_icon=True):
64 """Start the control panel."""
65 # If we are in windows and "frozen", assume it's in
66 # the same folder as this .exe
67@@ -56,7 +56,10 @@
68 cp_path = os.path.join(cp_dir, "ubuntuone-control-panel-qt.exe")
69 else:
70 cp_path = "ubuntuone-control-panel-qt"
71- subprocess.Popen([cp_path, "--with-icon"])
72+ if with_icon:
73+ subprocess.Popen([cp_path, "--with-icon"])
74+ else:
75+ subprocess.Popen([cp_path])
76
77
78 def add_syncdaemon_to_autostart():

Subscribers

People subscribed via source and target branches