(self)
| 835 | return str(project.subdir(subdir) / f"{stem}{ext}") |
| 836 | |
| 837 | def _on_export_svg(self): |
| 838 | path, _ = QFileDialog.getSaveFileName( |
| 839 | self, "Export SVG", self._default_export_path("img", ".svg"), |
| 840 | "SVG (*.svg);;All Files (*)" |
| 841 | ) |
| 842 | if not path: |
| 843 | return |
| 844 | p = Path(path) |
| 845 | if p.suffix.lower() != ".svg": |
| 846 | p = p.with_suffix(".svg") |
| 847 | from .export import export_svg |
| 848 | from .canvas import SchematicScene |
| 849 | title = self._doc_props.title or (self._current_path.stem if self._current_path else "schematic") |
| 850 | try: |
| 851 | fresh = SchematicScene() |
| 852 | fresh.from_data(self._scene.to_data(), self._library) |
| 853 | export_svg(fresh, p, title) |
| 854 | except Exception as exc: |
| 855 | QMessageBox.critical(self, "Export SVG failed", str(exc)) |
| 856 | |
| 857 | def _on_export_pdf(self): |
| 858 | path, _ = QFileDialog.getSaveFileName( |
nothing calls this directly
no test coverage detected