def _open_editor(widget): def _editor_closed(widget): tags = widget.get_strings() config.setlist("plugins", "wiki_tags", tags) tags = config.getlist("plugins", "wiki_tags", self.DEFAULT_TAGS) editor = TagListEditor(_("Edit Tags"), [] if tags == [''] else tags) editor.set_transient_for(get_top_parent(parent)) editor.connect('destroy', _editor_closed) editor.show()
def update_submenu(self): submenu = Gtk.Menu() tags = config.getlist("plugins", "wiki_tags", self.DEFAULT_TAGS) for tag in tags: if tag: item = Gtk.MenuItem(label=util.tag(tag)) item.connect('activate', self._set_selected_tag, tag) submenu.append(item) if submenu.get_children(): self.set_submenu(submenu) else: self.set_sensitive(False)
def set_all_column_headers(cls, headers): set_columns(headers) try: headers.remove("~current") except ValueError: pass cls.headers = headers for listview in cls.instances(): listview.set_column_headers(headers) star = list(Query.STAR) for header in headers: for tag in header_tag_split(header): if not tag.startswith("~#") and tag not in star: star.append(tag) for tag in config.getlist("settings", "search_tags"): if tag and tag not in star: star.append(tag) SongList.star = star
def set_all_column_headers(cls, headers): set_columns(headers) try: headers.remove("~current") except ValueError: pass cls.headers = headers for listview in cls.instances(): listview.set_column_headers(headers) star = list(Query.STAR) for header in headers: for tag in header_tag_split(header): if not tag.startswith("~#") and tag not in star: star.append(tag) for tag in config.getlist("settings", "search_tags"): if tag and tag not in star: star.append(tag) SongList.star = star