Skip to content

Commit

Permalink
Simplify context menu changes
Browse files Browse the repository at this point in the history
See PR783
  • Loading branch information
samtygier-stfc committed Oct 18, 2021
1 parent e4ff722 commit a2647e9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 30 deletions.
11 changes: 1 addition & 10 deletions mantidimaging/gui/dialogs/cor_inspection/recon_slice_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,7 @@ def update_text(val: float, sqsum: float, pixel_label: LabelItem, sqsum_label: L
img.hoverEvent = lambda ev: self.mouse_over(ev)

# Work around for https://github.com/mantidproject/mantidimaging/issues/565
for scene in [
self.less_img.scene(),
self.less_hist.scene(),
self.current_img.scene(),
self.current_hist.scene(),
self.more_img.scene(),
self.more_hist.scene(),
]:

scene.contextMenu = [item for item in scene.contextMenu if "export" not in item.text().lower()]
self.scene().contextMenu = [item for item in self.scene().contextMenu if "export" not in item.text().lower()]

def mouse_over(self, ev):
# Ignore events triggered by leaving window or right clicking
Expand Down
3 changes: 1 addition & 2 deletions mantidimaging/gui/widgets/mi_image_view/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ def __init__(self,
self.ui.histogram.item.gradient.menu.insertSeparator(self.auto_colour_action)

# Work around for https://github.com/mantidproject/mantidimaging/issues/565
for scene in [self.scene, self.ui.roiPlot.sceneObj, self.ui.histogram.sceneObj]:
scene.contextMenu = [item for item in scene.contextMenu if "export" not in item.text().lower()]
self.scene.contextMenu = [item for item in self.scene.contextMenu if "export" not in item.text().lower()]

def toggle_jumping_frame(self, images_to_jump_by=None):
if not self.shifting_through_images and images_to_jump_by is not None:
Expand Down
10 changes: 1 addition & 9 deletions mantidimaging/gui/windows/operations/filter_previews.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,7 @@ def __init__(self, parent=None, **kwargs):
self.init_histogram()

# Work around for https://github.com/mantidproject/mantidimaging/issues/565
for scene in [
self.image_before.scene(),
self.image_before_hist.scene(),
self.image_after.scene(),
self.image_after_hist.scene(),
self.image_difference.scene(),
self.image_difference_hist.scene(),
]:
scene.contextMenu = [item for item in scene.contextMenu if "export" not in item.text().lower()]
self.scene().contextMenu = [item for item in self.scene().contextMenu if "export" not in item.text().lower()]

self.auto_colour_actions = []
self._add_auto_colour_action(self.image_before_hist, self.image_before)
Expand Down
10 changes: 1 addition & 9 deletions mantidimaging/gui/windows/recon/image_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,7 @@ def __init__(self, parent):
self.recon.hoverEvent = lambda ev: self.mouse_over(ev, self.recon)

# Work around for https://github.com/mantidproject/mantidimaging/issues/565
for scene in [
self.projection.scene(),
self.projection_hist.scene(),
self.sinogram.scene(),
self.sinogram_hist.scene(),
self.recon.scene(),
self.recon_hist.scene(),
]:
scene.contextMenu = [item for item in scene.contextMenu if "export" not in item.text().lower()]
self.scene().contextMenu = [item for item in self.scene().contextMenu if "export" not in item.text().lower()]

def slice_line_moved(self):
self.slice_changed(int(self.slice_line.value()))
Expand Down

0 comments on commit a2647e9

Please sign in to comment.