diff --git a/mantidimaging/eyes_tests/live_viewer_window_test.py b/mantidimaging/eyes_tests/live_viewer_window_test.py index 7d9b49bea06..81a21eaf0a4 100644 --- a/mantidimaging/eyes_tests/live_viewer_window_test.py +++ b/mantidimaging/eyes_tests/live_viewer_window_test.py @@ -54,7 +54,7 @@ def _make_simple_dir(self, directory: Path): @mock.patch("time.time", return_value=4000.0) def test_live_view_opens_without_data(self, _mock_time, _mock_image_watcher): self.imaging.show_live_viewer(self.live_directory) - self.check_target(widget=self.imaging.live_viewer) + self.check_target(widget=self.imaging.live_viewer_list[-1]) @mock.patch('mantidimaging.gui.windows.live_viewer.presenter.LiveViewerWindowPresenter.load_image') @mock.patch('mantidimaging.gui.windows.live_viewer.model.ImageWatcher') @@ -64,8 +64,8 @@ def test_live_view_opens_with_data(self, _mock_time, _mock_image_watcher, mock_l image_list = [Image_Data(path) for path in file_list] mock_load_image.return_value = self._generate_image() self.imaging.show_live_viewer(self.live_directory) - self.imaging.live_viewer.presenter.model._handle_image_changed_in_list(image_list) - self.check_target(widget=self.imaging.live_viewer) + self.imaging.live_viewer_list[-1].presenter.model._handle_image_changed_in_list(image_list) + self.check_target(widget=self.imaging.live_viewer_list[-1]) @mock.patch('mantidimaging.gui.windows.live_viewer.presenter.LiveViewerWindowPresenter.load_image') @mock.patch('mantidimaging.gui.windows.live_viewer.model.ImageWatcher') @@ -75,8 +75,8 @@ def test_live_view_opens_with_bad_data(self, _mock_time, _mock_image_watcher, mo image_list = [Image_Data(path) for path in file_list] mock_load_image.side_effect = ValueError self.imaging.show_live_viewer(self.live_directory) - self.imaging.live_viewer.presenter.model._handle_image_changed_in_list(image_list) - self.check_target(widget=self.imaging.live_viewer) + self.imaging.live_viewer_list[-1].presenter.model._handle_image_changed_in_list(image_list) + self.check_target(widget=self.imaging.live_viewer_list[-1]) @mock.patch('mantidimaging.gui.windows.live_viewer.presenter.LiveViewerWindowPresenter.load_image') @mock.patch('mantidimaging.gui.windows.live_viewer.model.ImageWatcher') @@ -86,6 +86,6 @@ def test_rotate_operation_rotates_image(self, _mock_time, _mock_image_watcher, m image_list = [Image_Data(path) for path in file_list] mock_load_image.return_value = self._generate_image() self.imaging.show_live_viewer(self.live_directory) - self.imaging.live_viewer.presenter.model._handle_image_changed_in_list(image_list) - self.imaging.live_viewer.rotate_angles_group.actions()[1].trigger() - self.check_target(widget=self.imaging.live_viewer) + self.imaging.live_viewer_list[-1].presenter.model._handle_image_changed_in_list(image_list) + self.imaging.live_viewer_list[-1].rotate_angles_group.actions()[1].trigger() + self.check_target(widget=self.imaging.live_viewer_list[-1]) diff --git a/mantidimaging/gui/windows/main/view.py b/mantidimaging/gui/windows/main/view.py index 8aa2329f245..6bc0e4bf95c 100644 --- a/mantidimaging/gui/windows/main/view.py +++ b/mantidimaging/gui/windows/main/view.py @@ -476,8 +476,6 @@ def live_view_choose_directory(self) -> None: def show_live_viewer(self, live_data_path: Path) -> None: live_viewer = LiveViewerWindowView(self, live_data_path) self.live_viewer_list.append(live_viewer) - # self.live_viewer_list[-1].activateWindow() - # self.live_viewer_list[-1].raise_() self.live_viewer_list[-1].show() @property @@ -561,9 +559,8 @@ def closeEvent(self, event) -> None: # Close additional windows which do not have the MainWindow as parent if self.recon: self.recon.close() - if self.live_viewer_list: - while self.live_viewer_list: - self.live_viewer_list[-1].close() + while self.live_viewer_list: + self.live_viewer_list[-1].close() if self.spectrum_viewer: self.spectrum_viewer.close() if self.filters: