Add build details widget to manuscript tool

This commit is contained in:
Veronica Berglyd Olsen
2023-09-01 16:55:23 +02:00
parent 746bd4bf2c
commit ecebd69cda
4 changed files with 267 additions and 33 deletions
+4 -4
View File
@@ -36,6 +36,7 @@ from functools import partial
from PyQt5.QtCore import QCoreApplication, QRegularExpression
from novelwriter import SHARED
from novelwriter.enum import nwItemLayout
from novelwriter.common import formatTimeStamp, numberToRoman, checkInt
from novelwriter.constants import nwConst, nwHeadFmt, nwRegEx, nwUnicode
@@ -147,7 +148,7 @@ class Tokenizer(ABC):
self._linkHeaders = False # Add an anchor before headers
# Instance Variables
self._hFormatter = HeadingFormatter(self._project)
self._hFormatter = HeadingFormatter()
self._firstScene = False # Flag to indicate that the first scene of the chapter
# This File
@@ -771,8 +772,7 @@ class Tokenizer(ABC):
class HeadingFormatter:
def __init__(self, project: NWProject) -> None:
self._project = project
def __init__(self) -> None:
self._chCount = 0
self._scChCount = 0
self._scAbsCount = 0
@@ -801,7 +801,7 @@ class HeadingFormatter:
hFormat = hFormat.replace(nwHeadFmt.SC_NUM, str(self._scChCount))
hFormat = hFormat.replace(nwHeadFmt.SC_ABS, str(self._scAbsCount))
if nwHeadFmt.CH_WORD in hFormat:
chWord = self._project.localLookup(self._chCount)
chWord = SHARED.project.localLookup(self._chCount)
hFormat = hFormat.replace(nwHeadFmt.CH_WORD, chWord)
if nwHeadFmt.CH_ROML in hFormat:
chRom = numberToRoman(self._chCount, toLower=True)