Add a signal for updated word counts

This commit is contained in:
Veronica K. B. Olsen
2021-05-16 17:31:12 +02:00
parent 872b8e7902
commit 1a5076438d
5 changed files with 63 additions and 31 deletions
+4 -3
View File
@@ -67,6 +67,7 @@ class GuiDocEditor(QTextEdit):
# Custom Signals
spellDictionaryChanged = pyqtSignal(str, str)
docEditedStatusChanged = pyqtSignal(bool)
docCountsChanged = pyqtSignal(str, int, int, int)
def __init__(self, theParent):
QTextEdit.__init__(self, theParent)
@@ -1193,9 +1194,9 @@ class GuiDocEditor(QTextEdit):
self._nwItem.setWordCount(wCount)
self._nwItem.setParaCount(pCount)
self.theParent.treeView.propagateCount(self._docHandle, wCount)
self.theParent.treeView.projectWordCount()
self.theParent.treeMeta.updateCounts(self._docHandle, cCount, wCount, pCount)
# Must not be emitted if docHandle is None!
self.docCountsChanged.emit(self._docHandle, cCount, wCount, pCount)
self._checkDocSize(self._qDocument.characterCount())
self.docFooter.updateCounts()