Merge lp:~thisfred/ubuntuone-control-panel/dbusify into lp:ubuntuone-control-panel

Proposed by Eric Casteleijn
Status: Merged
Approved by: Eric Casteleijn
Approved revision: 99
Merged at revision: 102
Proposed branch: lp:~thisfred/ubuntuone-control-panel/dbusify
Merge into: lp:ubuntuone-control-panel
Diff against target: 60 lines (+17/-2)
4 files modified
bin/ubuntuone-control-panel-gtk (+10/-1)
com.ubuntuone.controlpanel.gui.service.in (+3/-0)
setup.py (+2/-1)
ubuntuone/controlpanel/gtk/__init__.py (+2/-0)
To merge this branch: bzr merge lp:~thisfred/ubuntuone-control-panel/dbusify
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
dobey (community) Approve
Review via email: mp+53854@code.launchpad.net

Commit message

* Added service file template (will need a packaging branch to actually install it)
* Make bin/ubuntuone-control-panel-gtk not open a new panel if one is already open

Description of the change

* Added service file template (will need a packaging branch to actually install it)
* Make bin/ubuntuone-control-panel-gtk not open a new panel if one is already open

This temporarily breaks switching tabs in the case the panel is already open, which I will address in the next branch.

To post a comment you must log in.
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Roberto Alsina (ralsina) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/ubuntuone-control-panel-gtk'
2--- bin/ubuntuone-control-panel-gtk 2011-03-04 15:47:23 +0000
3+++ bin/ubuntuone-control-panel-gtk 2011-03-17 16:50:40 +0000
4@@ -27,6 +27,7 @@
5 from optparse import OptionParser
6
7 from ubuntuone.controlpanel.gtk.gui import ControlPanelWindow
8+from ubuntuone.controlpanel.gtk import DBUS_BUS_NAME
9
10 dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
11
12@@ -47,7 +48,15 @@
13
14
15 if __name__ == "__main__":
16+ bus = dbus.SessionBus()
17+ name = bus.request_name(DBUS_BUS_NAME,
18+ dbus.bus.NAME_FLAG_DO_NOT_QUEUE)
19+ if name == dbus.bus.REQUEST_NAME_REPLY_EXISTS:
20+ sys.exit(0)
21+
22+ bus_name = dbus.service.BusName(DBUS_BUS_NAME, bus=dbus.SessionBus())
23 parser = parser_options()
24 (options, args) = parser.parse_args(sys.argv)
25- gui = ControlPanelWindow(switch_to=options.switch_to, alert=options.alert)
26+ gui = ControlPanelWindow(
27+ switch_to=options.switch_to, alert=options.alert)
28 gui.main()
29
30=== added file 'com.ubuntuone.controlpanel.gui.service.in'
31--- com.ubuntuone.controlpanel.gui.service.in 1970-01-01 00:00:00 +0000
32+++ com.ubuntuone.controlpanel.gui.service.in 2011-03-17 16:50:40 +0000
33@@ -0,0 +1,3 @@
34+[D-BUS Service]
35+Name=com.ubuntuone.controlpanel.gui
36+Exec=@bindir@/ubuntuone-control-panel-gtk
37
38=== modified file 'setup.py'
39--- setup.py 2011-03-10 02:51:09 +0000
40+++ setup.py 2011-03-17 16:50:40 +0000
41@@ -84,7 +84,8 @@
42 long_description='Application to manage a Ubuntu One account. Provides a'\
43 'DBus service to query/modify all the Ubuntu One bits.',
44 url='https://launchpad.net/ubuntuone-control-panel',
45- packages=['ubuntuone', 'ubuntuone.controlpanel', 'ubuntuone.controlpanel.gtk'],
46+ packages=[
47+ 'ubuntuone', 'ubuntuone.controlpanel', 'ubuntuone.controlpanel.gtk'],
48 extra_path='ubuntuone-control-panel',
49 data_files=[
50 ('lib/ubuntuone-control-panel',
51
52=== modified file 'ubuntuone/controlpanel/gtk/__init__.py'
53--- ubuntuone/controlpanel/gtk/__init__.py 2010-11-10 15:55:33 +0000
54+++ ubuntuone/controlpanel/gtk/__init__.py 2011-03-17 16:50:40 +0000
55@@ -17,3 +17,5 @@
56 # with this program. If not, see <http://www.gnu.org/licenses/>.
57
58 """The GTK graphical interface for the control panel for Ubuntu One."""
59+
60+DBUS_BUS_NAME = "com.ubuntuone.controlpanel.gui"

Subscribers

People subscribed via source and target branches