diff --git a/src/common/config.py b/src/common/config.py index 4eb9a71e3..d1d5af5ea 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -172,7 +172,8 @@ class Config: 'restored_messages_color': [opt_str, 'grey'], 'hide_avatar_of_transport': [opt_bool, False], 'roster_window_skip_taskbar': [opt_bool, False], - 'use_urgency_hit': [opt_bool, True, _('If True and installed GTK / PyGTK version are at least 2.8, use urgency hit')], + 'use_urgency_hint': [opt_bool, True, _('If True and installed GTK+ and PyGTK versions are at least 2.8, make the window flash when holding pending events.')], + 'notification_timeout': [opt_int, 5], } __options_per_key = { diff --git a/src/dialogs.py b/src/dialogs.py index 282f412f9..46063b0e6 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -898,7 +898,8 @@ class PopupNotificationWindow: xml.signal_autoconnect(self) self.window.show_all() - gobject.timeout_add(5000, self.on_timeout) + timeout = gajim.config.get('notification_timeout') * 1000 # make it ms + gobject.timeout_add(timeout, self.on_timeout) def on_close_button_clicked(self, widget): self.adjust_height_and_move_popup_notification_windows() diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index c4bc5db01..e2c3b7625 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -265,7 +265,7 @@ def set_unset_urgency_hint(window, unread_messages_no): '''sets/unsets urgency hint in window argument depending if we have unread messages or not''' if gtk.gtk_version >= (2, 8, 0) and gtk.pygtk_version >= (2, 8, 0) and \ - gajim.config.get('use_urgency_hit'): + gajim.config.get('use_urgency_hint'): if unread_messages_no > 0: window.props.urgency_hint = True else: diff --git a/src/notify.py b/src/notify.py index 167586d91..5947af905 100644 --- a/src/notify.py +++ b/src/notify.py @@ -189,10 +189,11 @@ class DesktopNotification: self.notif = dbus_support.get_notifications_interface() if self.notif is None: raise dbus.dbus_bindings.DBusException() + timeout = gajim.config.get('notification_timeout') # in seconds self.id = self.notif.Notify(dbus.String(_('Gajim')), dbus.String(path), dbus.UInt32(0), ntype, dbus.Byte(0), dbus.String(event_type), dbus.String(txt), - [dbus.String(path)], {'default':0}, [''], True, dbus.UInt32(5)) + [dbus.String(path)], {'default': 0}, [''], True, dbus.UInt32(timeout)) notification_response_manager.attach_to_interface() notification_response_manager.pending[self.id] = self