Load a graph from file.
(self, file_path=None)
| 242 | self.file_ops.save_as() |
| 243 | |
| 244 | def on_load(self, file_path=None): |
| 245 | """Load a graph from file.""" |
| 246 | # Capture the current file path before it gets changed by file_ops.load() |
| 247 | old_file_path = self.file_ops.current_file_path |
| 248 | |
| 249 | # Always save view state for the OLD file before switching (if there is one) |
| 250 | if old_file_path: |
| 251 | self.view_state.save_view_state(old_file_path) |
| 252 | |
| 253 | if self.file_ops.load(file_path): |
| 254 | # Load view state for the NEW file after switching |
| 255 | self.view_state.load_view_state() |
| 256 | |
| 257 | # Settings and environment handlers |
| 258 | def on_settings(self): |