'Open the User categories editor.'

def do_edit_user_categories(self, on_category=None):

    db = self.library_view.model().db
    d = TagCategories(self, db, on_category, book_ids=self.tags_view.model().get_book_ids_to_use())
    if (d.exec_() == d.Accepted):
        db.field_metadata.remove_user_categories()
        db.new_api.set_pref(u'user_categories', d.categories)
        db.new_api.refresh_search_locations()
        self.tags_view.recount()
        self.user_categories_edited()
