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:
parent
eb7932fad2
commit
45e2b0325f
|
@ -14,7 +14,10 @@ ins_tree = None
|
||||||
class TrackRecord:
|
class TrackRecord:
|
||||||
def __init__(self, year, length, lenstr):
|
def __init__(self, year, length, lenstr):
|
||||||
self.length = length
|
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.count = 0
|
||||||
self.year = year
|
self.year = year
|
||||||
#self.like = None
|
#self.like = None
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Collection(gtk.ScrolledWindow):
|
||||||
list.set_value(list_iter, len(list_row)-1, "Played: %s"%string)
|
list.set_value(list_iter, len(list_row)-1, "Played: %s"%string)
|
||||||
|
|
||||||
def row_activated(self, widget, path, column):
|
def row_activated(self, widget, path, column):
|
||||||
list = self.list.list
|
list = self.list.filter_model
|
||||||
iter = list.get_iter(path)
|
iter = list.get_iter(path)
|
||||||
row = list[iter]
|
row = list[iter]
|
||||||
self.selected_row(row)
|
self.selected_row(row)
|
||||||
|
@ -79,6 +79,7 @@ class Library(Collection):
|
||||||
return collection.lib_get_attr(row[0], "playcount")
|
return collection.lib_get_attr(row[0], "playcount")
|
||||||
|
|
||||||
def select_row(self, row):
|
def select_row(self, row):
|
||||||
|
print row[0], row[1]
|
||||||
collection.lib_play_id(row[0])
|
collection.lib_play_id(row[0])
|
||||||
|
|
||||||
def filter(self, text):
|
def filter(self, text):
|
||||||
|
|
Loading…
Reference in New Issue