Skip to content

Commit

Permalink
mintUpdate.py: Re-set the type-to-search column any time the model
Browse files Browse the repository at this point in the history
is replaced.

This needs to be done each time, not just at treeview construction.

Issue:
- Restart mintupdate. Click in updates window, type to search.
  Observe that it works.
- Refresh updates, try again. Observe that the UI freezes. The
  search column has been reset, and will use column 0 by default.
  • Loading branch information
mtwebster committed Mar 18, 2024
1 parent d1e071f commit 20f346e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions usr/lib/linuxmint/mintUpdate/mintUpdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,7 @@ def run(self):

self.application.builder.get_object("notebook_details").set_current_page(0)
self.application.treeview.set_model(model)
self.application.treeview.set_search_column(UPDATE_DISPLAY_NAME)
del model
Gdk.threads_leave()

Expand Down Expand Up @@ -1487,7 +1488,6 @@ def __init__(self):

self.treeview.set_tooltip_column(UPDATE_TOOLTIP)

self.treeview.set_search_column(UPDATE_DISPLAY_NAME)
self.treeview.set_search_equal_func(name_search_func)
self.treeview.append_column(column_type)
self.treeview.append_column(column_upgrade)
Expand Down Expand Up @@ -2210,7 +2210,6 @@ def open_history(self, widget):
treeview.append_column(self.column_new_version)
treeview.set_headers_clickable(True)
treeview.set_reorderable(False)
treeview.set_search_column(COL_NAME)
treeview.set_search_equal_func(name_search_func)
treeview.set_enable_search(True)
treeview.show()
Expand Down Expand Up @@ -2288,6 +2287,7 @@ def open_history(self, widget):

model.set_sort_column_id(COL_DATE, Gtk.SortType.DESCENDING)
treeview.set_model(model)
treeview.set_search_column(COL_NAME)

def on_query_tooltip(widget, x, y, keyboard, tooltip):
if not widget.get_tooltip_context(x, y, keyboard):
Expand Down

0 comments on commit 20f346e

Please sign in to comment.