Merge lp:~dobey/ubuntuone-control-panel/one-launcher into lp:ubuntuone-control-panel

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 231
Merged at revision: 229
Proposed branch: lp:~dobey/ubuntuone-control-panel/one-launcher
Merge into: lp:ubuntuone-control-panel
Diff against target: 84 lines (+17/-14)
5 files modified
po/POTFILES.in (+0/-1)
ubuntuone-control-panel-gtk.desktop.in (+0/-11)
ubuntuone-control-panel.in (+1/-1)
ubuntuone/controlpanel/gui/gtk/gui.py (+8/-1)
ubuntuone/controlpanel/gui/gtk/tests/test_gui_basic.py (+8/-0)
To merge this branch: bzr merge lp:~dobey/ubuntuone-control-panel/one-launcher
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Review via email: mp+75747@code.launchpad.net

Commit message

Don't install a .desktop file for control panel
Point the indicator/Unity API at the installer .desktop file
Set the WMCLASS so Unity will fall back properly

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

Code looks good.

Can you please add tests for the change in ubuntuone/controlpanel/gui/gtk/tests/test_gui_basic.py, inside the ControlPanelWindowTestCase?

Thanks.

review: Needs Fixing
230. By dobey

Add a 'test' and use constants

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

Looks good!

please fix the lint issue before landing:

ubuntuone/controlpanel/gui/gtk/tests/test_gui_basic.py:
    128: [W0612, ControlPanelWindowTestCase.test_wmclass_is_correct] Unused variable 'cp'

review: Approve
231. By dobey

Use the useless variable in the test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'po/POTFILES.in'
2--- po/POTFILES.in 2011-05-24 14:20:18 +0000
3+++ po/POTFILES.in 2011-09-16 18:06:22 +0000
4@@ -1,4 +1,3 @@
5-ubuntuone-control-panel-gtk.desktop.in
6 ubuntuone/controlpanel/gui/__init__.py
7 [type: gettext/glade] data/gtk/dashboard.ui
8 [type: gettext/glade] data/gtk/device.ui
9
10=== removed file 'ubuntuone-control-panel-gtk.desktop.in'
11--- ubuntuone-control-panel-gtk.desktop.in 2011-07-08 16:20:03 +0000
12+++ ubuntuone-control-panel-gtk.desktop.in 1970-01-01 00:00:00 +0000
13@@ -1,11 +0,0 @@
14-[Desktop Entry]
15-Name=Ubuntu One
16-_Comment=Configure and manage your Ubuntu One account
17-Exec=ubuntuone-control-panel-gtk
18-Icon=ubuntuone
19-Terminal=false
20-Type=Application
21-Categories=GNOME;GTK;Settings;DesktopSettings;X-GNOME-Settings-Panel;X-GNOME-PersonalSettings
22-StartupNotify=true
23-X-Ayatana-Appmenu-Show-Stubs=False
24-X-GNOME-Settings-Panel=ubuntuone
25
26=== modified file 'ubuntuone-control-panel.in'
27--- ubuntuone-control-panel.in 2011-01-27 20:56:58 +0000
28+++ ubuntuone-control-panel.in 2011-09-16 18:06:22 +0000
29@@ -1,1 +1,1 @@
30-@prefix@/share/applications/ubuntuone-control-panel-gtk.desktop
31+@prefix@/share/applications/ubuntuone-installer.desktop
32
33=== modified file 'ubuntuone/controlpanel/gui/gtk/gui.py'
34--- ubuntuone/controlpanel/gui/gtk/gui.py 2011-08-23 05:29:30 +0000
35+++ ubuntuone/controlpanel/gui/gtk/gui.py 2011-09-16 18:06:22 +0000
36@@ -62,7 +62,7 @@
37 try:
38 from gi.repository import Unity # pylint: disable=E0611
39 USE_LIBUNITY = True
40- U1_DOTDESKTOP = "ubuntuone-control-panel-gtk.desktop"
41+ U1_DOTDESKTOP = "ubuntuone-installer.desktop"
42 except ImportError:
43 USE_LIBUNITY = False
44
45@@ -71,6 +71,9 @@
46
47 WARNING_MARKUP = '<span foreground="%s"><b>%%s</b></span>' % ERROR_COLOR
48
49+CP_WMCLASS_NAME = 'ubuntuone-control-panel-gtk'
50+CP_WMCLASS_CLASS = 'ubuntuone-installer'
51+
52
53 def error_handler(*args, **kwargs):
54 """Log errors when calling D-Bus methods in a async way."""
55@@ -1614,6 +1617,10 @@
56 def __init__(self, switch_to='', alert=False):
57 super(ControlPanelWindow, self).__init__()
58
59+ # We need to set WMCLASS so Unity falls back and we only get one
60+ # launcher on the launcher panel
61+ self.set_wmclass(CP_WMCLASS_NAME, CP_WMCLASS_CLASS)
62+
63 self.connect('focus-in-event', self.remove_urgency)
64 self.set_title(MAIN_WINDOW_TITLE % {'app_name': U1_APP_NAME})
65 self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
66
67=== modified file 'ubuntuone/controlpanel/gui/gtk/tests/test_gui_basic.py'
68--- ubuntuone/controlpanel/gui/gtk/tests/test_gui_basic.py 2011-09-07 13:49:19 +0000
69+++ ubuntuone/controlpanel/gui/gtk/tests/test_gui_basic.py 2011-09-16 18:06:22 +0000
70@@ -122,6 +122,14 @@
71 self.assertEqual(
72 self._called, ((), {}), 'gtk.main_quit was not called.')
73
74+ def test_wmclass_is_correct(self):
75+ """Test that the WMCLASS is set."""
76+ self.patch(gui.ControlPanelWindow, 'set_wmclass', self._set_called)
77+ cp = gui.ControlPanelWindow()
78+ cp.destroy()
79+ expected = ((gui.CP_WMCLASS_NAME, gui.CP_WMCLASS_CLASS), {})
80+ self.assertEqual(self._called, expected)
81+
82 def test_title_is_correct(self):
83 """The window title is correct."""
84 expected = gui.MAIN_WINDOW_TITLE % {'app_name': gui.U1_APP_NAME}

Subscribers

People subscribed via source and target branches

to all changes: