コード例 #1
0
 def is_populated(self):
     """
         Return True if populated
         @return bool
     """
     return True if self._responsive_widget is None or self.__reveal\
         else TracksView.get_populated(self)
コード例 #2
0
 def _on_tracks_populated(self, disc_number):
     """
         Emit populated signal
         @param disc_number as int
     """
     if TracksView.get_populated(self):
         from lollypop.view_albums_box import AlbumsBoxView
         for artist_id in self.__artist_ids:
             if artist_id == Type.COMPILATIONS:
                 album_ids = App().albums.get_compilation_ids(
                     self.__genre_ids)
             else:
                 album_ids = App().albums.get_ids([artist_id], [])
             if self._album.id in album_ids:
                 album_ids.remove(self._album.id)
             if not album_ids:
                 continue
             artist = GLib.markup_escape_text(
                 App().artists.get_name(artist_id))
             label = Gtk.Label.new()
             label.set_markup('''<span size="large" alpha="40000"
                                  weight="bold">%s %s</span>''' %
                              (_("Others albums from"), artist))
             label.set_property("halign", Gtk.Align.START)
             label.set_margin_top(40)
             label.show()
             self.__grid.add(label)
             self.__others_box = AlbumsBoxView([], [artist_id],
                                               ViewType.SMALL)
             self.__others_box.show()
             self.__grid.add(self.__others_box)
             self.__others_box.populate([Album(id) for id in album_ids])
     else:
         TracksView.populate(self)