From 4983110d5032de5e579631186a426dbe70dda185 Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Sun, 27 May 2012 01:43:03 +0200 Subject: [PATCH] Highlight matches when searching (only for >=2 chars entered) --- deluge/ui/console/modes/alltorrents.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index 50fc8951c..00bff1c60 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -781,6 +781,20 @@ class AllTorrents(BaseMode, component.Component): elif row[1] == "Checking": fg = "blue" + if self.entering_search and len(self.search_string) > 1: + lcase_name = self.torrent_names[tidx-1].lower() + sstring_lower = self.search_string.lower() + if lcase_name.find(sstring_lower) != -1: + if tidx == self.cursel: + pass + elif tidx in self.marked: + bg = "magenta" + else: + bg = "green" + if fg == "green": + fg = "black" + attr = "bold" + if attr: colorstr = "{!%s,%s,%s!}"%(fg,bg,attr) else: