Example #1
0
 def populate_submenu(self, category_menu, encodings):
     for encoding, name in encodings:
         label = '%s (%s)' % (name, encoding)
         menu_item = RadioMenuItem(label,
                                   self.action_name(encoding))
         menu_item.set_state(False)
         menu_item.connect("activate", self.on_activate, encoding)
         category_menu.append(menu_item)
         menu_item.set_group(self.default_item)
Example #2
0
    def make_items_for_tracks(self):
        """Get MenuItems for subtitle tracks embedded in the video."""

        if not self.all_tracks:
            return [self.none_available]

        items = []
        first_item = None
        for track_id, label in self.all_tracks:
            menu_item = RadioMenuItem(label, self.action_name(track_id))
            menu_item.connect("activate", self.on_change_track, track_id)
            items.append(menu_item)
            if first_item is None:
                first_item = menu_item
            else:
                menu_item.set_group(first_item)

        items.append(Separator())
        disable = RadioMenuItem(_("Disable Subtitles"), "DisableSubtitles")
        disable.connect("activate", self.on_disable)
        disable.set_group(first_item)
        items.append(disable)
        return items