Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rw-r--r--shell/data/kbdconfig2
-rw-r--r--shell/view/keyhandler.py11
-rwxr-xr-xsugar-emulator-shutdown24
-rw-r--r--sugar/emulator.py2
5 files changed, 12 insertions, 30 deletions
diff --git a/Makefile.am b/Makefile.am
index ac05c5d..4606e90 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,8 +3,7 @@ SUBDIRS = lib po shell sugar services tools
ACLOCAL_AMFLAGS = -I m4
bin_SCRIPTS = \
- sugar-emulator \
- sugar-emulator-shutdown
+ sugar-emulator
DISTCLEANFILES = \
intltool-extract \
diff --git a/shell/data/kbdconfig b/shell/data/kbdconfig
index 287de52..415c69f 100644
--- a/shell/data/kbdconfig
+++ b/shell/data/kbdconfig
@@ -5,5 +5,3 @@
<Alt>n=next
<Alt>p=prev
<Alt>c=close
-
-<Alt>q=!sugar-emulator-shutdown
diff --git a/shell/view/keyhandler.py b/shell/view/keyhandler.py
index 085b51c..0ef963a 100644
--- a/shell/view/keyhandler.py
+++ b/shell/view/keyhandler.py
@@ -1,3 +1,6 @@
+import os
+import signal
+
import dbus
import gobject
@@ -34,7 +37,8 @@ _actions_table = {
'0xEB' : 'rotate',
'<alt>r' : 'rotate',
'0xEC' : 'keyboard_brightness',
- '<alt>Tab' : 'home'
+ '<alt>Tab' : 'home',
+ '<alt>q' : 'quit_emulator',
}
class KeyHandler(object):
@@ -149,6 +153,11 @@ class KeyHandler(object):
gobject.spawn_async(['xrandr', '-o', states[self._screen_rotation]],
flags=gobject.SPAWN_SEARCH_PATH)
+ def handle_quit_emulator(self):
+ if os.environ.has_key('SUGAR_EMULATOR_PID'):
+ pid = int(os.environ['SUGAR_EMULATOR_PID'])
+ os.kill(pid, signal.SIGTERM)
+
def handle_home(self):
# FIXME: finish alt+tab support
pass
diff --git a/sugar-emulator-shutdown b/sugar-emulator-shutdown
deleted file mode 100755
index 75f6de0..0000000
--- a/sugar-emulator-shutdown
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2006, Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-import os
-import signal
-
-if os.environ.has_key('SUGAR_XEPHYR_PID'):
- pid = int(os.environ['SUGAR_XEPHYR_PID'])
- os.kill(pid, signal.SIGTERM)
diff --git a/sugar/emulator.py b/sugar/emulator.py
index 90d6cf9..bc06924 100644
--- a/sugar/emulator.py
+++ b/sugar/emulator.py
@@ -98,7 +98,7 @@ class XephyrProcess(Process):
def start(self, standard_output=False):
Process.start(self)
os.environ['DISPLAY'] = ":%d" % (self._display)
- os.environ['SUGAR_XEPHYR_PID'] = '%d' % self.pid
+ os.environ['SUGAR_EMULATOR_PID'] = '%d' % self.pid
class Emulator(object):
"""The OLPC emulator"""