Remove a connection, optionally using command pattern for undo/redo.
(self, connection, use_command=True)
| 644 | return conn |
| 645 | |
| 646 | def remove_connection(self, connection, use_command=True): |
| 647 | """Remove a connection, optionally using command pattern for undo/redo.""" |
| 648 | if use_command: |
| 649 | # Use command pattern |
| 650 | command = DeleteConnectionCommand(self, connection) |
| 651 | return self.execute_command(command) |
| 652 | else: |
| 653 | # Direct removal (for internal use by commands) |
| 654 | end_pin = connection.end_pin |
| 655 | connection.remove() |
| 656 | if connection in self.connections: |
| 657 | self.connections.remove(connection) |
| 658 | self.removeItem(connection) |
| 659 | if end_pin and isinstance(end_pin.node, RerouteNode): |
| 660 | end_pin.node.update_color() |
| 661 | return True |
| 662 | |
| 663 | def create_reroute_node_on_connection(self, connection, position, use_command=True): |
| 664 | """Create a reroute node on a connection, optionally using command pattern.""" |
no test coverage detected