mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
implement search in download diags
This commit is contained in:
parent
9d9f356479
commit
40d187eebc
1 changed files with 12 additions and 3 deletions
|
@ -44,7 +44,8 @@ class GetShared(QDialog):
|
|||
self.onCellChanged)
|
||||
self.form.table.verticalHeader().setDefaultSectionSize(
|
||||
self.parent.config['editLineSize'])
|
||||
self.form.search.setText("search not yet implemented")
|
||||
self.connect(self.form.search, SIGNAL("textChanged(QString)"),
|
||||
self.limit)
|
||||
|
||||
def fetchData(self):
|
||||
h = QHttp(self)
|
||||
|
@ -71,8 +72,16 @@ class GetShared(QDialog):
|
|||
self.typeChanged()
|
||||
self.limit()
|
||||
|
||||
def limit(self):
|
||||
def limit(self, txt=""):
|
||||
if not txt:
|
||||
self.curList = self.allList
|
||||
else:
|
||||
txt = unicode(txt).lower()
|
||||
self.curList = [
|
||||
l for l in self.allList
|
||||
if (txt in l[R_TITLE].lower() or
|
||||
txt in l[R_DESCRIPTION].lower() or
|
||||
txt in l[R_TAGS].lower())]
|
||||
self.redraw()
|
||||
|
||||
def redraw(self):
|
||||
|
|
Loading…
Reference in a new issue