Improve method to update log view after search text change

This commit is contained in:
René Stadler 2007-12-03 16:07:05 +02:00 committed by Stefan Sauer
parent 0beee4cf4f
commit 68fd8fc604
2 changed files with 14 additions and 12 deletions

View file

@ -1410,6 +1410,19 @@ class Window (object):
# the previous visible range.
self.log_view.scroll_to_cell (path, use_align = True, row_align = .5)
def update_view (self):
view = self.log_view
model = view.props.model
start_path, end_path = view.get_visible_range ()
start_index, end_index = start_path[0], end_path[0]
for line_index in range (start_index, end_index + 1):
path = (line_index,)
tree_iter = model.get_iter (path)
model.row_changed (path, tree_iter)
def handle_window_delete_event (self, window, event):
self.actions.close_window.activate ()

View file

@ -277,6 +277,7 @@ class FindBarFeature (FeatureBase):
column = self.window.column_manager.find_item (name = "message")
column.highlighters[self] = self.operation.match_func
self.window.update_view ()
def handle_match_found (self, model, tree_iter):
@ -308,18 +309,6 @@ class FindBarFeature (FeatureBase):
else:
return
model = self.log_view.props.model
start_path, end_path = self.log_view.get_visible_range ()
start_index, end_index = start_path[0], end_path[0]
# Update highlighting. FIXME: Probably not needed/can be done better.
for line_index in new_matches:
path = (line_index,)
tree_iter = model.get_iter (path)
if line_index >= start_index and line_index <= end_index:
model.row_changed (path, tree_iter)
def clear_results (self):
try: