Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2007-01-05 11:23:28 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2007-01-05 11:23:28 (GMT)
commit2c923b9532539993c52c4b64eb2e34ae5c51ca6c (patch)
treebb666fc48376011102fac1ddfdc98bb193e45b9e /shell
parent5c36c6f2740431872e6197be564b4315e6af7f13 (diff)
Shutdown when pressing the power button on the olpc.
Diffstat (limited to 'shell')
-rw-r--r--shell/view/Shell.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/shell/view/Shell.py b/shell/view/Shell.py
index cc653d1..36d0cc2 100644
--- a/shell/view/Shell.py
+++ b/shell/view/Shell.py
@@ -160,12 +160,19 @@ class Shell(gobject.GObject):
elif key == '0x93': # Frame key
self._frame.notify_key_press()
elif key == '0x7C': # Power key
- self._frame.notify_key_press()
+ self._shutdown()
elif key == '<alt>Tab':
self.set_zoom_level(sugar.ZOOM_HOME)
box = self._home_window.get_home_box()
box.grab_and_rotate()
+ def _shutdown(self):
+ bus = dbus.SystemBus()
+ proxy = bus.get_object('org.freedesktop.Hal',
+ '/org/freedesktop/Hal/devices/computer')
+ mgr = dbus.Interface(proxy, 'org.freedesktop.Hal.Device.SystemPowerManagement')
+ mgr.Shutdown()
+
def _key_released_cb(self, grabber, key):
if key == '<shft><alt>F9':
self._frame.notify_key_release()