ACE: notification_timeout; and fix desc for use_urgency_hi*N*t

This commit is contained in:
Nikos Kouremenos 2005-12-28 22:49:58 +00:00
parent 9abc57d0ae
commit 404cc402cb
4 changed files with 7 additions and 4 deletions

View File

@ -172,7 +172,8 @@ class Config:
'restored_messages_color': [opt_str, 'grey'], 'restored_messages_color': [opt_str, 'grey'],
'hide_avatar_of_transport': [opt_bool, False], 'hide_avatar_of_transport': [opt_bool, False],
'roster_window_skip_taskbar': [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 = { __options_per_key = {

View File

@ -898,7 +898,8 @@ class PopupNotificationWindow:
xml.signal_autoconnect(self) xml.signal_autoconnect(self)
self.window.show_all() 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): def on_close_button_clicked(self, widget):
self.adjust_height_and_move_popup_notification_windows() self.adjust_height_and_move_popup_notification_windows()

View File

@ -265,7 +265,7 @@ def set_unset_urgency_hint(window, unread_messages_no):
'''sets/unsets urgency hint in window argument '''sets/unsets urgency hint in window argument
depending if we have unread messages or not''' depending if we have unread messages or not'''
if gtk.gtk_version >= (2, 8, 0) and gtk.pygtk_version >= (2, 8, 0) and \ 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: if unread_messages_no > 0:
window.props.urgency_hint = True window.props.urgency_hint = True
else: else:

View File

@ -189,10 +189,11 @@ class DesktopNotification:
self.notif = dbus_support.get_notifications_interface() self.notif = dbus_support.get_notifications_interface()
if self.notif is None: if self.notif is None:
raise dbus.dbus_bindings.DBusException() raise dbus.dbus_bindings.DBusException()
timeout = gajim.config.get('notification_timeout') # in seconds
self.id = self.notif.Notify(dbus.String(_('Gajim')), self.id = self.notif.Notify(dbus.String(_('Gajim')),
dbus.String(path), dbus.UInt32(0), ntype, dbus.Byte(0), dbus.String(path), dbus.UInt32(0), ntype, dbus.Byte(0),
dbus.String(event_type), dbus.String(txt), 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.attach_to_interface()
notification_response_manager.pending[self.id] = self notification_response_manager.pending[self.id] = self