(self, path: Path)
| 758 | ) |
| 759 | |
| 760 | def _save_to(self, path: Path): |
| 761 | self._doc_props.last_modified = _date.today().isoformat() |
| 762 | data = self._scene.to_data() |
| 763 | data.properties = self._doc_props |
| 764 | try: |
| 765 | data.save(path) |
| 766 | self._current_path = path |
| 767 | project.set_current(path) # migrates session-temp cache → <name>.cache |
| 768 | import SLiCAP.schematic.config as _config |
| 769 | _config.write(project.ini_path()) # persist current style → <name>.ini |
| 770 | used = {c.symbol_name for c in data.components} |
| 771 | if used: # freeze the symbols this schematic uses |
| 772 | self._library.write_bundle(used, project.symbols_path()) |
| 773 | self._dirty = False |
| 774 | self.setWindowTitle(f"SLiCAP — {path.name}") |
| 775 | except Exception as exc: |
| 776 | QMessageBox.critical(self, "Save failed", str(exc)) |
| 777 | return |
| 778 | self._current_path = path |
| 779 | self.setWindowTitle(f"SLiCAP — {path.name}") |
| 780 | |
| 781 | def _on_doc_properties(self): |
| 782 | from .document_properties_dialog import DocumentPropertiesDialog |
no test coverage detected