Skip to content

Commit

Permalink
allow more than one Live Viewer window to open with different Paths
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeSullivan7 committed Nov 13, 2024
1 parent fa4fb94 commit 0bfa926
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 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 @@ -28,9 +28,9 @@ class LiveViewerWindowView(BaseMainWindowView):

def __init__(self, main_window: MainWindowView, live_dir_path: Path) -> None:
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
self.setWindowTitle(f"Mantid Imaging - Live Viewer - {str(self.path)}")
self.presenter = LiveViewerWindowPresenter(self, main_window)
self.live_viewer = LiveViewWidget()
self.imageLayout.addWidget(self.live_viewer)
Expand Down
18 changes: 11 additions & 7 deletions mantidimaging/gui/windows/main/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,13 +474,17 @@ def live_view_choose_directory(self) -> None:
self.show_live_viewer(Path(live_data_directory))

def show_live_viewer(self, live_data_path: Path) -> None:
if not self.live_viewer:
self.live_viewer = LiveViewerWindowView(self, live_data_path)
self.live_viewer.show()
else:
self.live_viewer.activateWindow()
self.live_viewer.raise_()
self.live_viewer.show()
# if not self.live_viewer:
# self.live_viewer = LiveViewerWindowView(self, live_data_path)
# self.live_viewer.show()
# else:
# self.live_viewer.activateWindow()
# self.live_viewer.raise_()
# self.live_viewer.show()
self.live_viewer = LiveViewerWindowView(self, live_data_path)
self.live_viewer.activateWindow()
self.live_viewer.raise_()
self.live_viewer.show()

@property
def stack_list(self) -> list[StackId]:
Expand Down

0 comments on commit 0bfa926

Please sign in to comment.