From a2b7c819a10285ea066cc6816d27e78bdf80a598 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger <asterix@lagaule.org> Date: Thu, 30 Mar 2006 12:57:38 +0000 Subject: [PATCH] re-introduce button in notification in order to see it fully on screen. I just took Andrew's code from #1388 patch04. Fixes #1537 --- src/notify.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/notify.py b/src/notify.py index 934be11eb1..1534734da7 100644 --- a/src/notify.py +++ b/src/notify.py @@ -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, -- GitLab