Some minor code cleanup and redundant code removed
This commit is contained in:
+7
-17
@@ -51,9 +51,6 @@ class GuiMainStatus(QStatusBar):
|
||||
self.theTheme = theParent.theTheme
|
||||
self.refTime = None
|
||||
|
||||
self.projWords = 0
|
||||
self.sessWords = 0
|
||||
|
||||
colNone = QColor(*self.theTheme.statNone)
|
||||
colTrue = QColor(*self.theTheme.statUnsaved)
|
||||
colFalse = QColor(*self.theTheme.statSaved)
|
||||
@@ -182,26 +179,19 @@ class GuiMainStatus(QStatusBar):
|
||||
def setStats(self, pWC, sWC):
|
||||
"""Set the current project statistics.
|
||||
"""
|
||||
self.projWords = pWC
|
||||
self.sessWords = sWC
|
||||
self._updateStats()
|
||||
self.statsText.setToolTip(
|
||||
"Project word count (session change)"
|
||||
)
|
||||
self.statsText.setText(
|
||||
f"Words: {pWC:n} ({sWC:+n})"
|
||||
)
|
||||
|
||||
return
|
||||
|
||||
##
|
||||
# Internal Functions
|
||||
##
|
||||
|
||||
def _updateStats(self):
|
||||
"""Update statistics.
|
||||
"""
|
||||
self.statsText.setToolTip(
|
||||
"Project word count (session change)"
|
||||
)
|
||||
self.statsText.setText(
|
||||
f"Words: {self.projWords:n} ({self.sessWords:+n})"
|
||||
)
|
||||
return
|
||||
|
||||
def _updateTime(self):
|
||||
"""Update the session clock.
|
||||
"""
|
||||
|
||||
+1
-1
@@ -467,7 +467,7 @@ class GuiMain(QMainWindow):
|
||||
return False
|
||||
|
||||
self.treeView.saveTreeOrder()
|
||||
self.theProject.saveProject(autoSave)
|
||||
self.theProject.saveProject(autoSave=autoSave)
|
||||
self.theIndex.saveIndex()
|
||||
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user