Add a signal for updated word counts
This commit is contained in:
+9
-8
@@ -125,7 +125,7 @@ class GuiMainStatus(QStatusBar):
|
||||
"""
|
||||
self.setRefTime(None)
|
||||
self.setLanguage(None, "")
|
||||
self.setStats(0, 0)
|
||||
self.doUpdateProjectStats(0, 0)
|
||||
self.setProjectStatus(nwState.NONE)
|
||||
self.setDocumentStatus(nwState.NONE)
|
||||
self.updateTime()
|
||||
@@ -160,13 +160,6 @@ class GuiMainStatus(QStatusBar):
|
||||
self.docIcon.setState(theState)
|
||||
return
|
||||
|
||||
def setStats(self, pWC, sWC):
|
||||
"""Set the current project statistics.
|
||||
"""
|
||||
self.statsText.setText(self.tr("Words: {0} ({1})").format(f"{pWC:n}", f"{sWC:+n}"))
|
||||
self.statsText.setToolTip(self.tr("Project word count (session change)"))
|
||||
return
|
||||
|
||||
def setUserIdle(self, userIdle):
|
||||
"""Change the idle status icon.
|
||||
"""
|
||||
@@ -218,6 +211,14 @@ class GuiMainStatus(QStatusBar):
|
||||
|
||||
return
|
||||
|
||||
@pyqtSlot(int, int)
|
||||
def doUpdateProjectStats(self, pWC, sWC):
|
||||
"""Update the current project statistics.
|
||||
"""
|
||||
self.statsText.setText(self.tr("Words: {0} ({1})").format(f"{pWC:n}", f"{sWC:+n}"))
|
||||
self.statsText.setToolTip(self.tr("Project word count (session change)"))
|
||||
return
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def doUpdateProjectStatus(self, isChanged):
|
||||
"""Slot for updating the project status.
|
||||
|
||||
Reference in New Issue
Block a user