From a6cbdfc559e58e85b0debe1be81c244d7e985ecf Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 9 Jan 2021 20:07:09 +0100 Subject: [PATCH] Fix initial setting of project word count --- nw/core/project.py | 5 ++++- nw/guimain.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nw/core/project.py b/nw/core/project.py index d6b6da78..75d86aaa 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -606,10 +606,13 @@ class NWProject(): self.theParent.setStatus("Opened Project: %s" % self.projName) self._scanProjectFolder() - self.setProjectChanged(False) + + self.currWCount = self.lastWCount self.projOpened = time() self.projAltered = False + self._writeLockFile() + self.setProjectChanged(False) return True diff --git a/nw/guimain.py b/nw/guimain.py index 11ebbdff..b9816c42 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -428,6 +428,7 @@ class GuiMain(QMainWindow): self.docEditor.setSpellCheck(self.theProject.spellCheck) self.mainMenu.setAutoOutline(self.theProject.autoOutline) self.statusBar.setRefTime(self.theProject.projOpened) + self.statusBar.setStats(self.theProject.currWCount, 0) # Restore previously open documents, if any if self.theProject.lastEdited is not None: