[omemo] Add search to Key Dialog

This commit is contained in:
Philipp Hörist
2019-02-24 00:46:15 +01:00
parent a9d1099145
commit 55f32fb262
2 changed files with 39 additions and 1 deletions

View File

@@ -94,6 +94,9 @@ class KeyDialog(Gtk.Dialog):
self.show_all()
def _filter_func(self, row, _user_data):
search_text = self._ui.search.get_text()
if search_text and search_text.lower() not in str(row.jid):
return False
if self._show_inactive:
return True
return row.active
@@ -111,6 +114,9 @@ class KeyDialog(Gtk.Dialog):
return -1 if row1.trust > row2.trust else 1
return 0
def _on_search_changed(self, _entry):
self._ui.list.invalidate_filter()
def update(self):
self._ui.list.foreach(self._ui.list.remove)
self._load_fingerprints(self._own_jid)