Merge lp:~laney/exaile/logind-shutdown into lp:exaile/3.4.x

Proposed by Iain Lane
Status: Merged
Approved by: Dustin Spicuzza
Approved revision: 4369
Merged at revision: 4395
Proposed branch: lp:~laney/exaile/logind-shutdown
Merge into: lp:exaile/3.4.x
Diff against target: 34 lines (+13/-8)
1 file modified
plugins/shutdown/__init__.py (+13/-8)
To merge this branch: bzr merge lp:~laney/exaile/logind-shutdown
Reviewer Review Type Date Requested Status
Dustin Spicuzza Pending
Review via email: mp+161988@code.launchpad.net

Description of the change

ConsoleKit is deprecated; we should use logind to shut the computer down if we can.

To post a comment you must log in.
Revision history for this message
Dustin Spicuzza (dustin-virtualroadside) wrote :

I apologize for reviewing this way after the merge was proposed.

I'm showing my ignorance here, but some questions come to mind about this:
- Is logind supported on all computers that ConsoleKit was found on? Or should we have something that uses both?
- Why shouldn't we use both interfaces, or do a detect of some kind to see if one or the other is there, and use the appropriate one?

Thanks!

Revision history for this message
Dustin Spicuzza (dustin-virtualroadside) wrote :

Oh, never mind. I missed that. You did try to use both interfaces.

Sigh. More sleep required. :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/shutdown/__init__.py'
--- plugins/shutdown/__init__.py 2012-10-03 04:43:15 +0000
+++ plugins/shutdown/__init__.py 2013-05-01 23:37:33 +0000
@@ -118,17 +118,22 @@
118 bus = dbus.SystemBus()118 bus = dbus.SystemBus()
119119
120 try:120 try:
121 proxy = bus.get_object('org.freedesktop.ConsoleKit',121 proxy = bus.get_object('org.freedesktop.login1',
122 '/org/freedesktop/ConsoleKit/Manager')122 '/org/freedesktop/login1')
123 proxy.Stop(dbus_interface='org.freedesktop.ConsoleKit.Manager')123 proxy.PowerOff(False, dbus_interface='org.freedesktop.login1.Manager')
124 except dbus.exceptions.DBusException:124 except dbus.exceptions.DBusException:
125 try:125 try:
126 proxy = bus.get_object('org.freedesktop.Hal',126 proxy = bus.get_object('org.freedesktop.ConsoleKit',
127 '/org/freedesktop/Hal/devices/computer')127 '/org/freedesktop/ConsoleKit/Manager')
128 proxy.Shutdown(dbus_interface='org.freedesktop.Hal.Device.SystemPowerManagement')128 proxy.Stop(dbus_interface='org.freedesktop.ConsoleKit.Manager')
129 except dbus.exceptions.DBusException:129 except dbus.exceptions.DBusException:
130 self.message.show_warning(_('Shutdown failed'),130 try:
131 _('Computer could not be shutdown using D-Bus.'))131 proxy = bus.get_object('org.freedesktop.Hal',
132 '/org/freedesktop/Hal/devices/computer')
133 proxy.Shutdown(dbus_interface='org.freedesktop.Hal.Device.SystemPowerManagement')
134 except dbus.exceptions.DBusException:
135 self.message.show_warning(_('Shutdown failed'),
136 _('Computer could not be shutdown using D-Bus.'))
132137
133 def destroy(self):138 def destroy(self):
134 """139 """

Subscribers

People subscribed via source and target branches