diff options
| author | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-06 23:10:52 +0800 |
|---|---|---|
| committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-08-06 23:10:52 +0800 |
| commit | 9dcfd4267e36c30d85a815e72f0c950146f30d0a (patch) | |
| tree | bb814a52f7c5ef48d01f90ac1e5b923551f98fba /setup | |
| parent | 1a8fcb322556d258ee3323d062ebd467dce9ff97 (diff) | |
| download | ibus-9dcfd4267e36c30d85a815e72f0c950146f30d0a.tar.gz ibus-9dcfd4267e36c30d85a815e72f0c950146f30d0a.tar.xz ibus-9dcfd4267e36c30d85a815e72f0c950146f30d0a.zip | |
Add information dialog.
Diffstat (limited to 'setup')
| -rw-r--r-- | setup/main.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/setup/main.py b/setup/main.py index 22041cb..a2c3940 100644 --- a/setup/main.py +++ b/setup/main.py @@ -56,6 +56,10 @@ N_ = lambda a : a CONFIG_PRELOAD_ENGINES = "/general/preload_engines" class Setup(object): + def __flush_gtk_events(self): + while gtk.events_pending(): + gtk.main_iteration() + def __init__(self): super(Setup, self).__init__() glade.textdomain("ibus") @@ -73,17 +77,28 @@ class Setup(object): message_format = message) id = dlg.run() dlg.destroy() - while gtk.events_pending(): - gtk.main_iteration() + self.__flush_gtk_events() if id != gtk.RESPONSE_YES: sys.exit(0) pid = os.spawnlp(os.P_NOWAIT, "ibus", "ibus") - print pid time.sleep(1) try: self.__bus = ibus.Bus() except: continue + message = _("IBus has been started!\n" + \ + "If you can not use IBus, please add below lines in $HOME/.bashrc!\n" + \ + " export GTK_IM_MODULE=ibus\n" + \ + " export XMODIFIERS=@im=ibus\n" + " export QT_IM_MODULE=ibus" + ) + dlg = gtk.MessageDialog(type = gtk.MESSAGE_INFO, + buttons = gtk.BUTTONS_OK, + message_format = message) + id = dlg.run() + dlg.destroy() + self.__flush_gtk_events() + # add icon search path icon_theme = gtk.icon_theme_get_default() |
