summaryrefslogtreecommitdiffstats
path: root/launcher
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-10-03 23:50:55 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-10-03 23:50:55 +0800
commit0d2c788dfdd7a00f1ca2310a846357f485aa2432 (patch)
treec5d496825e8bd99c69fa9ec5cb6bed0cec43e76c /launcher
parent6515cb122eea13c16d5f936a346acbc1369b2d64 (diff)
downloadibus-0d2c788dfdd7a00f1ca2310a846357f485aa2432.tar.gz
ibus-0d2c788dfdd7a00f1ca2310a846357f485aa2432.tar.xz
ibus-0d2c788dfdd7a00f1ca2310a846357f485aa2432.zip
WIP.
Diffstat (limited to 'launcher')
-rw-r--r--launcher/ibus.in29
1 files changed, 27 insertions, 2 deletions
diff --git a/launcher/ibus.in b/launcher/ibus.in
index 0f7cb21..f4ac580 100644
--- a/launcher/ibus.in
+++ b/launcher/ibus.in
@@ -39,6 +39,7 @@ class Launcher(object):
super(Launcher, self).__init__()
self.__daemon_pid = 0
self.__panel_pid = 0
+ self.__conf_pid = 0
self.__x11_pid = 0
self.__bus = None
@@ -66,6 +67,8 @@ class Launcher(object):
self.__x11_pid = 0
elif pid == self.__panel_pid:
self.__panel_pid = 0
+ elif pid == self.__conf_pid:
+ self.__conf_pid = 0
elif sig == signal.SIGTERM or sig == signal.SIGINT:
sys.exit(1)
@@ -113,10 +116,32 @@ class Launcher(object):
self.__bus.connect("destroy", self.__bus_destroy_cb)
- self.__x11_pid = self.__start_process(x11, [x11, "--kill-daemon"], "ibus-x11")
+ self.__conf_pid = self.__start_process(conf, [conf], "ibus-conf")
self.__panel_pid = self.__start_process(panel, [panel], "ibus-panel")
-
+ self.__x11_pid = self.__start_process(x11, [x11, "--kill-daemon"], "ibus-x11")
+ time.sleep(1)
+ while ibus.main_iteration(False):
+ pass
+ self.__launch_auto_load_engines()
ibus.main()
+ def __launch_auto_load_engines(self):
+ engines = []
+ try:
+ engines = self.__bus.config_get_value("general", "preload_engines", None)
+ if not engines:
+ engines = []
+ except:
+ pass
+ for e in engines:
+ try:
+ lang, name = e.split(":")
+ self.__bus.register_start_engine(lang, name)
+ except:
+ import traceback
+ traceback.print_exc()
+
+
+
if __name__ == "__main__":
Launcher().run()