From 4b3ff99004e6d7f04f6bf60e2cb085639db127d2 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Thu, 13 Aug 2026 09:01:18 +0200 Subject: [PATCH] Project load: say WHY the CAD model could not be restored MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit deserialize_recipe distinguishes three cases that matter very differently to the person reading the message — saved by a NEWER build, saved by an OLDER one, or genuinely unreadable — and names the version in each. load_recipe threw all of that away and printed one generic sentence, so the user could not tell "update SnapOrca" from "your file is damaged", and had no way to find out. Same error-loss class as the 31 McpControl sites fixed in 1de72de9ed: the message existed, it was simply not passed on. The generic sentence stays as the fallback for the case where the kernel really has nothing to say. This does not make old projects loadable — that is snaporca-2txy, which the audit behind this change opened. It only stops the reason being withheld. snaporca-2txy (partial). Reviewed and compiled (RC=0), not exercised. --- src/slic3r/GUI/DesignPanel.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/DesignPanel.cpp b/src/slic3r/GUI/DesignPanel.cpp index c04cbca275..1f1c4c2966 100644 --- a/src/slic3r/GUI/DesignPanel.cpp +++ b/src/slic3r/GUI/DesignPanel.cpp @@ -6094,7 +6094,17 @@ void DesignPanel::load_recipe(const std::string& blob) { if (blob.empty()) return; if (!m_doc.deserialize_recipe(blob)) { - set_status(_L("Could not restore the CAD model from this project")); + // Carry the kernel's reason. deserialize_recipe distinguishes three cases that matter + // very differently to the person reading this — saved by a NEWER build, saved by an + // OLDER one, or genuinely unreadable — and replacing all three with one sentence left + // the user unable to tell "update SnapOrca" from "your file is damaged". Same + // error-loss class as the 31 McpControl sites (1de72de9ed): the message exists, it was + // simply not passed on. + m_status->SetForegroundColour(wxColour(235, 110, 110)); + set_status(m_doc.error.empty() + ? _L("Could not restore the CAD model from this project") + : _L("Could not restore the CAD model: ") + wxString::FromUTF8(m_doc.error)); + m_status->Refresh(); return; } m_feature_counter = int(m_doc.features.size());