Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/playlist.py
diff options
context:
space:
mode:
Diffstat (limited to 'playlist.py')
-rw-r--r--playlist.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/playlist.py b/playlist.py
index f91110d..d295f79 100644
--- a/playlist.py
+++ b/playlist.py
@@ -79,7 +79,6 @@ class PlayList(Gtk.ScrolledWindow):
self.listview.set_enable_search(False)
self.listview.connect('row-activated', self.__on_row_activated)
-
self.add(self.listview)
def __on_row_activated(self, treeview, path, col):
@@ -91,10 +90,16 @@ class PlayList(Gtk.ScrolledWindow):
path = self._items[index]['path']
available = self._items[index]['available']
if available:
- self._current_playing = index
- self.set_cursor(index)
+ self.set_current_playing(index)
self.emit('play-index', index, path)
+ def set_current_playing(self, index):
+ self._current_playing = index
+ self._set_cursor(index)
+
+ def get_current_playing(self):
+ return self._current_playing
+
def _set_number(self, column, cell, model, it, data):
idx = model.get_value(it, COLUMNS['index'])
cell.set_property('text', idx + 1)
@@ -113,7 +118,7 @@ class PlayList(Gtk.ScrolledWindow):
available = model.get_value(it, COLUMNS['available'])
cell.set_property('visible', not available)
- def set_cursor(self, index):
+ def _set_cursor(self, index):
self.listview.set_cursor((index,))
def delete_selected_items(self):