Filtering improvements

When a list is filtered, if the Nth song is selected we should play song
N in the filtered list and not the original list.
This commit is contained in:
Bryan Schumaker 2010-10-14 08:16:13 -04:00
parent eb7932fad2
commit 45e2b0325f
2 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,10 @@ ins_tree = None
class TrackRecord:
def __init__(self, year, length, lenstr):
self.length = length
self.lenstr = lenstr
if lenstr[0] == "0" and lenstr[1] == ":":
self.lenstr = lenstr[2:]
else:
self.lenstr = lenstr
self.count = 0
self.year = year
#self.like = None

View File

@ -51,7 +51,7 @@ class Collection(gtk.ScrolledWindow):
list.set_value(list_iter, len(list_row)-1, "Played: %s"%string)
def row_activated(self, widget, path, column):
list = self.list.list
list = self.list.filter_model
iter = list.get_iter(path)
row = list[iter]
self.selected_row(row)
@ -79,6 +79,7 @@ class Library(Collection):
return collection.lib_get_attr(row[0], "playcount")
def select_row(self, row):
print row[0], row[1]
collection.lib_play_id(row[0])
def filter(self, text):