From 78a5caf83b44a784c087d04346d8e7188f8bf593 Mon Sep 17 00:00:00 2001 From: Derrick Date: Fri, 6 Feb 2026 17:22:37 +0800 Subject: [PATCH] remove duplicate of warning notification for wipe tower and precise z (#12192) Fix duplicate of confirmation window for prime tower and precise z warning notification JIRA-23 --- src/slic3r/GUI/Tab.cpp | 56 +++++++++--------------------------------- 1 file changed, 12 insertions(+), 44 deletions(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 2d248e7beb..c33b72471c 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1546,56 +1546,14 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) auto timelapse_type = m_config->option>("timelapse_type"); bool timelapse_enabled = timelapse_type->value == TimelapseType::tlSmooth; if (!boost::any_cast(value) && timelapse_enabled) { + bool set_enable_prime_tower = false; MessageDialog dlg(wxGetApp().plater(), _L("A prime tower is required for smooth timelapse. There may be flaws on the model without prime tower. Are you sure you want to disable prime tower?"), _L("Warning"), wxICON_WARNING | wxYES | wxNO); if (dlg.ShowModal() == wxID_NO) { DynamicPrintConfig new_conf = *m_config; new_conf.set_key_value("enable_prime_tower", new ConfigOptionBool(true)); m_config_manipulation.apply(m_config, &new_conf); - } - wxGetApp().plater()->update(); - } - bool is_precise_z_height = m_config->option("precise_z_height")->value; - if (boost::any_cast(value) && is_precise_z_height) { - MessageDialog dlg(wxGetApp().plater(), _L("Enabling both precise Z height and the prime tower may cause the size of prime tower to increase. Do you still want to enable?"), - _L("Warning"), wxICON_WARNING | wxYES | wxNO); - if (dlg.ShowModal() == wxID_NO) { - DynamicPrintConfig new_conf = *m_config; - new_conf.set_key_value("enable_prime_tower", new ConfigOptionBool(false)); - m_config_manipulation.apply(m_config, &new_conf); - } - wxGetApp().plater()->update(); - } - update_wiping_button_visibility(); - } - - - if (opt_key == "single_extruder_multi_material" ){ - const auto bSEMM = m_config->opt_bool("single_extruder_multi_material"); - wxGetApp().sidebar().show_SEMM_buttons(bSEMM); - wxGetApp().get_tab(Preset::TYPE_PRINT)->update(); - } - - if(opt_key == "purge_in_prime_tower") - wxGetApp().get_tab(Preset::TYPE_PRINT)->update(); - - - if (opt_key == "enable_prime_tower") { - auto timelapse_type = m_config->option>("timelapse_type"); - bool timelapse_enabled = timelapse_type->value == TimelapseType::tlSmooth; - if (!boost::any_cast(value)) { - bool set_enable_prime_tower = false; - if (timelapse_enabled) { - MessageDialog - dlg(wxGetApp().plater(), - _L("A prime tower is required for smooth timelapse. There may be flaws on the model without prime tower. Are you sure you want to disable prime tower?"), - _L("Warning"), wxICON_WARNING | wxYES | wxNO); - if (dlg.ShowModal() == wxID_NO) { - DynamicPrintConfig new_conf = *m_config; - new_conf.set_key_value("enable_prime_tower", new ConfigOptionBool(true)); - m_config_manipulation.apply(m_config, &new_conf); - set_enable_prime_tower = true; - } + set_enable_prime_tower = true; } bool enable_wrapping = m_config->option("enable_wrapping_detection")->value; if (enable_wrapping && !set_enable_prime_tower) { @@ -1625,6 +1583,16 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) update_wiping_button_visibility(); } + + if (opt_key == "single_extruder_multi_material" ){ + const auto bSEMM = m_config->opt_bool("single_extruder_multi_material"); + wxGetApp().sidebar().show_SEMM_buttons(bSEMM); + wxGetApp().get_tab(Preset::TYPE_PRINT)->update(); + } + + if(opt_key == "purge_in_prime_tower") + wxGetApp().get_tab(Preset::TYPE_PRINT)->update(); + if (opt_key == "enable_wrapping_detection") { bool wipe_tower_enabled = m_config->option("enable_prime_tower")->value; if (boost::any_cast(value) && !wipe_tower_enabled) {