[Sugar-devel] [PATCH] use ConsoleKit instead of HAL for shutdown/reboot

Sascha Silbe sascha-pgp at silbe.org
Tue Apr 20 18:28:31 EDT 2010


HAL is dead, ConsoleKit now handles shutdown / reboot.

Shutdown tested on Debian squeeze with consolekit 0.4.1-4.
Reboot mode cannot be triggered by UI in Sugar 0.88, so not tested.

Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>

---
 src/jarabe/model/session.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/jarabe/model/session.py b/src/jarabe/model/session.py
index 9e0f087..e7b70cd 100644
--- a/src/jarabe/model/session.py
+++ b/src/jarabe/model/session.py
@@ -53,15 +53,15 @@ class SessionManager(session.SessionManager):
         elif self._logout_mode != self.MODE_LOGOUT:
             try:
                 bus = dbus.SystemBus()
-                proxy = bus.get_object('org.freedesktop.Hal',
-                                       '/org/freedesktop/Hal/devices/computer')
+                proxy = bus.get_object('org.freedesktop.ConsoleKit',
+                                       '/org/freedesktop/ConsoleKit/Manager')
                 pm = dbus.Interface(proxy,
-                                    'org.freedesktop.Hal.Device.SystemPowerManagement')
+                                    'org.freedesktop.ConsoleKit.Manager')
 
                 if self._logout_mode == self.MODE_SHUTDOWN:
-                    pm.Shutdown()
+                    pm.Stop()
                 elif self._logout_mode == self.MODE_REBOOT:
-                    pm.Reboot()
+                    pm.Restart()
             except:
                 logging.exception('Can not stop sugar')
                 self.session.cancel_shutdown()
-- 
tg: (ae04835..) t/ck-shutdown (depends on: upstream/master)


More information about the Sugar-devel mailing list