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:
parent
d0c4da25fa
commit
b6a29ba2b0
|
@ -79,12 +79,4 @@ class LibList(List):
|
||||||
|
|
||||||
|
|
||||||
def filterQuick(self,string):
|
def filterQuick(self,string):
|
||||||
self.count = 0
|
List.filterQuick(self,self.data.library.files,string)
|
||||||
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()
|
|
||||||
|
|
|
@ -153,10 +153,10 @@ class List(gtk.ScrolledWindow):
|
||||||
self.count = 0
|
self.count = 0
|
||||||
self.seconds = 0
|
self.seconds = 0
|
||||||
self.string = string
|
self.string = string
|
||||||
for i in range(len(list)):
|
for file in list:
|
||||||
if self.hideRows(None,list[i],string) == True:
|
if self.hideRows(None,file,string) == True:
|
||||||
self.count+=1
|
self.count+=1
|
||||||
self.seconds+=self.data.library.files[i].duration
|
self.seconds+=file.duration
|
||||||
print self.count
|
print self.count
|
||||||
self.makeLabel()
|
self.makeLabel()
|
||||||
|
|
||||||
|
@ -165,23 +165,9 @@ class List(gtk.ScrolledWindow):
|
||||||
if list:
|
if list:
|
||||||
file = self.data.library.files[list[iter][0]]
|
file = self.data.library.files[list[iter][0]]
|
||||||
else:
|
else:
|
||||||
file = self.data.library.files[iter]
|
file = iter
|
||||||
if self.string == "":
|
if self.string == "":
|
||||||
return True
|
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):
|
if re.search(self.string,file.titlel):
|
||||||
return True
|
return True
|
||||||
elif re.search(self.string,file.artistl):
|
elif re.search(self.string,file.artistl):
|
||||||
|
|
|
@ -62,3 +62,7 @@ class Playlist(List):
|
||||||
def addToQ(self,widgit,func,data):
|
def addToQ(self,widgit,func,data):
|
||||||
self.selection(self.queue.insert)
|
self.selection(self.queue.insert)
|
||||||
self.queue.filterRows("")
|
self.queue.filterRows("")
|
||||||
|
|
||||||
|
|
||||||
|
def filterQuick(self,string):
|
||||||
|
List.filterQuick(self,self.data.curList,string)
|
||||||
|
|
|
@ -43,3 +43,7 @@ class Queue(List):
|
||||||
if self.populated == False:
|
if self.populated == False:
|
||||||
self.visible("show")
|
self.visible("show")
|
||||||
List.filterRows(self,string)
|
List.filterRows(self,string)
|
||||||
|
|
||||||
|
|
||||||
|
def filterQuick(self,string):
|
||||||
|
List.filterQuick(self,self.data.curQ,string)
|
||||||
|
|
|
@ -202,6 +202,7 @@ class RightPane(gtk.VBox):
|
||||||
self.queue.visible("show")
|
self.queue.visible("show")
|
||||||
else:
|
else:
|
||||||
self.library.visible("show")
|
self.library.visible("show")
|
||||||
|
self.textTyped(self.searchBar)
|
||||||
|
|
||||||
|
|
||||||
def dumpLib(self):
|
def dumpLib(self):
|
||||||
|
@ -218,29 +219,21 @@ class RightPane(gtk.VBox):
|
||||||
def filter(self,search):
|
def filter(self,search):
|
||||||
if self.curTab == 0:
|
if self.curTab == 0:
|
||||||
self.playlist.filterRows(search)
|
self.playlist.filterRows(search)
|
||||||
self.library.filterQuick(search)
|
tabs = [1,2]
|
||||||
elif self.curTab == 1:
|
elif self.curTab == 1:
|
||||||
self.queue.filterRows(search)
|
self.queue.filterRows(search)
|
||||||
|
tabs = [0,2]
|
||||||
else:
|
else:
|
||||||
self.library.filterRows(search)
|
self.library.filterRows(search)
|
||||||
'''tabs = []
|
tabs = [0,1]
|
||||||
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]
|
|
||||||
|
|
||||||
for tab in tabs:
|
for tab in tabs:
|
||||||
if tab == 0:
|
if tab == 0:
|
||||||
self.playlist.filterRows(search)
|
self.playlist.filterQuick(search)
|
||||||
elif tab == 1:
|
elif tab == 1:
|
||||||
self.queue.filterRows(search)
|
self.queue.filterQuick(search)
|
||||||
else:
|
else:
|
||||||
self.library.filterRows(search)'''
|
self.library.filterQuick(search)
|
||||||
|
|
||||||
|
|
||||||
def setStatus(self,status):
|
def setStatus(self,status):
|
||||||
|
|
Loading…
Reference in New Issue