Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-11-01 21:05:58 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-11-01 21:05:58 (GMT)
commit260ce76b0ab6076406d43ecc5c2be30911f81d67 (patch)
treefbe31c89968eb2977c1694506826f62f23ae2efa /shell
parent70079de872305eaaacf70364801895ad036d1c4f (diff)
#1941 Call FocusSearch method for popping up the journal. (rwh)
Diffstat (limited to 'shell')
-rw-r--r--shell/view/keyhandler.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/shell/view/keyhandler.py b/shell/view/keyhandler.py
index 26a9fd5..a34d0d1 100644
--- a/shell/view/keyhandler.py
+++ b/shell/view/keyhandler.py
@@ -57,9 +57,15 @@ _actions_table = {
'<ctrl><alt>Tab' : 'previous_window',
'<alt>p' : 'previous_window',
'<ctrl>Escape' : 'close_window',
- '<ctrl>q' : 'close_window'
+ '<ctrl>q' : 'close_window',
+ '0xDC' : 'open_search',
+ '<ctrl>o' : 'open_search'
}
+J_DBUS_SERVICE = 'org.laptop.Journal'
+J_DBUS_PATH = '/org/laptop/Journal'
+J_DBUS_INTERFACE = 'org.laptop.Journal'
+
class KeyHandler(object):
def __init__(self, shell):
self._shell = shell
@@ -173,6 +179,15 @@ class KeyHandler(object):
pid = int(os.environ['SUGAR_EMULATOR_PID'])
os.kill(pid, signal.SIGTERM)
+ def focus_journal_search(self):
+ bus = dbus.SessionBus()
+ obj = bus.get_object(J_DBUS_SERVICE, J_DBUS_PATH)
+ journal = dbus.Interface(obj, J_DBUS_INTERFACE)
+ journal.FocusSearch({})
+
+ def handle_open_search(self):
+ self.focus_journal_search()
+
def _key_pressed_cb(self, grabber, keycode, state):
key = grabber.get_key(keycode, state)
logging.debug('_key_pressed_cb: %i %i %s' % (keycode, state, key))