implement search in download diags

This commit is contained in:
Damien Elmes 2009-03-14 09:24:40 +09:00
parent 9d9f356479
commit 40d187eebc

View file

@ -44,7 +44,8 @@ class GetShared(QDialog):
self.onCellChanged) self.onCellChanged)
self.form.table.verticalHeader().setDefaultSectionSize( self.form.table.verticalHeader().setDefaultSectionSize(
self.parent.config['editLineSize']) 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): def fetchData(self):
h = QHttp(self) h = QHttp(self)
@ -71,8 +72,16 @@ class GetShared(QDialog):
self.typeChanged() self.typeChanged()
self.limit() self.limit()
def limit(self): def limit(self, txt=""):
self.curList = self.allList 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() self.redraw()
def redraw(self): def redraw(self):