Skip to content

Commit

Permalink
main_window no longer passed to BaseMainWindowView (#1989)
Browse files Browse the repository at this point in the history
  • Loading branch information
samtygier-stfc authored Dec 13, 2023
2 parents 90c2b6a + 259853f commit 14f2c7f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mantidimaging/gui/windows/live_viewer/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class LiveViewerWindowView(BaseMainWindowView):
imageLayout: QVBoxLayout

def __init__(self, main_window: 'MainWindowView', live_dir_path: Path) -> None:
super().__init__(main_window, 'gui/ui/live_viewer_window.ui')
super().__init__(None, 'gui/ui/live_viewer_window.ui')
self.setWindowTitle("Mantid Imaging - Live Viewer")
self.main_window = main_window
self.path = live_dir_path
Expand Down
9 changes: 9 additions & 0 deletions mantidimaging/gui/windows/main/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,15 @@ def closeEvent(self, event):
if should_close:
# Pass close event to parent
super().closeEvent(event)
# Close additional windows which do not have the MainWindow as parent
if self.recon:
self.recon.close()
if self.live_viewer:
self.live_viewer.close()
if self.spectrum_viewer:
self.spectrum_viewer.close()
if self.filters:
self.filters.close()

else:
# Ignore the close event, keeping window open
Expand Down
2 changes: 1 addition & 1 deletion mantidimaging/gui/windows/operations/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class FiltersWindowView(BaseMainWindowView):
filterSelector: QComboBox

def __init__(self, main_window: 'MainWindowView'):
super().__init__(main_window, 'gui/ui/filters_window.ui')
super().__init__(None, 'gui/ui/filters_window.ui')

self.main_window = main_window
self.presenter = FiltersWindowPresenter(self, main_window)
Expand Down
2 changes: 1 addition & 1 deletion mantidimaging/gui/windows/recon/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ReconstructWindowView(BaseMainWindowView):
stackSelector: DatasetSelectorWidgetView

def __init__(self, main_window: 'MainWindowView'):
super().__init__(main_window, 'gui/ui/recon_window.ui')
super().__init__(None, 'gui/ui/recon_window.ui')

self.main_window = main_window
self.presenter = ReconstructWindowPresenter(self, main_window)
Expand Down
2 changes: 1 addition & 1 deletion mantidimaging/gui/windows/spectrum_viewer/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class SpectrumViewerWindowView(BaseMainWindowView):
normalise_error_issue: str = ""

def __init__(self, main_window: 'MainWindowView'):
super().__init__(main_window, 'gui/ui/spectrum_viewer.ui')
super().__init__(None, 'gui/ui/spectrum_viewer.ui')

self.main_window = main_window

Expand Down
4 changes: 2 additions & 2 deletions mantidimaging/gui/windows/wizard/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class WizardStage(QWidget):

def __init__(self, name, parent: QWidget = None) -> None:
super().__init__(parent)
super().__init__(None)

self.layout = QVBoxLayout(self)
self.title_label = QLabel("Stage: " + name)
Expand All @@ -34,7 +34,7 @@ def handle_stack_change(self, stack_history: Optional[dict]) -> None:
class WizardStep(QWidget):

def __init__(self, step: dict, wizard: WizardView, parent: QWidget = None) -> None:
super().__init__(parent)
super().__init__(None)

self.wizard_view = wizard

Expand Down

0 comments on commit 14f2c7f

Please sign in to comment.