From b1e684a9893b60674ca4c68b5a29fd6e991aa85a Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Sat, 11 Oct 2025 15:38:50 +0800 Subject: [PATCH] FIX:add m_new_project_and_check_state flag jira: STUDIO-14994 Change-Id: I068b18cfb29622de1641bc34c671d4710c1a07d3 (cherry picked from commit 670fb1764748e0d69cb2b4e657bfbd5c92daff9f) --- src/slic3r/GUI/Plater.cpp | 8 +++++++- src/slic3r/GUI/Plater.hpp | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index a6d8c259a7..fce01b8bd5 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -10990,6 +10990,7 @@ int Plater::new_project(bool skip_confirm, bool silent, const wxString& project_ bool transfer_preset_changes = false; // BBS: save confirm auto check = [this,&transfer_preset_changes](bool yes_or_no) { + m_new_project_and_check_state = true; wxString header = _L("Some presets are modified.") + "\n" + (yes_or_no ? _L("You can keep the modified presets to the new project or discard them") : _L("You can keep the modified presets to the new project, discard or save changes as new presets.")); @@ -10999,7 +11000,9 @@ int Plater::new_project(bool skip_confirm, bool silent, const wxString& project_ if (m_exported_file) { //.gcode.3mf ignore presets modify m_exported_file = false; } - return wxGetApp().check_and_keep_current_preset_changes(_L("Creating a new project"), header, act_buttons, &transfer_preset_changes); + bool result = wxGetApp().check_and_keep_current_preset_changes(_L("Creating a new project"), header, act_buttons, &transfer_preset_changes); + m_new_project_and_check_state = false; + return result; }; int result; if (!skip_confirm && (result = close_with_confirm(check)) == wxID_CANCEL) @@ -13448,6 +13451,9 @@ void Plater::add_file() void Plater::update(bool conside_update_flag, bool force_background_processing_update) { + if (is_new_project_and_check_state()) { + return; + } unsigned int flag = force_background_processing_update ? (unsigned int)Plater::priv::UpdateParams::FORCE_BACKGROUND_PROCESSING_UPDATE : 0; if (conside_update_flag) { if (need_update()) { diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 7bd8bd05a0..1db736e6fb 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -352,6 +352,7 @@ public: bool is_multi_extruder_ams_empty(); // BBS + bool is_new_project_and_check_state() { return m_new_project_and_check_state; } wxString get_project_name(); void update_all_plate_thumbnails(bool force_update = false); void update_obj_preview_thumbnail(ModelObject *, int obj_idx, int vol_idx, std::vector colors, int camera_view_angle_type); @@ -923,6 +924,7 @@ private: bool m_exported_file { false }; bool skip_thumbnail_invalid { false }; bool m_loading_project { false }; + bool m_new_project_and_check_state{false}; std::string m_preview_only_filename; int m_valid_plates_count { 0 }; int m_check_status = 0; // 0 not check, 1 check success, 2 check failed