diff --git a/NEWS b/NEWS index 894b59b5..aedb860c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +* #1941 Call FocusSearch method for popping up the journal. (rwh) + Snapshot 2df96b9af7 * #4552 Allow to open images in Paint (marco) diff --git a/shell/view/keyhandler.py b/shell/view/keyhandler.py index 26a9fd5c..a34d0d12 100644 --- a/shell/view/keyhandler.py +++ b/shell/view/keyhandler.py @@ -57,9 +57,15 @@ _actions_table = { 'Tab' : 'previous_window', 'p' : 'previous_window', 'Escape' : 'close_window', - 'q' : 'close_window' + 'q' : 'close_window', + '0xDC' : 'open_search', + '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))