From 64e7c5ac46b0657e1f1748c4d7fccdfefc5bbaab Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Thu, 10 Apr 2025 15:47:54 +0800 Subject: [PATCH] FIX: add warning tips when using precise_z_height with prime tower jira: STUDIO-11208 Change-Id: I0fa704e1c4f645c3442cbd4b8476b6cdb98e837c --- src/slic3r/GUI/Tab.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 30e3eb6b7..21633b5f4 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1468,9 +1468,34 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) } 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 == "precise_z_height") { + bool wipe_tower_enabled = m_config->option("enable_prime_tower")->value; + if (boost::any_cast(value) && wipe_tower_enabled) { + 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("precise_z_height", new ConfigOptionBool(false)); + m_config_manipulation.apply(m_config, &new_conf); + } + wxGetApp().plater()->update(); + } + } + // reload scene to update timelapse wipe tower if (opt_key == "timelapse_type") { bool wipe_tower_enabled = m_config->option("enable_prime_tower")->value;