#1941 Call FocusSearch method for popping up the journal. (rwh)
This commit is contained in:
parent
70079de872
commit
260ce76b0a
2
NEWS
2
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)
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user