Show a warning dlg when enabling Make overhangs printable option

Fixes #4078
This commit is contained in:
SoftFever 2024-02-22 21:33:37 +08:00
parent 099e496ce9
commit 558510c5f1

View file

@ -1551,6 +1551,24 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
}
}
if(opt_key == "make_overhang_printable"){
if(m_config->opt_bool("make_overhang_printable")){
wxString msg_text = _(
L("Enabling this option will modify the model's shape. If your print requires precise dimensions or is part of an "
"assembly, it's important to double-check whether this change in geometry impacts the functionality of your print."));
msg_text += "\n\n" + _(L("Are you sure you want to enable this option?"));
MessageDialog dialog(wxGetApp().plater(), msg_text, "", wxICON_WARNING | wxYES | wxNO);
dialog.SetButtonLabel(wxID_YES, _L("Enable"));
dialog.SetButtonLabel(wxID_NO, _L("Cancel"));
if (dialog.ShowModal() == wxID_NO) {
DynamicPrintConfig new_conf = *m_config;
new_conf.set_key_value("make_overhang_printable", new ConfigOptionBool(false));
m_config_manipulation.apply(m_config, &new_conf);
wxGetApp().plater()->update();
}
}
}
if(opt_key=="layer_height"){
auto min_layer_height_from_nozzle=wxGetApp().preset_bundle->full_config().option<ConfigOptionFloats>("min_layer_height")->values;
auto max_layer_height_from_nozzle=wxGetApp().preset_bundle->full_config().option<ConfigOptionFloats>("max_layer_height")->values;