From 8c56e6c291fa34e683d2b3d2d275c6fdbadfbdae Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Tue, 5 Jun 2018 16:35:52 +0200 Subject: [PATCH] In the tag browser, ensure that "Change category icon" appears only on top-level nodes. This avoids confusion about what which items are affected in hierarchical categories. --- src/calibre/gui2/tag_browser/view.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/tag_browser/view.py b/src/calibre/gui2/tag_browser/view.py index 73b01793e6..2c42fcd7fa 100644 --- a/src/calibre/gui2/tag_browser/view.py +++ b/src/calibre/gui2/tag_browser/view.py @@ -650,11 +650,12 @@ class TagsView(QTreeView): # {{{ partial(self.context_menu_handler, action='manage_searches', category=tag.name if tag else None)) - self.context_menu.addSeparator() - self.context_menu.addAction(_('Change category icon'), - partial(self.context_menu_handler, action='set_icon', key=key)) - self.context_menu.addAction(_('Restore default icon'), - partial(self.context_menu_handler, action='clear_icon', key=key)) + if tag is None: + self.context_menu.addSeparator() + self.context_menu.addAction(_('Change category icon'), + partial(self.context_menu_handler, action='set_icon', key=key)) + self.context_menu.addAction(_('Restore default icon'), + partial(self.context_menu_handler, action='clear_icon', key=key)) # Always show the User categories editor self.context_menu.addSeparator()