From 9b3360e5f13b17497a3942c4d833203abc47e70b Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sat, 26 Oct 2024 18:22:28 +0100 Subject: [PATCH] Remove user categories from the dialog Preferences / Look & feel / Tag browser / Hierarchical categories. They are always hierarchical. Having them listed in this dialog serves no purpose. --- src/calibre/gui2/preferences/look_feel.py | 3 ++- src/calibre/gui2/preferences/look_feel.ui | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py index 0d4118df37..78e5cb4d74 100644 --- a/src/calibre/gui2/preferences/look_feel.py +++ b/src/calibre/gui2/preferences/look_feel.py @@ -486,7 +486,8 @@ class TBHierarchicalFields(DisplayedFields): # {{{ def initialize(self, use_defaults=False, pref_data_override=None): tv = self.gui.tags_view - cats = [k for k in tv.model().categories.keys() if k not in self.cant_make_hierarical] + cats = [k for k in tv.model().categories.keys() if (not k.startswith('@') and + k not in self.cant_make_hierarical)] ans = [] if use_defaults: ans = [[k, False] for k in cats] diff --git a/src/calibre/gui2/preferences/look_feel.ui b/src/calibre/gui2/preferences/look_feel.ui index 55ca97207e..c6d84ff782 100644 --- a/src/calibre/gui2/preferences/look_feel.ui +++ b/src/calibre/gui2/preferences/look_feel.ui @@ -1685,7 +1685,8 @@ and 'Mystery.Thriller' will be displayed with English and Thriller both under 'Mystery'. If 'tags' is not checked then the tags will be displayed each on their own line.</p> <p>The categories 'authors', 'publisher', 'news', 'formats', and 'rating' -cannot be hierarchical.</p> +cannot be hierarchical.</p> +<p>User categories are always hierarchical so don't appear here.</p> Select categories with &hierarchical items: