Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main_window no longer passed to BaseMainWindowView #1989

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading