Update tests other than tree-related
This commit is contained in:
@@ -65,6 +65,9 @@ class StatusEntry:
|
||||
|
||||
NO_ENTRY = StatusEntry("", QColor(0, 0, 0), nwStatusShape.SQUARE, QIcon(), 0)
|
||||
|
||||
T_UpdateEntry = list[tuple[str | None, StatusEntry]]
|
||||
T_StatusKinds = Literal["s", "i"]
|
||||
|
||||
|
||||
class NWStatus:
|
||||
|
||||
@@ -73,7 +76,7 @@ class NWStatus:
|
||||
|
||||
__slots__ = ("_store", "_default", "_prefix", "_height")
|
||||
|
||||
def __init__(self, prefix: Literal["s", "i"]) -> None:
|
||||
def __init__(self, prefix: T_StatusKinds) -> None:
|
||||
self._store: dict[str, StatusEntry] = {}
|
||||
self._default = None
|
||||
self._prefix = prefix[:1]
|
||||
@@ -120,7 +123,7 @@ class NWStatus:
|
||||
|
||||
return key
|
||||
|
||||
def update(self, update: list[tuple[str | None, StatusEntry]]) -> None:
|
||||
def update(self, update: T_UpdateEntry) -> None:
|
||||
"""Update the list of statuses."""
|
||||
self._store.clear()
|
||||
for key, entry in update:
|
||||
@@ -130,10 +133,6 @@ class NWStatus:
|
||||
if self._default not in self._store:
|
||||
self._default = next(iter(self._store)) if self._store else None
|
||||
|
||||
# Emit the change signal and refresh tree
|
||||
SHARED.projectSignalProxy({"event": "statusLabels", "kind": self._prefix})
|
||||
SHARED.project.tree.refreshAllItems()
|
||||
|
||||
return
|
||||
|
||||
def check(self, value: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user