Ejemplo n.º 1
0
 def _add_albums(self, albums, genre_id):
     size_group = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
     if albums and not self._stop:
         widget = AlbumDetailedWidget(albums.pop(0), genre_id,
                                      self._show_menu, False, size_group)
         widget.show()
         start_new_thread(widget.populate, ())
         self._albumbox.add(widget)
         GLib.idle_add(self._add_albums, albums, genre_id)
     else:
         self._stop = False
Ejemplo n.º 2
0
 def _populate_context(self, album_id):
     size_group = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
     self._context_widget = AlbumDetailedWidget(album_id, self._genre_id,
                                                True, True, size_group)
     start_new_thread(self._context_widget.populate, ())
     self._context_widget.show()
     view = AlbumContextView(self._context_widget)
     view.show()
     self._context.add(view)
     self._context.set_visible_child(view)
     self._context.clean_old_views(view)
Ejemplo n.º 3
0
 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]
     """
     size_group = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
     widget = AlbumDetailedWidget(albums.pop(0), self._genre_id,
                                  self._pop_allowed, False, size_group)
     widget.connect('finished', self._on_album_finished, albums)
     widget.show()
     start_new_thread(widget.populate, ())
     self._albumbox.add(widget)
Ejemplo n.º 4
0
 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]
     """
     size_group = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
     widget = AlbumDetailedWidget(albums.pop(0), self._genre_id,
                                  self._artist_id is not None, size_group)
     widget.connect('finished', self._on_album_finished, albums)
     widget.show()
     t = Thread(target=widget.populate)
     t.daemon = True
     t.start()
     self._albumbox.add(widget)
Ejemplo n.º 5
0
 def _populate_context(self, album_id):
     """
         populate context view
         @param album id as int
     """
     size_group = Gtk.SizeGroup(mode=Gtk.SizeGroupMode.HORIZONTAL)
     self._context_widget = AlbumDetailedWidget(album_id, self._genre_id,
                                                True, True, size_group)
     self._context_widget.populate()
     self._context_widget.show()
     view = AlbumContextView(self._context_widget)
     view.show()
     self._context.add(view)
     self._context.set_visible_child(view)
     self._context.clean_old_views(view)
Ejemplo n.º 6
0
 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:
         album_id = albums.pop(0)
         widget = AlbumDetailedWidget(album_id, self._genre_ids,
                                      self._artist_ids, self.__show_cover)
         self._lazy_queue.append(widget)
         widget.show()
         self._albumbox.add(widget)
         GLib.idle_add(self.__add_albums, albums)
     else:
         self.__spinner.stop()
         self.__spinner.hide()
         self.emit('populated')
         GLib.idle_add(self.lazy_loading)
Ejemplo n.º 7
0
 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:
         album_id = albums.pop(0)
         widget = AlbumDetailedWidget(album_id,
                                      self._genre_ids,
                                      self._artist_ids)
         self._lazy_queue.append(widget)
         # Not needed if only one album
         if self._albums_count == 1:
             widget.disable_play_all()
         widget.show()
         self._albumbox.add(widget)
         GLib.idle_add(self._add_albums, albums)
     else:
         if self._viewport.get_child() is None:
             self._viewport.add(self._albumbox)
         self.emit('populated')
         GLib.idle_add(self.lazy_loading)