From 88ccd1f19479b149c8912f60463fa4164d34094e Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Sat, 10 Sep 2022 10:06:40 -0700 Subject: [PATCH] gui: fixed issue updating preferences, resulting in nodes changing to a default icon --- daemon/core/api/grpc/wrappers.py | 2 +- daemon/core/gui/images.py | 18 +++++++++--------- daemon/core/gui/nodeutils.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/daemon/core/api/grpc/wrappers.py b/daemon/core/api/grpc/wrappers.py index 11402cd9..d3167a98 100644 --- a/daemon/core/api/grpc/wrappers.py +++ b/daemon/core/api/grpc/wrappers.py @@ -776,7 +776,7 @@ class Node: id=proto.id, name=proto.name, type=NodeType(proto.type), - model=proto.model, + model=proto.model or None, position=Position.from_proto(proto.position), services=set(proto.services), config_services=set(proto.config_services), diff --git a/daemon/core/gui/images.py b/daemon/core/gui/images.py index 112f3943..aed4cfcc 100644 --- a/daemon/core/gui/images.py +++ b/daemon/core/gui/images.py @@ -93,15 +93,15 @@ TYPE_MAP: Dict[Tuple[NodeType, str], ImageEnum] = { (NodeType.DEFAULT, "host"): ImageEnum.HOST, (NodeType.DEFAULT, "mdr"): ImageEnum.MDR, (NodeType.DEFAULT, "prouter"): ImageEnum.PROUTER, - (NodeType.HUB, ""): ImageEnum.HUB, - (NodeType.SWITCH, ""): ImageEnum.SWITCH, - (NodeType.WIRELESS_LAN, ""): ImageEnum.WLAN, - (NodeType.WIRELESS, ""): ImageEnum.WIRELESS, - (NodeType.EMANE, ""): ImageEnum.EMANE, - (NodeType.RJ45, ""): ImageEnum.RJ45, - (NodeType.TUNNEL, ""): ImageEnum.TUNNEL, - (NodeType.DOCKER, ""): ImageEnum.DOCKER, - (NodeType.LXC, ""): ImageEnum.LXC, + (NodeType.HUB, None): ImageEnum.HUB, + (NodeType.SWITCH, None): ImageEnum.SWITCH, + (NodeType.WIRELESS_LAN, None): ImageEnum.WLAN, + (NodeType.WIRELESS, None): ImageEnum.WIRELESS, + (NodeType.EMANE, None): ImageEnum.EMANE, + (NodeType.RJ45, None): ImageEnum.RJ45, + (NodeType.TUNNEL, None): ImageEnum.TUNNEL, + (NodeType.DOCKER, None): ImageEnum.DOCKER, + (NodeType.LXC, None): ImageEnum.LXC, } diff --git a/daemon/core/gui/nodeutils.py b/daemon/core/gui/nodeutils.py index 0175797d..0357f23d 100644 --- a/daemon/core/gui/nodeutils.py +++ b/daemon/core/gui/nodeutils.py @@ -123,7 +123,7 @@ def _get_custom_file(config: GuiConfig, name: str) -> Optional[str]: def get_icon(node: Node, app: "Application") -> PhotoImage: scale = app.app_scale image = None - # node icon was overriden with a specific value + # node icon was overridden with a specific value if node.icon: try: image = images.from_file(node.icon, width=images.NODE_SIZE, scale=scale)