Merge pull request #1349 from RumovZ/rename-with-parents

Disable 'Rename with Parents' for top-level items
This commit is contained in:
Damien Elmes 2021-08-30 22:27:44 +10:00 committed by GitHub
commit ab20f215b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -906,7 +906,10 @@ class SidebarTreeView(QTreeView):
) -> None: ) -> None:
if item.item_type.is_editable() and len(self._selected_items()) == 1: if item.item_type.is_editable() and len(self._selected_items()) == 1:
menu.addAction(tr.actions_rename(), lambda: self.edit(index)) menu.addAction(tr.actions_rename(), lambda: self.edit(index))
if item.item_type in (SidebarItemType.TAG, SidebarItemType.DECK): if (
item.item_type in (SidebarItemType.TAG, SidebarItemType.DECK)
and item.name_prefix
):
menu.addAction( menu.addAction(
tr.actions_rename_with_parents(), tr.actions_rename_with_parents(),
lambda: self._on_rename_with_parents(item), lambda: self._on_rename_with_parents(item),