Update classes and functions to use the item as source of main heading instead of index
This commit is contained in:
@@ -508,9 +508,9 @@ class GuiDocEditor(QTextEdit):
|
||||
|
||||
self.setDocumentChanged(False)
|
||||
|
||||
oldHeader = self.theProject.index.getHandleHeaderLevel(tHandle)
|
||||
oldHeader = self._nwItem.mainHeading
|
||||
self.theProject.index.scanText(tHandle, docText)
|
||||
newHeader = self.theProject.index.getHandleHeaderLevel(tHandle)
|
||||
newHeader = self._nwItem.mainHeading
|
||||
|
||||
# ToDo: This should be a signal
|
||||
if self._updateHeaders(checkLevel=True):
|
||||
@@ -2972,8 +2972,7 @@ class GuiDocEditFooter(QWidget):
|
||||
else:
|
||||
theStatus, theIcon = self._theItem.getImportStatus()
|
||||
sIcon = theIcon.pixmap(self.sPx, self.sPx)
|
||||
hLevel = self.theProject.index.getHandleHeaderLevel(self._docHandle)
|
||||
sText = f"{theStatus} / {self._theItem.describeMe(hLevel)}"
|
||||
sText = f"{theStatus} / {self._theItem.describeMe()}"
|
||||
|
||||
self.statusIcon.setPixmap(sIcon)
|
||||
self.statusText.setText(sText)
|
||||
|
||||
@@ -273,12 +273,11 @@ class GuiItemDetails(QWidget):
|
||||
# Layout
|
||||
# ======
|
||||
|
||||
hLevel = self.theProject.index.getHandleHeaderLevel(tHandle)
|
||||
usageIcon = self.mainTheme.getItemIcon(
|
||||
nwItem.itemType, nwItem.itemClass, nwItem.itemLayout, hLevel
|
||||
nwItem.itemType, nwItem.itemClass, nwItem.itemLayout, nwItem.mainHeading
|
||||
)
|
||||
self.usageIcon.setPixmap(usageIcon.pixmap(iPx, iPx))
|
||||
self.usageData.setText(nwItem.describeMe(hLevel))
|
||||
self.usageData.setText(nwItem.describeMe())
|
||||
|
||||
# Counts
|
||||
# ======
|
||||
|
||||
@@ -685,7 +685,6 @@ class GuiOutlineTree(QTreeWidget):
|
||||
for _, tHandle, sTitle, novIdx in novStruct:
|
||||
|
||||
iLevel = nwHeaders.H_LEVEL.get(novIdx.level, 0)
|
||||
dLevel = self.theProject.index.getHandleHeaderLevel(tHandle)
|
||||
if iLevel == 0:
|
||||
continue
|
||||
|
||||
@@ -699,7 +698,7 @@ class GuiOutlineTree(QTreeWidget):
|
||||
trItem.setData(self._colIdx[nwOutline.TITLE], self.D_TITLE, sTitle)
|
||||
trItem.setFont(self._colIdx[nwOutline.TITLE], self._hFonts[iLevel])
|
||||
trItem.setText(self._colIdx[nwOutline.LEVEL], novIdx.level)
|
||||
trItem.setIcon(self._colIdx[nwOutline.LABEL], self._dIcon[dLevel])
|
||||
trItem.setIcon(self._colIdx[nwOutline.LABEL], self._dIcon[nwItem.mainHeading])
|
||||
trItem.setText(self._colIdx[nwOutline.LABEL], nwItem.itemName)
|
||||
trItem.setText(self._colIdx[nwOutline.LINE], sTitle[1:].lstrip("0"))
|
||||
trItem.setText(self._colIdx[nwOutline.SYNOP], novIdx.synopsis)
|
||||
|
||||
@@ -516,7 +516,7 @@ class GuiProjectTree(QTreeWidget):
|
||||
# Collect some information about the selected item that
|
||||
pItem = self.theProject.tree[sHandle]
|
||||
qItem = self._getTreeItem(sHandle)
|
||||
sLevel = nwHeaders.H_LEVEL.get(self.theProject.index.getHandleHeaderLevel(sHandle), 0)
|
||||
sLevel = nwHeaders.H_LEVEL.get(pItem.mainHeading, 0)
|
||||
sIsParent = False if qItem is None else qItem.childCount() > 0
|
||||
|
||||
if self.theProject.tree.isTrash(sHandle):
|
||||
@@ -897,7 +897,7 @@ class GuiProjectTree(QTreeWidget):
|
||||
return
|
||||
|
||||
itemStatus, statusIcon = nwItem.getImportStatus()
|
||||
hLevel = self.theProject.index.getHandleHeaderLevel(tHandle)
|
||||
hLevel = nwItem.mainHeading
|
||||
itemIcon = self.mainTheme.getItemIcon(
|
||||
nwItem.itemType, nwItem.itemClass, nwItem.itemLayout, hLevel
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user