Disable 'Rename with Parents' for top-level items

This commit is contained in:
RumovZ 2021-08-30 11:10:14 +02:00
parent 9a27e44ff8
commit d044360ff9

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),