def _create_episode_menu(self): """Create a list of available seasons.""" menu = TextMenu(0.4978, 0.1563, 0.4393, 0.0781) episodes_list = [[_("%(num)d. %(title)s") % \ {'num': episode.number, 'title': episode.title}, None, episode] for episode in self.episodes] menu.async_add(episodes_list) menu.active = True return menu
def _create_track_menu(self): """ Create track menu. This menu contains list of all tracks on album. """ menu = TextMenu(0.4978, 0.2344, 0.4393, 0.0781) tracks = self.album.tracks tracks_list = [[track.title, track.length_string, track] \ for track in tracks] menu.async_add(tracks_list) return menu
def _create_album_menu(self): """ Create ImageAlbum-menu. This menu contains list of albums. It also displays number of photographs per album. """ menu = TextMenu(0.5271, 0.3385, 0.4393, 0.0781) menu.visible_rows = 7 albums = self.image_library.get_albums() albums_list = [[album.get_title(), str(album.get_number_of_images()), album] for album in albums if album.get_number_of_images() != 0] menu.async_add(albums_list) menu.active = True return menu
def _create_season_menu(self): """ Create a list of available seasons """ menu = TextMenu(0.4978, 0.1563, 0.4393, 0.0781) seasons = self.tv_series.seasons seasons.sort() seasons_list = [[_("Season %(num)s") % {'num': season}, None, season] \ for season in seasons] menu.async_add(seasons_list) menu.active = True return menu
def _create_track_menu(self, tracks): """ Create a track menu. This menu contains list of all tracks on album. @param tracks: List of CompactDisc objects """ menu = TextMenu(0.4978, 0.2344, 0.4393, 0.0781) menu.visible_rows = 7 tracks_list = [[track.title, track.length_string, index] \ for index, track in enumerate(tracks)] menu.async_add(tracks_list) menu.active = True menu.connect('selected', self._handle_select) menu.connect('moved', self._display_selected_track) return menu
def _create_album_menu(self): """ Create ImageAlbum-menu. This menu contains list of albums. It also displays number of photographs per album. """ menu = TextMenu(0.5271, 0.3385, 0.4393, 0.0781) menu.visible_rows = 7 albums = self.image_library.get_albums() albums_list = [[ album.get_title(), str(album.get_number_of_images()), album ] for album in albums if album.get_number_of_images() != 0] menu.async_add(albums_list) menu.active = True return menu