Skip to content

Commit

Permalink
Merge pull request #45 from jbellister-slac/fix_displays
Browse files Browse the repository at this point in the history
FIX: Display actions on context menus
  • Loading branch information
jbellister-slac authored Mar 6, 2023
2 parents a53a6a1 + afb94c6 commit 1a9a9aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 3 additions & 0 deletions slam/alarm_tree_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 1a9a9aa

Please sign in to comment.