FIX:add m_new_project_and_check_state flag

jira: STUDIO-14994
Change-Id: I068b18cfb29622de1641bc34c671d4710c1a07d3
(cherry picked from commit 670fb1764748e0d69cb2b4e657bfbd5c92daff9f)
This commit is contained in:
zhou.xu
2025-10-11 15:38:50 +08:00
committed by Noisyfox
parent f63cdc30e4
commit 0eca9eefb8
2 changed files with 9 additions and 1 deletions

View File

@@ -11004,6 +11004,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."));
@@ -11013,7 +11014,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)
@@ -13444,6 +13447,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()) {

View File

@@ -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<Slic3r::ColorRGBA> colors, int camera_view_angle_type);
@@ -924,6 +925,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