From 7ea778e4466087fe20d0e8a30d72dd369a226662 Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Mon, 25 May 2009 16:08:23 +0800 Subject: [PATCH] Raise set dialog when click preference in menu. --- setup/main.py | 8 +++++++- ui/gtk/panel.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/setup/main.py b/setup/main.py index 135de25..8aea11b 100644 --- a/setup/main.py +++ b/setup/main.py @@ -22,6 +22,7 @@ import locale import gettext import os +import signal import sys import time import gtk @@ -361,9 +362,14 @@ class Setup(object): def __config_reloaded_cb(self, bus): pass + def __sigusr1_cb(self, *args): + self.__window.present() + def run(self): self.__window.show_all() + signal.signal(signal.SIGUSR1, self.__sigusr1_cb) gtk.main() if __name__ == "__main__": - Setup().run() + setup = Setup() + setup.run() diff --git a/ui/gtk/panel.py b/ui/gtk/panel.py index 2640c65..534a394 100644 --- a/ui/gtk/panel.py +++ b/ui/gtk/panel.py @@ -404,6 +404,7 @@ class Panel(ibus.PanelBase): if self.__setup_pid != 0: pid, state = os.waitpid(self.__setup_pid, os.P_NOWAIT) if pid != self.__setup_pid: + os.kill(self.__setup_pid, signal.SIGUSR1) return self.__setup_pid = 0 self.__setup_pid = os.spawnl(os.P_NOWAIT, self.__setup_cmd, "ibus-setup") -- 2.7.4