re-introduce button in notification in order to see it fully on screen. I just took Andrew's code from #1388 patch04. Fixes #1537

This commit is contained in:
Yann Leboulanger 2006-03-30 12:57:38 +00:00
parent 114264ca13
commit a2b7c819a1
1 changed files with 11 additions and 1 deletions

View File

@ -132,27 +132,36 @@ class DesktopNotification:
if event_type == _('Contact Signed In'):
ntype = 'presence.online'
button_text = _('Start Chat with Contact')
elif event_type == _('Contact Signed Out'):
ntype = 'presence.offline'
elif event_type in (_('New Message'), _('New Single Message'),
_('New Private Message')):
ntype = 'im.received'
button_text = _('Focus Received Message')
elif event_type == _('File Transfer Request'):
ntype = 'transfer'
button_text = _('Manage File Transfer')
elif event_type == _('File Transfer Error'):
ntype = 'transfer.error'
button_text = _('Manage File Transfer')
elif event_type in (_('File Transfer Completed'), _('File Transfer Stopped')):
ntype = 'transfer.complete'
button_text = _('Manage File Transfer')
elif event_type == _('New E-mail'):
ntype = 'email.arrived'
button_text = _('View New E-Mail')
elif event_type == _('Groupchat Invitation'):
ntype = 'im.invitation'
button_text = _('Manage Invitation')
else:
# default failsafe values
self.path_to_image = os.path.abspath(
os.path.join(gajim.DATA_DIR, 'pixmaps', 'events',
'chat_msg_recv.png')) # img to display
ntype = 'im' # Notification Type
button_text = event_type
self.response_description = button_text
self.notif = dbus_support.get_notifications_interface()
if self.notif is None:
@ -195,7 +204,8 @@ class DesktopNotification:
dbus.String(self.path_to_image),
dbus.String(self.event_type),
dbus.String(self.text),
( dbus.String('default'), dbus.String(self.event_type) ),
( dbus.String(ntype),
dbus.String(self.response_description) ),
hints,
dbus.UInt32(timeout*1000),
reply_handler=self.attach_by_id,