From f7799dfbecbfecef81a585b6040687a33e3f57f2 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sat, 17 Mar 2007 08:14:25 +0000 Subject: [PATCH] add an ACE option to disable the fact that gajim auto-expand and selects the contact who sent last message. fixes #2911 --- src/common/config.py | 1 + src/roster_window.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/config.py b/src/common/config.py index c46c48c9e..b19288bec 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -224,6 +224,7 @@ class Config: 'use_gnomekeyring': [opt_bool, True, _('If True, Gajim will use Gnome Keyring (if available) to store account passwords.')], 'show_contacts_number': [opt_bool, True, _('If True, Gajim will show number of online and total contacts in account and group rows.')], 'treat_incoming_messages': [ opt_str, '', _('Can be empty, \'chat\' or \'normal\'. If not empty, treat all incoming messages as if they were of this type')], + 'scroll_roster_to_last_message': [opt_bool, True, _('If True, Gajim will scroll and select the contact who sent you the last message, if chat window is not already opened.')], } __options_per_key = { diff --git a/src/roster_window.py b/src/roster_window.py index c26862289..2db627e68 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -150,7 +150,7 @@ class RosterWindow: self.add_contact_to_roster(jid, account) iters = self.get_contact_iter(jid, account) path = self.tree.get_model().get_path(iters[0]) - if self.dragging: + if self.dragging or not gajim.config.get('scroll_roster_to_last_message'): # do not change selection while DND'ing return # popup == False so we show awaiting event in roster @@ -3181,7 +3181,8 @@ class RosterWindow: if popup: if not ctrl: self.new_chat(contact, account, resource = resource_for_chat) - if path and not self.dragging: + if path and not self.dragging and gajim.config.get( + 'scroll_roster_to_last_message'): # we curently see contact in our roster OR he # is not in the roster at all. # show and select his line in roster