Rename the access metods of the item class from exported to active

This commit is contained in:
Veronica Berglyd Olsen
2022-10-20 18:14:40 +02:00
parent 5ae96e4d44
commit 93a79f3605
8 changed files with 35 additions and 35 deletions
+1 -1
View File
@@ -802,7 +802,7 @@ class ItemIndex:
continue
if tItem.isNoteLayout():
continue
if skipExcl and not tItem.isExported:
if skipExcl and not tItem.isActive:
continue
tHandle = tItem.itemHandle
+4 -4
View File
@@ -120,7 +120,7 @@ class NWItem:
return self._expanded
@property
def isExported(self):
def isActive(self):
return self._exported
@property
@@ -217,7 +217,7 @@ class NWItem:
self.setName(xValue.text)
self.setStatus(xValue.attrib.get("status", None))
self.setImport(xValue.attrib.get("import", None))
self.setExported(xValue.attrib.get("exported", True))
self.setActive(xValue.attrib.get("exported", True))
# Legacy Format (1.3 and earlier)
elif xValue.tag == "status":
@@ -231,7 +231,7 @@ class NWItem:
elif xValue.tag == "expanded":
self.setExpanded(xValue.text)
elif xValue.tag == "exported":
self.setExported(xValue.text)
self.setActive(xValue.text)
elif xValue.tag == "charCount":
self.setCharCount(xValue.text)
elif xValue.tag == "wordCount":
@@ -505,7 +505,7 @@ class NWItem:
self._expanded = (state is True)
return
def setExported(self, state):
def setActive(self, state):
"""Set the export flag.
"""
if isinstance(state, str):
+1 -1
View File
@@ -247,7 +247,7 @@ class GuiItemDetails(QWidget):
theLabel = theLabel[:96].rstrip()+" ..."
if nwItem.isFileType():
if nwItem.isExported:
if nwItem.isActive:
self.labelIcon.setPixmap(self._expCheck)
else:
self.labelIcon.setPixmap(self._expCross)
+5 -5
View File
@@ -909,7 +909,7 @@ class GuiProjectTree(QTreeWidget):
if nwItem.isFileType():
trItem.setIcon(
self.C_EXPORT, self.mainTheme.getIcon("check" if nwItem.isExported else "cross")
self.C_EXPORT, self.mainTheme.getIcon("check" if nwItem.isActive else "cross")
)
if self.mainConf.emphLabels and nwItem.isDocumentLayout():
@@ -1157,7 +1157,7 @@ class GuiProjectTree(QTreeWidget):
if isFile:
ctxMenu.addAction(
self.tr("Toggle Exported"), lambda: self._toggleItemExported(tHandle)
self.tr("Toggle Exported"), lambda: self._toggleItemActive(tHandle)
)
if tItem.isNovelLike():
@@ -1367,12 +1367,12 @@ class GuiProjectTree(QTreeWidget):
"""
return self._treeMap.get(tHandle, None)
def _toggleItemExported(self, tHandle):
"""Toggle the exported status of an item.
def _toggleItemActive(self, tHandle):
"""Toggle the active status of an item.
"""
tItem = self.theProject.tree[tHandle]
if tItem is not None:
tItem.setExported(not tItem.isExported)
tItem.setActive(not tItem.isActive)
self.setTreeItemValues(tItem.itemHandle)
self._alertTreeChange(tHandle, flush=False)
return
+1 -1
View File
@@ -813,7 +813,7 @@ class GuiBuildNovel(QDialog):
if theItem is None:
return False
if not (theItem.isExported or ignoreFlag):
if not (theItem.isActive or ignoreFlag):
return False
if theItem.itemRoot in rootFilter: