[gnome-music/freeze-break: 80/107] widgets: Add method to get selected playlist in PlaylistDialog



commit c1398c1e66d0c7cf75f0e9165f6eea7e85a7d740
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Fri Sep 6 23:15:58 2013 +0800

    widgets: Add method to get selected playlist in PlaylistDialog

 gnomemusic/widgets.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index f51960b..0525537 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -632,6 +632,14 @@ class PlaylistDialog():
         self._cancel_button.connect('clicked', self._on_cancel_button_clicked)
         self._select_button.connect('clicked', self._on_selection)
 
+    def get_selected(self):
+        _iter = self.selection.get_selected()[1]
+
+        if not _iter or self.model[_iter][1]:
+            return None
+
+        return self.model[_iter][0]
+
     def _add_list_renderers(self):
         cols = Gtk.TreeViewColumn()
         type_renderer = Gd.StyledTextRenderer(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]