From 153f90209984e731f46a19fcefffc6c9c46d718d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Jan 2010 16:52:25 -0700 Subject: [PATCH] Linux systray notifications: Ignore DBUS errors when sending notifications --- src/calibre/gui2/notify.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/notify.py b/src/calibre/gui2/notify.py index fe7b3c78a7..5090ef766c 100644 --- a/src/calibre/gui2/notify.py +++ b/src/calibre/gui2/notify.py @@ -50,9 +50,13 @@ class KDENotifier(DBUSNotifier): replaces_id = self.dbus.UInt32() event_id = '' timeout, body, summary = self.get_msg_parms(timeout, body, summary) - self._notify.Notify('calibre', replaces_id, event_id, self.ICON, summary, body, + try: + self._notify.Notify('calibre', replaces_id, event_id, self.ICON, summary, body, self.dbus.Array(signature='s'), self.dbus.Dictionary(signature='sv'), timeout) + except: + import traceback + traceback.print_exc() class FDONotifier(DBUSNotifier): @@ -64,9 +68,13 @@ class FDONotifier(DBUSNotifier): if replaces_id is None: replaces_id = self.dbus.UInt32() timeout, body, summary = self.get_msg_parms(timeout, body, summary) - self._notify.Notify('calibre', replaces_id, self.ICON, summary, body, + try: + self._notify.Notify('calibre', replaces_id, self.ICON, summary, body, self.dbus.Array(signature='s'), self.dbus.Dictionary(signature='sv'), timeout) + except: + import traceback + traceback.print_exc() class QtNotifier(Notifier):