From b1bc80a0cd2a447954de2e3850b7a9b7b4f27d80 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sat, 4 Feb 2023 16:29:23 +0100 Subject: [PATCH 1/4] Make sure title and author is always refreshed when project details dialog is opened (#1336) --- novelwriter/dialogs/projdetails.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/novelwriter/dialogs/projdetails.py b/novelwriter/dialogs/projdetails.py index bec2f400..cc010c5f 100644 --- a/novelwriter/dialogs/projdetails.py +++ b/novelwriter/dialogs/projdetails.py @@ -156,7 +156,7 @@ class GuiProjectDetailsMain(QWidget): # Header # ====== - self.bookTitle = QLabel(self.theProject.data.title) + self.bookTitle = QLabel("") bookFont = self.bookTitle.font() bookFont.setPointSizeF(2.2*fPt) bookFont.setWeight(QFont.Bold) @@ -164,9 +164,7 @@ class GuiProjectDetailsMain(QWidget): self.bookTitle.setAlignment(Qt.AlignHCenter) self.bookTitle.setWordWrap(True) - self.projName = QLabel( - self.tr("Working Title: {0}").format(self.theProject.data.name) - ) + self.projName = QLabel("") workFont = self.projName.font() workFont.setPointSizeF(0.8*fPt) workFont.setItalic(True) @@ -174,7 +172,7 @@ class GuiProjectDetailsMain(QWidget): self.projName.setAlignment(Qt.AlignHCenter) self.projName.setWordWrap(True) - self.bookAuthors = QLabel(self.tr("By {0}").format(self.theProject.data.author)) + self.bookAuthors = QLabel("") authFont = self.bookAuthors.font() authFont.setPointSizeF(1.2*fPt) self.bookAuthors.setFont(authFont) @@ -251,6 +249,10 @@ class GuiProjectDetailsMain(QWidget): nwCount = pIndex.getNovelWordCount() edTime = self.theProject.getCurrentEditTime() + self.bookTitle.setText(self.theProject.data.title or self.theProject.data.name) + self.projName.setText(self.tr("Project: {0}").format(self.theProject.data.name)) + self.bookAuthors.setText(self.tr("By {0}").format(self.theProject.data.author)) + self.wordCountVal.setText(f"{nwCount:n}") self.chapCountVal.setText(f"{hCounts[2]:n}") self.sceneCountVal.setText(f"{hCounts[3]:n}") From 4e815a5f86557a6700b97c633dacf64fb99a7ce4 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sat, 4 Feb 2023 16:29:51 +0100 Subject: [PATCH 2/4] Make sure project name, title and author cannot be set to string "None" --- novelwriter/core/projectdata.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/novelwriter/core/projectdata.py b/novelwriter/core/projectdata.py index 12176901..58667ee3 100644 --- a/novelwriter/core/projectdata.py +++ b/novelwriter/core/projectdata.py @@ -207,7 +207,7 @@ class NWProjectData: """Set a new project name. """ if value != self._name: - self._name = simplified(str(value)) + self._name = simplified(str(value or "")) self.theProject.setProjectChanged(True) return @@ -215,7 +215,7 @@ class NWProjectData: """Set a new novel title. """ if value != self._title: - self._title = simplified(str(value)) + self._title = simplified(str(value or "")) self.theProject.setProjectChanged(True) return @@ -223,7 +223,7 @@ class NWProjectData: """Set the author value. """ if value != self._title: - self._author = simplified(str(value)) + self._author = simplified(str(value or "")) self.theProject.setProjectChanged(True) return From a5d05ab77754eca99a6440ab3627ea4a55ba04ef Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sat, 4 Feb 2023 16:32:41 +0100 Subject: [PATCH 3/4] Improve time format of editing time on project details dialog (#1335) --- novelwriter/dialogs/projdetails.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/novelwriter/dialogs/projdetails.py b/novelwriter/dialogs/projdetails.py index cc010c5f..35d52345 100644 --- a/novelwriter/dialogs/projdetails.py +++ b/novelwriter/dialogs/projdetails.py @@ -34,7 +34,7 @@ from PyQt5.QtWidgets import ( QLineEdit, QSpinBox, QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget ) -from novelwriter.common import numberToRoman +from novelwriter.common import formatTime, numberToRoman from novelwriter.custom import PagedDialog, QSwitch from novelwriter.constants import nwUnicode from novelwriter.gui.components import NovelSelector @@ -257,7 +257,7 @@ class GuiProjectDetailsMain(QWidget): self.chapCountVal.setText(f"{hCounts[2]:n}") self.sceneCountVal.setText(f"{hCounts[3]:n}") self.revCountVal.setText(f"{self.theProject.data.saveCount:n}") - self.editTimeVal.setText(f"{edTime//3600:02d}:{edTime%3600//60:02d}") + self.editTimeVal.setText(formatTime(edTime)) self.projPathVal.setText(str(self.theProject.storage.storagePath)) From 4ba3297d171546c5c183c5a089d332c18a632e2a Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sat, 4 Feb 2023 16:45:53 +0100 Subject: [PATCH 4/4] Update base translation file --- i18n/nw_base.ts | 88 ++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/i18n/nw_base.ts b/i18n/nw_base.ts index 9d384af0..6b455964 100644 --- a/i18n/nw_base.ts +++ b/i18n/nw_base.ts @@ -4,72 +4,72 @@ Common - + in the future - + just now - + a minute ago - + {0} minutes ago - + an hour ago - + {0} hours ago - + a day ago - + {0} days ago - + a week ago - + {0} weeks ago - + a month ago - + {0} months ago - + a year ago - + {0} years ago @@ -2884,72 +2884,72 @@ GuiProjectDetailsContents - + Table of Contents - + Title - + Words - + Pages - + Page - + Progress - + Typical word count for a 5 by 8 inch book page with 11 pt font is 350. - + Start counting page numbers from this page. - + Assume a new chapter or partition always start on an odd numbered page. - + Words per page - + Count pages from - + Clear double pages - + END - + Untitled @@ -2957,45 +2957,45 @@ GuiProjectDetailsMain - - Working Title: {0} - - - - - By {0} - - - - + Words - + Chapters - + Scenes - + Revisions - + Editing Time - + Path + + + Project: {0} + + + + + By {0} + + GuiProjectEditMain