Example #1
0
    def yank_entry(self):
        if self.playlist:
            playlist = self.playlist
            selected = self.selected

            if selected:
                # remove all selected
                selected.sort()

                selected_ids = [playlist[i].media_id for i in selected]
                put_buffer(selected_ids)

                self.clear_select()

                logging.info("Yanked %i items to the buffer" % len(selected))
            else:
                # remove item in focus
                focus = self._focus
                put_buffer([playlist[focus].media_id])
                logging.info("Yanked focused item to the buffer")
Example #2
0
    def delete_entry(self):
        if self.playlist:
            playlist = self.playlist
            selected = self.selected

            pl = self.xc.playlist

            if selected:
                # remove all selected
                selected.sort()

                selected_ids = [playlist[i].media_id for i in selected]
                put_buffer(selected_ids)

                for i in reversed(selected):
                    pl.remove_entry(i, self.cur)

                self.clear_select()
            else:
                # remove item in focus
                focus = self._focus
                put_buffer([playlist[focus].media_id])
                pl.remove_entry(focus, self.cur)
Example #3
0
 def save_to_buffer(self):
     order = sum((step['sort'] for step in self.steps), [])
     put_buffer((self.collection, order))
     logging.info("Yanked collection to buffer")