From bd1e798e8ff23cd81a43a54b3e1227b27a59fa28 Mon Sep 17 00:00:00 2001 From: "kanru@kanru.info" <> Date: Sun, 26 Sep 2010 21:51:35 +0800 Subject: [PATCH] Fix DBus notification interface. Currently the DBus notification implementation is wrong. DBus call should be called via dbus.Interface not dbus.proxies.ProxyObject. Old implementation always hangs the system when issuing notification. --- src/calibre/gui2/notify.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/notify.py b/src/calibre/gui2/notify.py index 385fdd92b7..501f7007eb 100644 --- a/src/calibre/gui2/notify.py +++ b/src/calibre/gui2/notify.py @@ -28,12 +28,12 @@ class DBUSNotifier(Notifier): ICON = I('notify.png') - def __init__(self, server, path): + def __init__(self, server, path, interface): self.ok, self.err = True, None try: import dbus self.dbus = dbus - self._notify = dbus.SessionBus().get_object(server, path) + self._notify = dbus.Interface(dbus.SessionBus().get_object(server, path), interface) except Exception, err: self.ok = False self.err = str(err) @@ -43,7 +43,7 @@ class KDENotifier(DBUSNotifier): def __init__(self): DBUSNotifier.__init__(self, 'org.kde.VisualNotifications', - '/VisualNotifications') + '/VisualNotifications', 'org.kde.VisualNotifications') def __call__(self, body, summary=None, replaces_id=None, timeout=0): if replaces_id is None: @@ -62,7 +62,7 @@ class FDONotifier(DBUSNotifier): def __init__(self): DBUSNotifier.__init__(self, 'org.freedesktop.Notifications', - '/org/freedesktop/Notifications') + '/org/freedesktop/Notifications', 'org.freedesktop.Notifications') def __call__(self, body, summary=None, replaces_id=None, timeout=0): if replaces_id is None: