Пример #1
0
    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
Пример #2
0
    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
Пример #3
0
    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