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:
parent
114264ca13
commit
a2b7c819a1
1 changed files with 11 additions and 1 deletions
|
@ -132,27 +132,36 @@ class DesktopNotification:
|
||||||
|
|
||||||
if event_type == _('Contact Signed In'):
|
if event_type == _('Contact Signed In'):
|
||||||
ntype = 'presence.online'
|
ntype = 'presence.online'
|
||||||
|
button_text = _('Start Chat with Contact')
|
||||||
elif event_type == _('Contact Signed Out'):
|
elif event_type == _('Contact Signed Out'):
|
||||||
ntype = 'presence.offline'
|
ntype = 'presence.offline'
|
||||||
elif event_type in (_('New Message'), _('New Single Message'),
|
elif event_type in (_('New Message'), _('New Single Message'),
|
||||||
_('New Private Message')):
|
_('New Private Message')):
|
||||||
ntype = 'im.received'
|
ntype = 'im.received'
|
||||||
|
button_text = _('Focus Received Message')
|
||||||
elif event_type == _('File Transfer Request'):
|
elif event_type == _('File Transfer Request'):
|
||||||
ntype = 'transfer'
|
ntype = 'transfer'
|
||||||
|
button_text = _('Manage File Transfer')
|
||||||
elif event_type == _('File Transfer Error'):
|
elif event_type == _('File Transfer Error'):
|
||||||
ntype = 'transfer.error'
|
ntype = 'transfer.error'
|
||||||
|
button_text = _('Manage File Transfer')
|
||||||
elif event_type in (_('File Transfer Completed'), _('File Transfer Stopped')):
|
elif event_type in (_('File Transfer Completed'), _('File Transfer Stopped')):
|
||||||
ntype = 'transfer.complete'
|
ntype = 'transfer.complete'
|
||||||
|
button_text = _('Manage File Transfer')
|
||||||
elif event_type == _('New E-mail'):
|
elif event_type == _('New E-mail'):
|
||||||
ntype = 'email.arrived'
|
ntype = 'email.arrived'
|
||||||
|
button_text = _('View New E-Mail')
|
||||||
elif event_type == _('Groupchat Invitation'):
|
elif event_type == _('Groupchat Invitation'):
|
||||||
ntype = 'im.invitation'
|
ntype = 'im.invitation'
|
||||||
|
button_text = _('Manage Invitation')
|
||||||
else:
|
else:
|
||||||
# default failsafe values
|
# default failsafe values
|
||||||
self.path_to_image = os.path.abspath(
|
self.path_to_image = os.path.abspath(
|
||||||
os.path.join(gajim.DATA_DIR, 'pixmaps', 'events',
|
os.path.join(gajim.DATA_DIR, 'pixmaps', 'events',
|
||||||
'chat_msg_recv.png')) # img to display
|
'chat_msg_recv.png')) # img to display
|
||||||
ntype = 'im' # Notification Type
|
ntype = 'im' # Notification Type
|
||||||
|
button_text = event_type
|
||||||
|
self.response_description = button_text
|
||||||
|
|
||||||
self.notif = dbus_support.get_notifications_interface()
|
self.notif = dbus_support.get_notifications_interface()
|
||||||
if self.notif is None:
|
if self.notif is None:
|
||||||
|
@ -195,7 +204,8 @@ class DesktopNotification:
|
||||||
dbus.String(self.path_to_image),
|
dbus.String(self.path_to_image),
|
||||||
dbus.String(self.event_type),
|
dbus.String(self.event_type),
|
||||||
dbus.String(self.text),
|
dbus.String(self.text),
|
||||||
( dbus.String('default'), dbus.String(self.event_type) ),
|
( dbus.String(ntype),
|
||||||
|
dbus.String(self.response_description) ),
|
||||||
hints,
|
hints,
|
||||||
dbus.UInt32(timeout*1000),
|
dbus.UInt32(timeout*1000),
|
||||||
reply_handler=self.attach_by_id,
|
reply_handler=self.attach_by_id,
|
||||||
|
|
Loading…
Add table
Reference in a new issue