From 228b1d1c72f7b962e46a4e2b52d90b84d2235aa0 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Wed, 8 Feb 2023 16:52:50 +0530 Subject: Fix #52 Disable input data tab for output material stream --- Graphics.py | 23 ++++++++++++++++++++++- Undo.dat | Bin 18267 -> 18267 bytes 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Graphics.py b/Graphics.py index aa032ec..8e3a24c 100644 --- a/Graphics.py +++ b/Graphics.py @@ -348,6 +348,17 @@ class NodeSocket(QtWidgets.QGraphicsItem): self.new_line.source.parent.obj.add_connection(0, self.new_line.source.id, self.new_line.target.parent.obj) if self.new_line.target.parent.obj.type not in stm: self.new_line.target.parent.obj.add_connection(1, self.new_line.target.id, self.new_line.source.parent.obj) # Input stream if flag is 1 + + sc = self.new_line.source.parent + tg = self.new_line.target.parent + if(sc.obj.type == 'MaterialStream'): + sc_no_input_lines = len(sc.input[0].in_lines) + if(sc_no_input_lines > 0): + sc.obj.disableInputDataTab(sc.dock_widget) + if(tg.obj.type == 'MaterialStream'): + tg_no_input_lines = len(tg.input[0].in_lines) + if(tg_no_input_lines > 0): + tg.obj.disableInputDataTab(tg.dock_widget) elif (self.type =='in') and (item.type == 'op'): self.new_line.source = item @@ -359,7 +370,17 @@ class NodeSocket(QtWidgets.QGraphicsItem): self.new_line.source.parent.obj.add_connection(0, self.new_line.source.id, self.new_line.target.parent.obj) if self.new_line.target.parent.obj.type not in stm: self.new_line.target.parent.obj.add_connection(1, self.new_line.target.id, self.new_line.source.parent.obj) - + + sc = self.new_line.source.parent + tg = self.new_line.target.parent + if(sc.obj.type == 'MaterialStream'): + sc_no_input_lines = len(sc.input[0].in_lines) + if(sc_no_input_lines > 0): + sc.obj.disableInputDataTab(sc.dock_widget) + if(tg.obj.type == 'MaterialStream'): + tg_no_input_lines = len(tg.input[0].in_lines) + if(tg_no_input_lines > 0): + tg.obj.disableInputDataTab(tg.dock_widget) else: self.scene().removeItem(self.new_line) diff --git a/Undo.dat b/Undo.dat index 67006f6..55201d3 100644 Binary files a/Undo.dat and b/Undo.dat differ -- cgit