diff options
| author | Huang Peng <shawn.p.huang@gmail.com> | 2008-07-30 11:37:27 +0800 |
|---|---|---|
| committer | Huang Peng <shawn.p.huang@gmail.com> | 2008-07-30 11:37:27 +0800 |
| commit | 1e09758b224ec0ff1b98f08429a52fe92d703105 (patch) | |
| tree | 041847f990abcf9f1d545a1ec4b990f70dd382e6 /gconf | |
| parent | 1cc99dd2714e92d93a0fde0042d108f0b432b33a (diff) | |
| download | ibus-1e09758b224ec0ff1b98f08429a52fe92d703105.tar.gz ibus-1e09758b224ec0ff1b98f08429a52fe92d703105.tar.xz ibus-1e09758b224ec0ff1b98f08429a52fe92d703105.zip | |
Make gconf as DefaultConfig.
Diffstat (limited to 'gconf')
| -rw-r--r-- | gconf/config.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gconf/config.py b/gconf/config.py index 2a2149c..7a9688d 100644 --- a/gconf/config.py +++ b/gconf/config.py @@ -19,6 +19,11 @@ # Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA +__all__ = ( + "Config", +) + +import gobject import gconf import ibus from ibus import interface @@ -26,6 +31,13 @@ from ibus import interface GCONF_IBUS_PATH = "/desktop/ibus" class Config(ibus.Object): + __gsignals__ = { + "value-changed" : ( + gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, + (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT)), + } + def __init__ (self, conn = None, path = None): super(Config, self).__init__() self.__proxy = ConfigProxy(self, conn, path) @@ -108,12 +120,15 @@ class Config(ibus.Object): print key, type(value), value print key, type(value), self.__to_gconf_value(value) - self.__proxy.ValueChanged(key, value) + self.emit("value-changed", key, value) + +gobject.type_register(Config) class ConfigProxy(interface.IConfig): def __init__ (self, config, conn, object_path): super(ConfigProxy, self).__init__(conn, object_path) self.__config = config + self.__config.connect("value-changed", lambda c, k, v: self.ValueChanged(k, v)) def GetValue(self, key): return self.__config.get_value(key) |
