From 01741f44192b278d51267dbcae03dd34875415af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20H=C3=B6gstedt?= <marin.hogstedt@hotmail.com> Date: Tue, 18 Jun 2024 14:29:17 +0200 Subject: [PATCH] fixed bus being able to edit module state and breakpoint --- src/simudator/processor/mia/gui/bus_graphic.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/simudator/processor/mia/gui/bus_graphic.py b/src/simudator/processor/mia/gui/bus_graphic.py index 476a14d..f2482ac 100644 --- a/src/simudator/processor/mia/gui/bus_graphic.py +++ b/src/simudator/processor/mia/gui/bus_graphic.py @@ -66,6 +66,19 @@ class BusGraphicsItem(ModuleGraphicsItem): def update(self): pass + def generateActions(self) -> None: + """ + Generates action for the bus. The only generated action is 'show all ports'. + + The default implementation generates actions such as edit break points + and edit module state. Since the bus has none of those two we override the + implementation and remove those two actions. + """ + self.show_ports_action = QAction("Show all ports") + self.show_ports_action.triggered.connect(self.showPorts) + self.show_ports_action.setEnabled(not self.isLocked) + self.actions.append(self.show_ports_action) + def shouldIgnoreAction(self, action: QAction) -> bool: """ Disables left clicking, which would normally allow the user to -- GitLab