Fix #2372 (traceback on space in roster after disconnect)

selected_row wasn’t reset
This commit is contained in:
Mathieu Pasquet 2013-09-19 00:19:42 +02:00
parent b245ff6e2d
commit 40af34ad7c
3 changed files with 5 additions and 2 deletions

View file

@ -3447,6 +3447,7 @@ class Core(object):
"""
When we are disconnected from remote server
"""
roster.modified()
for tab in self.tabs:
if isinstance(tab, tabs.MucTab):
tab.disconnect()

View file

@ -2963,7 +2963,6 @@ class RosterInfoTab(Tab):
while not found_group and pos >= 0:
row = self.roster_win.roster_cache[pos]
pos -= 1
log.debug(row)
if isinstance(row, RosterGroup):
found_group = True
group = row.name

View file

@ -2007,6 +2007,8 @@ class RosterWin(Win):
with g_lock:
# make sure we are within bounds
self.move_cursor_up((self.roster_len + self.pos) if self.pos >= self.roster_len else 0)
if not self.roster_cache:
self.selected_row = None
self._win.erase()
self._win.move(0, 0)
self.draw_roster_information(roster)
@ -2016,8 +2018,9 @@ class RosterWin(Win):
if self.start_pos+self.height <= self.pos+2:
self.scroll_down(self.pos - self.start_pos - self.height + (self.height//2))
# draw the roster from the cache
for item in self.roster_cache[self.start_pos-1:self.start_pos+self.height]:
roster_view = self.roster_cache[self.start_pos-1:self.start_pos+self.height]
for item in roster_view:
draw_selected = False
if y -2 + self.start_pos == self.pos:
draw_selected = True