mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
Improve method to update log view after search text change
This commit is contained in:
parent
0beee4cf4f
commit
68fd8fc604
2 changed files with 14 additions and 12 deletions
|
@ -1410,6 +1410,19 @@ class Window (object):
|
||||||
# the previous visible range.
|
# the previous visible range.
|
||||||
self.log_view.scroll_to_cell (path, use_align = True, row_align = .5)
|
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):
|
def handle_window_delete_event (self, window, event):
|
||||||
|
|
||||||
self.actions.close_window.activate ()
|
self.actions.close_window.activate ()
|
||||||
|
|
|
@ -277,6 +277,7 @@ class FindBarFeature (FeatureBase):
|
||||||
|
|
||||||
column = self.window.column_manager.find_item (name = "message")
|
column = self.window.column_manager.find_item (name = "message")
|
||||||
column.highlighters[self] = self.operation.match_func
|
column.highlighters[self] = self.operation.match_func
|
||||||
|
self.window.update_view ()
|
||||||
|
|
||||||
def handle_match_found (self, model, tree_iter):
|
def handle_match_found (self, model, tree_iter):
|
||||||
|
|
||||||
|
@ -308,18 +309,6 @@ class FindBarFeature (FeatureBase):
|
||||||
else:
|
else:
|
||||||
return
|
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):
|
def clear_results (self):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue