diff options
author | Huang Peng <shawn.p.huang@gmail.com> | 2008-10-06 15:53:17 +0800 |
---|---|---|
committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-10-06 15:53:17 +0800 |
commit | d64996654cc58db9d33896e265a73e097fc2701b (patch) | |
tree | 1f9538c545a360d5df668c97822972b34a9a1b6e | |
parent | fd4df98ed4985767d95f2d7cdef9d89fad87894d (diff) | |
download | ibus-d64996654cc58db9d33896e265a73e097fc2701b.tar.gz ibus-d64996654cc58db9d33896e265a73e097fc2701b.tar.xz ibus-d64996654cc58db9d33896e265a73e097fc2701b.zip |
WIP.
-rw-r--r-- | daemon/bus.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/daemon/bus.py b/daemon/bus.py index d263ad1..d7c7a0b 100644 --- a/daemon/bus.py +++ b/daemon/bus.py @@ -31,6 +31,10 @@ from config import Config, DummyConfig from register import Register import _dbus +from gettext import dgettext +_ = lambda a : dgettext("ibus", a) +N_ = lambda a : a + class IBus(ibus.Object): def __init__(self): super(IBus, self).__init__() @@ -48,6 +52,9 @@ class IBus(ibus.Object): self.__notifications_handlers = list() self.__install_notifications_handlers() + self.__no_engine_notification_id = 0 + self.__no_engine_notification_show = True + self.__config = DummyConfig() self.__config_handlers = list() self.__install_config_handlers() @@ -205,8 +212,16 @@ class IBus(ibus.Object): engine.focus_in() context.set_engine(engine) else: - pass - context.set_enable(True) + if self.__no_engine_notification_show: + self.__no_engine_notification_id = self.__notifications.notify( + self.__no_engine_notification_id, + "ibus", _("No engine is available"), + _("IBus does not load any input engines!\nYou could use ibus-setup to load some input engines."), + ["NoAgain", _("Do not show this message again")], + 15000) + + if context.get_engine() != None: + context.set_enable(True) self.__panel.states_changed() def __context_disable(self, context): @@ -488,7 +503,8 @@ class IBus(ibus.Object): pass def __notifications_action_invoked_cb(self, notifications, id, action_key): - pass + if id == self.__no_engine_notification_id and action_key == "NoAgain": + self.__no_engine_notification_show = False def __notifications_destroy_cb(self, notifications): if notifications == self.__notifications: |