Reset the cursor position from the item list when node changes

This commit is contained in:
Florent Le Coz 2011-06-21 02:01:23 +02:00
parent 06f4dd783e
commit 0fa3cf756a
2 changed files with 9 additions and 1 deletions

View file

@ -183,7 +183,7 @@ class PubsubBrowserTab(tabs.Tab):
nodes items nodes items
""" """
columns = self.item_list_header.get_columns() columns = self.item_list_header.get_columns()
self.item_listview.lines = [] self.item_listview.empty()
log.debug('display_items_from_node: %s' % node.items) log.debug('display_items_from_node: %s' % node.items)
for item in node.items: for item in node.items:
self.item_listview.lines.append(item.to_dict(columns)) self.item_listview.lines.append(item.to_dict(columns))

View file

@ -1512,6 +1512,14 @@ class ListWin(Win):
self._selected_row = 0 self._selected_row = 0
self._starting_pos = 0 # The column number from which we start the refresh self._starting_pos = 0 # The column number from which we start the refresh
def empty(self):
"""
emtpy the list and reset some important values as well
"""
self.lines = []
self._selected_row = 0
self._starting_pos = 0
def resize_columns(self, dic): def resize_columns(self, dic):
""" """
Resize the width of the columns Resize the width of the columns