summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-10-06 16:04:22 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-10-06 16:04:22 +0800
commit7ab63e10f58b5c9c902e9f49250339a3ccc30ebf (patch)
tree2fe8d2ae1b8e097c13b8df30b86148190f94abf5
parentd64996654cc58db9d33896e265a73e097fc2701b (diff)
downloadibus-7ab63e10f58b5c9c902e9f49250339a3ccc30ebf.tar.gz
ibus-7ab63e10f58b5c9c902e9f49250339a3ccc30ebf.tar.xz
ibus-7ab63e10f58b5c9c902e9f49250339a3ccc30ebf.zip
WIP
-rw-r--r--gconf/config.py10
-rw-r--r--ibus/notifications.py2
-rw-r--r--ui/gtk/notifications.py2
3 files changed, 11 insertions, 3 deletions
diff --git a/gconf/config.py b/gconf/config.py
index 72e329a..e0a3af8 100644
--- a/gconf/config.py
+++ b/gconf/config.py
@@ -79,7 +79,13 @@ class Config(ibus.ConfigBase):
if value.type == gconf.VALUE_PAIR:
return (self.__to_py_value(value.get_car()), self.__to_py_value(value.get_cdr()))
if value.type == gconf.VALUE_LIST:
- return map(self.__to_py_value, value.get_list())
+ signatures = {
+ gconf.VALUE_STRING: "s",
+ gconf.VALUE_INT: "i",
+ gconf.VALUE_FLOAT: "d",
+ gconf.VALUE_BOOL: "b",
+ }
+ return dbus.Array(map(self.__to_py_value, value.get_list()), signature=signatures.get(value.get_list_type(), "v"))
raise ibus.IBusException("Do not support type == %s" % str(value.type))
def __to_gconf_value(self, value):
@@ -133,6 +139,8 @@ class Config(ibus.ConfigBase):
value = self.__to_py_value(value)
if value == None:
value = 0
+ elif isinstance(value, list) and len(value) == 0:
+ value = dbus.Array(signature="v")
section_name = key.replace(GCONF_IBUS_PATH + "/", "")
section_name = section_name.rsplit("/", 1)
if len(section_name) == 1:
diff --git a/ibus/notifications.py b/ibus/notifications.py
index 17fec3a..3ae067a 100644
--- a/ibus/notifications.py
+++ b/ibus/notifications.py
@@ -55,7 +55,7 @@ class NotificationsProxy(interface.INotifications):
self.__notify = notify
def Notify(self, replaces_id, app_icon, summary, body, actions, expire_timeout):
- return self.__notify.notify(replaces_id, app_icon, summary, body, actions, expire_timout)
+ return self.__notify.notify(replaces_id, app_icon, summary, body, actions, expire_timeout)
def CloseNotification(self, id):
return self.__notify.close_notification(id)
diff --git a/ui/gtk/notifications.py b/ui/gtk/notifications.py
index a0fa233..71fb626 100644
--- a/ui/gtk/notifications.py
+++ b/ui/gtk/notifications.py
@@ -38,7 +38,6 @@ class Notifications(ibus.NotificationsBase):
def __init__ (self, bus):
super(Notifications, self).__init__(bus)
self.__bus = bus
- self.__bus.request_name(ibus.IBUS_NOTIFICATIONS_NAME, 0)
self.__dbus = dbus.SessionBus()
self.__notifications = self.__dbus.get_object(
"org.freedesktop.Notifications", "/org/freedesktop/Notifications")
@@ -50,6 +49,7 @@ class Notifications(ibus.NotificationsBase):
dbus_interface="org.freedesktop.Notifications")
self.__ids = set([])
self.__status_icons = None
+ self.__bus.request_name(ibus.IBUS_NOTIFICATIONS_NAME, 0)
def set_status_icon(self, status_icon):
self.__status_icon = status_icon