Skip to content
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
14 changes: 12 additions & 2 deletions src/main/python/utils/Container.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def try_get_other_node_from_line(ln, this_item):
# Lock all dock widgets to read-only on success
for dw in dock_widget_lst:
if hasattr(dw, 'set_read_only'):
dw.set_read_only(True)
dw.set_read_only(False)
else:
self.signals.msg_signal.emit(
f"<span style='color:red'>[{self.current_time()}] Simulation <b>Failed.</b></span>"
Expand Down Expand Up @@ -425,9 +425,19 @@ def _populate_results(self):
DockWidget.show_result(dock_widget_lst)

# Re-apply read-only state because show_result recreates the input fields
# Keep recreated input fields editable after results are populated
for dw in dock_widget_lst:
if hasattr(dw, 'set_read_only'):
dw.set_read_only(True)
dw.set_read_only(False)

# Preserve connection-based restrictions for MaterialStream
for it in self.graphics.scene.items():
if isinstance(it, NodeItem) and getattr(it, "type", "") == "MaterialStream":
try:
if len(it.input[0].in_lines) > 0:
it.obj.disableInputDataTab(it.dock_widget)
except Exception as e:
print(f"[DEBUG] MaterialStream input state update failed: {e}")

# Make all result table items non-editable
for dw in dock_widget_lst:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,11 @@ def test_partially_connected_mixer_warns(self):
self.container.simulate("EQN")
self.assertTrue(self.any_message_contains(f"Warning: {mixer.name} - Missing Socket Connection(s)."))

def test_success_sets_dock_widgets_read_only(self):
def test_success_keeps_dock_widgets_editable(self):
dw = MagicMock()
dock_widget_lst.append(dw)
self.container.simulate("EQN")
dw.set_read_only.assert_called_with(True)
dw.set_read_only.assert_called_with(False)

def test_failure_when_result_is_too_short(self):
dw = MagicMock()
Expand Down Expand Up @@ -488,7 +488,7 @@ def test_results_are_shown_and_tables_made_read_only(self):
self.container._populate_results()

mock_show.assert_called_once_with(dock_widget_lst)
dock.set_read_only.assert_called_once_with(True)
dock.set_read_only.assert_called_once_with(False)
for r in range(2):
for c in range(2):
flags = table.item(r, c).flags()
Expand Down
Loading