def _add_albums(self, albums): if albums and not self._stop: widget = AlbumSimpleWidget(albums.pop(0)) widget.show() self._albumbox.insert(widget, -1) GLib.idle_add(self._add_albums, albums) else: self._stop = False
def _add_albums(self, albums): if albums and not self._stop: widget = AlbumSimpleWidget(albums.pop(0)) widget.show() self._albumbox.insert(widget, -1) GLib.idle_add(self._add_albums, albums) else: self._stop = False
def _add_albums(self, albums): """ Pop an album and add it to the view, repeat operation until album list is empty @param [album ids as int] """ if albums and not self._stop: widget = AlbumSimpleWidget(albums.pop(0)) widget.show() self._albumbox.insert(widget, -1) GLib.idle_add(self._add_albums, albums) else: self._stop = False
def _add_albums(self, albums): """ Add albums to the view Start lazy loading @param [album ids as int] """ if albums and not self._stop: widget = AlbumSimpleWidget(albums.pop(0), self._genre_ids, self._artist_ids) self._albumbox.insert(widget, -1) widget.show() self._lazy_queue.append(widget) GLib.idle_add(self._add_albums, albums) else: self._stop = False GLib.idle_add(self.lazy_loading) if self._viewport.get_child() is None: self._viewport.add(self._albumbox)
def _add_albums(self, albums): """ Add albums to the view Start lazy loading @param [album ids as int] """ if albums and not self._stop: widget = AlbumSimpleWidget(albums.pop(0), self._genre_ids, self._artist_ids) self._albumbox.insert(widget, -1) widget.show() self._lazy_queue.append(widget) GLib.idle_add(self._add_albums, albums) else: self._stop = False GLib.idle_add(self.lazy_loading) if self._viewport.get_child() is None: self._viewport.add(self._albumbox)
def __add_albums(self, albums): """ Add albums to the view Start lazy loading @param [album ids as int] """ if self._stop: self._stop = False return if albums: widget = AlbumSimpleWidget(albums.pop(0), self.__genre_ids, self.__artist_ids) widget.connect('overlayed', self._on_overlayed) self._box.insert(widget, -1) widget.show() self._lazy_queue.append(widget) GLib.idle_add(self.__add_albums, albums) else: GLib.idle_add(self.lazy_loading) if self._viewport.get_child() is None: self._viewport.add(self._box)
def __add_albums(self, albums): """ Add albums to the view Start lazy loading @param [album ids as int] """ if self._stop: self._stop = False return if albums: widget = AlbumSimpleWidget(albums.pop(0), self.__genre_ids, self.__artist_ids) widget.connect('overlayed', self._on_overlayed) self._box.insert(widget, -1) widget.show() self._lazy_queue.append(widget) GLib.idle_add(self.__add_albums, albums) else: GLib.idle_add(self.lazy_loading) if self._viewport.get_child() is None: self._viewport.add(self._box)