Add a quick links dropdown menu to the project tree (#1137)

This commit is contained in:
Veronica Berglyd Olsen
2022-10-14 17:30:28 +02:00
parent bbbad2b170
commit 77ec0a9eed
3 changed files with 91 additions and 18 deletions
+6 -4
View File
@@ -274,11 +274,13 @@ class NWTree:
return rootClasses
def iterRoots(self, itemClass):
"""Iterate over all items of a given class.
"""Iterate over all root items of a given class in order.
"""
for tHandle, nwItem in self._treeRoots.items():
if nwItem.itemClass == itemClass:
yield tHandle, nwItem
for tHandle in self._treeOrder:
nwItem = self.__getitem__(tHandle)
if nwItem is not None and nwItem.isRootType():
if itemClass is None or nwItem.itemClass == itemClass:
yield tHandle, nwItem
return
def isRoot(self, tHandle):