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