mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 15:38:43 +00:00
While clearing the search filter, restore from pre-filter if available.
This commit is contained in:
parent
9ec44894d4
commit
8f1730591b
1 changed files with 12 additions and 4 deletions
|
@ -213,6 +213,17 @@ class SearchBox(object):
|
||||||
if self.search_pending and self.search_pending.active():
|
if self.search_pending and self.search_pending.active():
|
||||||
self.search_pending.cancel()
|
self.search_pending.cancel()
|
||||||
|
|
||||||
|
if self.prefiltered:
|
||||||
|
filter_column = self.torrentview.columns["filter"].column_indices[0]
|
||||||
|
torrent_id_column = self.torrentview.columns["torrent_id"].column_indices[0]
|
||||||
|
for row in self.torrentview.liststore:
|
||||||
|
torrent_id = row[torrent_id_column]
|
||||||
|
|
||||||
|
if torrent_id in self.prefiltered:
|
||||||
|
# Reset to previous filter state
|
||||||
|
self.prefiltered.pop(self.prefiltered.index(torrent_id))
|
||||||
|
row[filter_column] = not row[filter_column]
|
||||||
|
|
||||||
self.prefiltered = None
|
self.prefiltered = None
|
||||||
|
|
||||||
self.search_torrents_entry.set_text("")
|
self.search_torrents_entry.set_text("")
|
||||||
|
@ -573,10 +584,7 @@ class TorrentView(listview.ListView, component.Component):
|
||||||
# Insert a new row to the liststore
|
# Insert a new row to the liststore
|
||||||
row = self.liststore.append()
|
row = self.liststore.append()
|
||||||
# Store the torrent id
|
# Store the torrent id
|
||||||
self.liststore.set_value(
|
self.liststore.set_value(row, self.columns["torrent_id"].column_indices[0], torrent_id)
|
||||||
row,
|
|
||||||
self.columns["torrent_id"].column_indices[0],
|
|
||||||
torrent_id)
|
|
||||||
if update:
|
if update:
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue