Reset the CAD document with the project, and track its changes

New Project and Open Project went through Plater::priv::reset, which
drops ModelObjects but not the Model-level recipe, and never touched
the Design panel's document at all — so the previous design stayed
loaded and its next edit wrote itself into the new project.

A design that has not been committed to the plate has no ModelObjects,
so the project also read as clean: no autosave, and no unsaved-changes
prompt before the reset threw the design away.
This commit is contained in:
SoftFever
2026-08-27 23:35:18 +08:00
parent a1110b0050
commit ba1df32e88
3 changed files with 57 additions and 13 deletions
+1
View File
@@ -51,6 +51,7 @@ public:
explicit DesignPanel(wxWindow* parent);
void on_tab_shown(); // re-sync bed to the active printer when the Design tab is activated
void on_tab_hidden(); // another tab took over: take the viewport status line down with us
void clear_document(); // New Project / Open Project: drop the document with the project
// Rebuild off the UI thread (progress dialog only if it turns out to be slow), so a feature
// op on a heavy imported solid does not freeze the window. Returns m_doc.recompute()'s result.
// Push the document's recipe into the Model so ANY save path persists it (snaporca-vjk5).