From 89c1395f27c84dee6b3eaba38f84baa3aebfc32c Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Tue, 24 Oct 2023 15:26:47 +0800 Subject: [PATCH] FIX: the error message dialog is always show when modify params Jira: STUDIO-4781 Change-Id: I93797861843e89fdc80be38859bd8043b2b51aa6 --- src/slic3r/GUI/ConfigManipulation.cpp | 20 -------------------- src/slic3r/GUI/Tab.cpp | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index aeb0640ba..ac9952890 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -321,26 +321,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con is_msg_dlg_already_exist = false; } - if (config->opt_enum("print_sequence") == PrintSequence::ByObject) { - auto printer_structure_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option>("printer_structure"); - if (printer_structure_opt && printer_structure_opt->value == PrinterStructure::psI3) { - wxString msg_text = _(L("When print by object, machines with I3 structure will not generate timelapse videos.")); - - if (is_global_config) - msg_text += "\n\n" + _(L("Still print by object?")); - - MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | (is_global_config ? wxYES | wxNO : wxOK)); - auto answer = dialog.ShowModal(); - if (answer == wxID_NO) { - is_msg_dlg_already_exist = true; - DynamicPrintConfig new_conf = *config; - new_conf.set_key_value("print_sequence", new ConfigOptionEnum(tlTraditional)); - apply(config, &new_conf); - is_msg_dlg_already_exist = false; - } - } - } - //BBS //if (config->opt_enum("wall_generator") == PerimeterGeneratorType::Arachne && // config->opt_bool("enable_overhang_speed")) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index b096041d1..ba9e1151a 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1424,6 +1424,23 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) } } + if (opt_key == "print_sequence" && m_config->opt_enum("print_sequence") == PrintSequence::ByObject) { + auto printer_structure_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option>("printer_structure"); + if (printer_structure_opt && printer_structure_opt->value == PrinterStructure::psI3) { + wxString msg_text = _(L("When print by object, machines with I3 structure will not generate timelapse videos.")); + msg_text += "\n\n" + _(L("Still print by object?")); + + MessageDialog dialog(wxGetApp().plater(), msg_text, "", wxICON_WARNING | wxYES | wxNO); + auto answer = dialog.ShowModal(); + if (answer == wxID_NO) { + DynamicPrintConfig new_conf = *m_config; + new_conf.set_key_value("print_sequence", new ConfigOptionEnum(PrintSequence::ByLayer)); + m_config_manipulation.apply(m_config, &new_conf); + wxGetApp().plater()->update(); + } + } + } + // BBS set support style to default when support type changes if (opt_key == "support_type") { DynamicPrintConfig new_conf = *m_config;