Commit ec56773d authored by Daiki Ueno's avatar Daiki Ueno
Browse files

Don't hardcode gtk.main_quit() in inscript.py.

parent 881bf34e
...@@ -87,6 +87,7 @@ class Keyboard(gobject.GObject): ...@@ -87,6 +87,7 @@ class Keyboard(gobject.GObject):
} }
def __init__(self, client_name, map_path, kbd_path): def __init__(self, client_name, map_path, kbd_path):
super(Keyboard, self).__init__()
self.__keyboard = self.__create_keyboard(map_path, kbd_path) self.__keyboard = self.__create_keyboard(map_path, kbd_path)
self.__eekboard = eekboard.Eekboard() self.__eekboard = eekboard.Eekboard()
self.__context = self.__eekboard.create_context(client_name) self.__context = self.__eekboard.create_context(client_name)
...@@ -149,13 +150,11 @@ class Keyboard(gobject.GObject): ...@@ -149,13 +150,11 @@ class Keyboard(gobject.GObject):
return keyboard return keyboard
def __destroyed_cb(self, *args): def __destroyed_cb(self, *args):
# self.emit('quit') self.emit('quit')
gtk.main_quit()
def __notify_keyboard_visible_cb(self, obj, pspec): def __notify_keyboard_visible_cb(self, obj, pspec):
if not obj.get_property(pspec.name): if not obj.get_property(pspec.name):
# self.emit('quit') self.emit('quit')
gtk.main_quit()
def enable(self): def enable(self):
self.__eekboard.push_context(self.__context) self.__eekboard.push_context(self.__context)
......
...@@ -42,6 +42,7 @@ if not os.path.exists(kbd_path): ...@@ -42,6 +42,7 @@ if not os.path.exists(kbd_path):
exit(1) exit(1)
keyboard = inscript.Keyboard("eekboard-inscript", map_path, kbd_path) keyboard = inscript.Keyboard("eekboard-inscript", map_path, kbd_path)
keyboard.connect('quit', lambda *args: gtk.main_quit())
keyboard.set_group(1) keyboard.set_group(1)
keyboard.enable() keyboard.enable()
keyboard.show() keyboard.show()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment