Allow filtering templates by setting them to inactive
This commit is contained in:
@@ -106,7 +106,8 @@ class ProjectXMLReader:
|
|||||||
as attributes. The id attribute was also added to the project.
|
as attributes. The id attribute was also added to the project.
|
||||||
|
|
||||||
Rev 1: Drops the titleFormat node from settings. 2.1 Beta 1.
|
Rev 1: Drops the titleFormat node from settings. 2.1 Beta 1.
|
||||||
Rev 2: Drops the title node from project. 2.3 Beta 1.
|
Rev 2: Drops the title node from project and adds the TEMPLATE
|
||||||
|
class for items. 2.3 Beta 1.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, path: str | Path) -> None:
|
def __init__(self, path: str | Path) -> None:
|
||||||
|
|||||||
@@ -429,11 +429,11 @@ class GuiProjectToolBar(QWidget):
|
|||||||
# Public Slots
|
# Public Slots
|
||||||
##
|
##
|
||||||
|
|
||||||
@pyqtSlot(str, str, QIcon, bool)
|
@pyqtSlot(str, NWItem, QIcon)
|
||||||
def treeItemRefreshed(self, tHandle: str, name: str, icon: QIcon, isTemplate: bool) -> None:
|
def treeItemRefreshed(self, tHandle: str, nwItem: NWItem, icon: QIcon) -> None:
|
||||||
"""Process change in tree items to update menu content."""
|
"""Process change in tree items to update menu content."""
|
||||||
if isTemplate:
|
if nwItem.isTemplateFile() and nwItem.isActive:
|
||||||
self.mTemplates.addUpdate(tHandle, name, icon)
|
self.mTemplates.addUpdate(tHandle, nwItem.itemName, icon)
|
||||||
elif tHandle in self.mTemplates:
|
elif tHandle in self.mTemplates:
|
||||||
self.mTemplates.remove(tHandle)
|
self.mTemplates.remove(tHandle)
|
||||||
return
|
return
|
||||||
@@ -494,7 +494,7 @@ class GuiProjectTree(QTreeWidget):
|
|||||||
D_HANDLE = Qt.ItemDataRole.UserRole
|
D_HANDLE = Qt.ItemDataRole.UserRole
|
||||||
D_WORDS = Qt.ItemDataRole.UserRole + 1
|
D_WORDS = Qt.ItemDataRole.UserRole + 1
|
||||||
|
|
||||||
itemRefreshed = pyqtSignal(str, str, QIcon, bool)
|
itemRefreshed = pyqtSignal(str, NWItem, QIcon)
|
||||||
|
|
||||||
def __init__(self, projView: GuiProjectView) -> None:
|
def __init__(self, projView: GuiProjectView) -> None:
|
||||||
super().__init__(parent=projView)
|
super().__init__(parent=projView)
|
||||||
@@ -1064,7 +1064,7 @@ class GuiProjectTree(QTreeWidget):
|
|||||||
trItem.setFont(self.C_NAME, trFont)
|
trItem.setFont(self.C_NAME, trFont)
|
||||||
|
|
||||||
# Emit Refresh Signal
|
# Emit Refresh Signal
|
||||||
self.itemRefreshed.emit(tHandle, nwItem.itemName, itemIcon, nwItem.isTemplateFile())
|
self.itemRefreshed.emit(tHandle, nwItem, itemIcon)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user