Move clock tick timer to main GUI

This commit is contained in:
Veronica K. B. Olsen
2021-02-08 21:33:06 +01:00
parent 98fae8a6de
commit 479975fdff
2 changed files with 17 additions and 13 deletions
+15
View File
@@ -86,6 +86,8 @@ class GuiMain(QMainWindow):
self.theIndex = NWIndex(self.theProject, self)
self.hasProject = False
self.isFocusMode = False
self.userActive = False
self.lastActive = 0
# Prepare Main Window
self.resize(*self.mainConf.getWinSize())
@@ -241,6 +243,12 @@ class GuiMain(QMainWindow):
self.asDocTimer = QTimer()
self.asDocTimer.timeout.connect(self._autoSaveDocument)
# Main Clock
self.mainTimer = QTimer()
self.mainTimer.setInterval(1000)
self.mainTimer.timeout.connect(self._timeTick)
self.mainTimer.start()
# Shortcuts and Actions
self._connectMenuActions()
@@ -1414,6 +1422,13 @@ class GuiMain(QMainWindow):
# Slots
##
@pyqtSlot()
def _timeTick(self):
"""Triggered on every tick of the timer.
"""
self.statusBar.updateTime()
return
@pyqtSlot()
def _treeSingleClick(self):
"""Single click on a project tree item just updates the details