Skip to content

Commit 189b19e

Browse files
committed
Fix preview stage switching
1 parent 817dc83 commit 189b19e

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

SidebarGUIPlugin.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,14 @@ def _onStageChanged(self):
9393
self._controller.setActiveView(view_id)
9494

9595
def _onViewChanged(self):
96-
active_stage_id = self._controller.getActiveStage().getPluginId()
97-
active_view_id = self._controller.getActiveView().getPluginId()
96+
active_stage = self._controller.getActiveStage()
97+
active_view = self._controller.getActiveView()
98+
99+
if not active_stage or not active_view:
100+
return
101+
102+
active_stage_id = active_stage.getPluginId()
103+
active_view_id = active_view.getPluginId()
98104

99105
if (
100106
active_stage_id == "SmartSlicePlugin"
@@ -108,6 +114,11 @@ def _onViewChanged(self):
108114
self._prepare_stage_view_id = active_view_id
109115
elif active_stage_id == "MonitorStage":
110116
return
117+
elif active_stage_id == "PreviewStage":
118+
# Ensure SimulationView is active when in PreviewStage
119+
if active_view_id != "SimulationView":
120+
self._controller.setActiveView("SimulationView")
121+
return
111122

112123
if active_view_id in [
113124
"SimulationView",

0 commit comments

Comments
 (0)