Added project word count

This commit is contained in:
Veronica K. B. Olsen
2019-05-25 23:16:27 +02:00
parent 14e44a72bd
commit 9fc59262a9
2 changed files with 12 additions and 1 deletions
+1
View File
@@ -380,6 +380,7 @@ class GuiDocEditor(QTextEdit):
self.paraCount = self.wCounter.paraCount
self.theParent.statusBar.setCounts(self.charCount,self.wordCount,self.paraCount)
self.theParent.treeView.propagateCount(tHandle, self.wordCount)
self.theParent.treeView.projectWordCount()
return
+11 -1
View File
@@ -50,7 +50,7 @@ class GuiDocTree(QTreeWidget):
self.setExpandsOnDoubleClick(True)
self.setIndentation(13)
self.setColumnCount(4)
self.setHeaderLabels(["Name","Count","Flags","Handle"])
self.setHeaderLabels(["Name","Words","Flags","Handle"])
if not self.debugGUI:
self.hideColumn(self.C_HANDLE)
@@ -286,6 +286,16 @@ class GuiDocTree(QTreeWidget):
self.propagateCount(pHandle, pCount, nDepth+1)
return
def projectWordCount(self):
nWords = 0
for n in range(self.topLevelItemCount()):
tItem = self.topLevelItem(n)
if tItem == self.orphRoot:
continue
nWords += int(tItem.text(self.C_COUNT))
self.theParent.statusBar.setStats(nWords,0)
return
def buildTree(self):
self.clear()
for nwItem in self.theProject.getProjectItems():