fix TB when python-notify is installed but not notification-daemon. fixes #2893

This commit is contained in:
Yann Leboulanger 2007-01-13 00:52:47 +00:00
parent dc4f4922af
commit 99b08744ed
1 changed files with 11 additions and 7 deletions

View File

@ -320,13 +320,17 @@ def popup(event_type, jid, account, msg_type = '', path_to_image = None,
notification.add_action('default', 'Default Action', notification.add_action('default', 'Default Action',
on_pynotify_notification_clicked) on_pynotify_notification_clicked)
try:
notification.show() notification.show()
return
except gobject.GError, e:
# Connection to notification-daemon failed, see #2893
gajim.log.debug(str(e))
else: # go old style # go old style
instance = dialogs.PopupNotificationWindow(event_type, jid, instance = dialogs.PopupNotificationWindow(event_type, jid, account,
account, msg_type, path_to_image, title, text) msg_type, path_to_image, title, text)
gajim.interface.roster.popup_notification_windows.append( gajim.interface.roster.popup_notification_windows.append(instance)
instance)
def on_pynotify_notification_clicked(notification, action): def on_pynotify_notification_clicked(notification, action):
jid = notification.get_data('jid') jid = notification.get_data('jid')