Update tests other than tree-related

This commit is contained in:
Veronica Berglyd Olsen
2024-11-23 19:30:29 +01:00
parent ca8bd8d271
commit 1bf42ceb55
29 changed files with 229 additions and 205 deletions
+13
View File
@@ -44,6 +44,7 @@ from novelwriter.core.options import OptionState
from novelwriter.core.projectdata import NWProjectData
from novelwriter.core.projectxml import ProjectXMLReader, ProjectXMLWriter, XMLReadState
from novelwriter.core.sessions import NWSessionLog
from novelwriter.core.status import T_StatusKinds, T_UpdateEntry
from novelwriter.core.storage import NWStorage, NWStorageOpen
from novelwriter.core.tree import NWTree
from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType
@@ -531,6 +532,18 @@ class NWProject:
self._data.itemImport.increment(nwItem.itemImport)
return
def updateStatus(self, kind: T_StatusKinds, update: T_UpdateEntry) -> None:
"""Update status or import entries."""
if kind == "s":
self._data.itemStatus.update(update)
SHARED.projectSignalProxy({"event": "statusLabels", "kind": kind})
self._tree.refreshAllItems()
elif kind == "i":
self._data.itemImport.update(update)
SHARED.projectSignalProxy({"event": "statusLabels", "kind": kind})
self._tree.refreshAllItems()
return
def localLookup(self, word: str | int) -> str:
"""Look up a word or number in the translation map for the
project and return it. The variable is cast to a string before