diff --git a/setup.py b/setup.py index 06d7daf..cbab595 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='slac-alarm-manager', - version='1.1.1', + version='1.1.2', description='Python interface for managing alarms', long_description=long_description, long_description_content_type='text/markdown', diff --git a/slam/alarm_tree_view.py b/slam/alarm_tree_view.py index e35562e..22a732b 100644 --- a/slam/alarm_tree_view.py +++ b/slam/alarm_tree_view.py @@ -62,6 +62,7 @@ def __init__(self, kafka_producer: KafkaProducer, topic: str, plot_slot: Callabl self.plot_action = QAction('Draw Plot') self.enable_action = QAction('Enable') self.disable_action = QAction('Disable') + self.display_actions = [] self.acknowledge_action.triggered.connect(self.send_acknowledgement) self.unacknowledge_action.triggered.connect(self.send_unacknowledgement) @@ -111,11 +112,13 @@ def tree_menu(self, pos: QPoint) -> None: self.context_menu.addAction(self.unacknowledge_action) self.context_menu.addAction(self.enable_action) self.context_menu.addAction(self.disable_action) + self.display_actions.clear() if alarm_item.displays: for display in alarm_item.displays: display_action = QAction(display['title']) display_action.triggered.connect(partial(self.launch_pydm_display, display['details'])) self.context_menu.addAction(display_action) + self.display_actions.append(display_action) self.context_menu.popup(self.mapToGlobal(pos)) def create_alarm_configuration_widget(self, index: QModelIndex) -> None: