Apply the property change.
(self)
| 38 | self.new_value = new_value |
| 39 | |
| 40 | def execute(self) -> bool: |
| 41 | """Apply the property change.""" |
| 42 | try: |
| 43 | setattr(self.node, self.property_name, self.new_value) |
| 44 | |
| 45 | # Special handling for certain properties |
| 46 | if self.property_name in ['code', 'gui_code']: |
| 47 | self.node.update_pins_from_code() |
| 48 | elif self.property_name in ['width', 'height']: |
| 49 | self.node.fit_size_to_content() |
| 50 | |
| 51 | self._mark_executed() |
| 52 | return True |
| 53 | except Exception as e: |
| 54 | print(f"Failed to change property: {e}") |
| 55 | return False |
| 56 | |
| 57 | def undo(self) -> bool: |
| 58 | """Revert the property change.""" |