Made filterQuick function to count rows that would be visible. Does not actually hide rows

git-svn-id: file:///home/anna/Desktop/ocarina-legacy/mithos/ocarina@50 1daee41c-8060-4895-b1f0-2197c00d777a
This commit is contained in:
bjschuma 2009-07-29 23:30:06 +00:00
parent d0c4da25fa
commit b6a29ba2b0
5 changed files with 20 additions and 41 deletions

View File

@ -79,12 +79,4 @@ class LibList(List):
def filterQuick(self,string):
self.count = 0
self.seconds = 0
self.string = string
for i in range(self.data.library.count):
if self.hideRows(None,i,string) == True:
self.count+=1
self.seconds+=self.data.library.files[i].duration
print self.count
self.makeLabel()
List.filterQuick(self,self.data.library.files,string)

View File

@ -153,10 +153,10 @@ class List(gtk.ScrolledWindow):
self.count = 0
self.seconds = 0
self.string = string
for i in range(len(list)):
if self.hideRows(None,list[i],string) == True:
for file in list:
if self.hideRows(None,file,string) == True:
self.count+=1
self.seconds+=self.data.library.files[i].duration
self.seconds+=file.duration
print self.count
self.makeLabel()
@ -165,23 +165,9 @@ class List(gtk.ScrolledWindow):
if list:
file = self.data.library.files[list[iter][0]]
else:
file = self.data.library.files[iter]
file = iter
if self.string == "":
return True
#elif len(self.string) == 1:
#return (self.string in file.single)
#try:
# file.single[self.string]
# return True
#except:
# return False
#elif len(self.string) == 2:
# return (self.string in file.double)
#try:
# file.double[self.string]
# return True
#except:
# return False
if re.search(self.string,file.titlel):
return True
elif re.search(self.string,file.artistl):

View File

@ -62,3 +62,7 @@ class Playlist(List):
def addToQ(self,widgit,func,data):
self.selection(self.queue.insert)
self.queue.filterRows("")
def filterQuick(self,string):
List.filterQuick(self,self.data.curList,string)

View File

@ -43,3 +43,7 @@ class Queue(List):
if self.populated == False:
self.visible("show")
List.filterRows(self,string)
def filterQuick(self,string):
List.filterQuick(self,self.data.curQ,string)

View File

@ -202,6 +202,7 @@ class RightPane(gtk.VBox):
self.queue.visible("show")
else:
self.library.visible("show")
self.textTyped(self.searchBar)
def dumpLib(self):
@ -218,29 +219,21 @@ class RightPane(gtk.VBox):
def filter(self,search):
if self.curTab == 0:
self.playlist.filterRows(search)
self.library.filterQuick(search)
tabs = [1,2]
elif self.curTab == 1:
self.queue.filterRows(search)
tabs = [0,2]
else:
self.library.filterRows(search)
'''tabs = []
if self.curTab == 0:
#self.playlist.filterRows(search)
tabs = [0,1,2]
elif self.curTab == 1:
#self.queue.filterRows(search)
tabs = [1,0,2]
else:
#self.library.filterRows(search)
tabs = [2,0,1]
tabs = [0,1]
for tab in tabs:
if tab == 0:
self.playlist.filterRows(search)
self.playlist.filterQuick(search)
elif tab == 1:
self.queue.filterRows(search)
self.queue.filterQuick(search)
else:
self.library.filterRows(search)'''
self.library.filterQuick(search)
def setStatus(self,status):