summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-08-01 22:54:13 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-08-01 22:54:13 +0800
commitdb891751d98c86b2ca8a996b4b8d2a9dafc840cd (patch)
tree40cf5bb0f45261b1154e7bea530fa95bfa7fe4d0
parenta1ad647148a673f9e84f9d8ef2078eb3eb04e145 (diff)
downloadibus-db891751d98c86b2ca8a996b4b8d2a9dafc840cd.tar.gz
ibus-db891751d98c86b2ca8a996b4b8d2a9dafc840cd.tar.xz
ibus-db891751d98c86b2ca8a996b4b8d2a9dafc840cd.zip
Add config_set_list method.
-rw-r--r--ibus/bus.py4
-rw-r--r--setup/main.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/ibus/bus.py b/ibus/bus.py
index 01992fd..0d19f7d 100644
--- a/ibus/bus.py
+++ b/ibus/bus.py
@@ -134,6 +134,10 @@ class Bus(ibus.Object):
def config_set_value(self, key, value):
return self.__bus.ConfigSetValue(key, value)
+ def config_set_list(self, key, value, list_type):
+ value = dbus.Array(value, signature = list_type)
+ return self.__bus.ConfigSetValue(key, value)
+
def config_get_value(self, key, default_value = None):
try:
return self.__bus.ConfigGetValue(key)
diff --git a/setup/main.py b/setup/main.py
index 53f3ef7..3522e1c 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -158,11 +158,11 @@ class Setup(object):
if data[DATA_PRELOAD]:
if engine not in self.__preload_engines:
self.__preload_engines.add(engine)
- self.__bus.config_set_value(CONFIG_PRELOAD_ENGINES, list(self.__preload_engines))
+ self.__bus.config_set_list(CONFIG_PRELOAD_ENGINES, list(self.__preload_engines), "s")
else:
if engine in self.__preload_engines:
self.__preload_engines.remove(engine)
- self.__bus.config_set_value(CONFIG_PRELOAD_ENGINES, list(self.__preload_engines))
+ self.__bus.config_set_list(CONFIG_PRELOAD_ENGINES, list(self.__preload_engines), "s")
# set new value