Commits

Vladimir Kolev  committed 8ee75ce

Automatic looping the playlist is now functional as expected.
Double clicking a playlist item starts it.

  • Participants
  • Parent commits c425f03

Comments (0)

Files changed (2)

File gsharkdown.py

         self.playlist = gtk.ListStore(str, str, str)
         self.play_view = builder.get_object('treeview2')
         self.play_view.set_model(self.playlist)
+        self.play_view.connect('row-activated', self.double_click_start)
         self._create_play_columns()
 
         self.staticon = gtk.StatusIcon()
         CONFIG['shuffle_playlist'] = int(widget.get_active())
         CONFIG.write()
 
+    def double_click_start(self, path, column, data=None):
+        self.player.set_state(gst.STATE_NULL)
+        self.playing = column[0]
+        self.play_button.set_stock_id(gtk.STOCK_MEDIA_STOP)
+        song = self.playitems[column[0]]
+        self.set_songinfos(song)
+        t = t_play(self, song, int(CONFIG['repeat_playlist']))
+        t.start()
+
     def play_next(self, widget, data=None):
         """
         Plays the next item from the playlist
         """
         if self.playing == None:
-            print "starting at the start"
             self.play_selected(self.play_button)
         else:
             index = self.playing + 1

File lib/tfuncs.py

 
     def on_stopped(self, config, widget=None, data=None):
         if self.repeat == 1:
-            self.win.playing = None
             self.win.play_next(self.win.ff_button)
         else:
             self.win.play_button.set_stock_id(gtk.STOCK_MEDIA_PLAY)