def __build_tag_table(self): self.__tag_widgets = [] self.tags_table.foreach(self.tags_table.remove) tmpl = self._get_selected_template() if tmpl is None: return for i in xrange(0, tmpl['maxtags']): label = Gtk.Label(label=_('Tag %s') % (i + 1)) combo = self.__build_tag_combo(i) spin = self.__build_spin(i) self.tags_table.attach(label, 0, i, 1, 1) self.tags_table.attach(combo, 1, i, 1, 1) self.tags_table.attach(spin, 2, i, 1, 1) self.__tag_widgets.append((combo, spin)) # do this *after* the widgets are built for i, (cb, sp) in enumerate(self.__tag_widgets): guiutil.persist_selection(cb, 2, 'plugin/playlistanalyzer/tag%s' % i) self.tags_table.show_all()
def __init__(self, plugin, selected_playlist=None): self.plugin = plugin guiutil.initialize_from_xml(self) self.info_bar = dialogs.MessageBar(self.info_bar, type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_CLOSE) self.__build_template_list() self.__build_playlist_list(selected_playlist) self.__initialize_presets() self.__tag_widgets = [] self.window.show_all() def tag_data_key(td): if td: return td.translated_name # convenience td = tag_data.values() # Add grouptagger to the list gt = get_default_tagdata('__grouptagger') gt.translated_name = _('GroupTagger') td.append(gt) self.__sorted_tags = sorted(td, key=tag_data_key) # setup the selected template guiutil.persist_selection(self.template_list, 0, 'plugin/playlistanalyzer/last_tmpl')
def __init__(self, plugin, selected_playlist=None): self.plugin = plugin guiutil.initialize_from_xml(self) self.info_bar = dialogs.MessageBar(self.info_bar, type=Gtk.MessageType.ERROR, buttons=Gtk.ButtonsType.CLOSE) self.__build_template_list() self.__build_playlist_list(selected_playlist) self.__initialize_presets() self.__tag_widgets = [] self.window.show_all() def tag_data_key(td): if td: return td.translated_name # convenience td = tag_data.values() # Add grouptagger to the list gt = get_default_tagdata('__grouptagger') gt.translated_name = _('GroupTagger') td.append(gt) self.__sorted_tags = sorted(td, key=tag_data_key) # setup the selected template guiutil.persist_selection(self.template_list, 0, 'plugin/playlistanalyzer/last_tmpl')
def __build_tag_table(self): self.__tag_widgets = [] self.tags_table.foreach(self.tags_table.remove) tmpl = self._get_selected_template() if tmpl is None: return self.tags_table.resize(tmpl['maxtags'], 3) for i in xrange(0, tmpl['maxtags']): label = gtk.Label(_('Tag %s') % (i + 1)) combo = self.__build_tag_combo(i) spin = self.__build_spin(i) self.tags_table.attach(label, 0, 1, i, i+1, xoptions=0, yoptions=0) self.tags_table.attach(combo, 1, 2, i, i+1, xoptions=0, yoptions=0) self.tags_table.attach(spin, 2, 3, i, i+1, xoptions=0, yoptions=0) self.__tag_widgets.append((combo, spin)) # do this *after* the widgets are built for i, (cb, sp) in enumerate(self.__tag_widgets): guiutil.persist_selection(cb, 2, 'plugin/playlistanalyzer/tag%s' % i) self.tags_table.show_all()
def __build_tag_table(self): self.__tag_widgets = [] self.tags_table.foreach(self.tags_table.remove) tmpl = self._get_selected_template() if tmpl is None: return for i in xrange(0, tmpl["maxtags"]): label = Gtk.Label(label=_("Tag %s") % (i + 1)) combo = self.__build_tag_combo(i) spin = self.__build_spin(i) self.tags_table.attach(label, 0, i, 1, 1) self.tags_table.attach(combo, 1, i, 1, 1) self.tags_table.attach(spin, 2, i, 1, 1) self.__tag_widgets.append((combo, spin)) # do this *after* the widgets are built for i, (cb, sp) in enumerate(self.__tag_widgets): guiutil.persist_selection(cb, 2, "plugin/playlistanalyzer/tag%s" % i) self.tags_table.show_all()