From 84fc851846624d1d58f7f9ec414dae9a9e077839 Mon Sep 17 00:00:00 2001 From: Clifford Garwood Date: Tue, 14 Apr 2026 09:17:29 -0400 Subject: [PATCH] feat: add "Don't show again" to IMEX pre-slice warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces MessageDialog with RichMessageDialog to show a suppress checkbox on both slice-plate and slice-all warning paths. Persists the choice to app_config as imex_pre_slice_warnings=false. Adds a re-enable toggle in Printer Settings → Multimaterial → IDEX/IQEX Configuration so the warnings can be restored if suppressed accidentally. Co-Authored-By: Claude Sonnet 4.6 --- src/slic3r/GUI/Plater.cpp | 22 ++++++++++++++-------- src/slic3r/GUI/Tab.cpp | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index b969d2c8c7..d25f9386e1 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9890,7 +9890,7 @@ void Plater::priv::on_action_slice_plate(SimpleEvent&) { if (q != nullptr) { // IMEX parallel mode warnings (current plate only) - { + if (wxGetApp().app_config->get("imex_pre_slice_warnings") != "false") { PartPlate* plate = partplate_list.get_curr_plate(); std::vector warnings = collect_imex_warnings(plate); if (!warnings.empty()) { @@ -9899,8 +9899,12 @@ void Plater::priv::on_action_slice_plate(SimpleEvent&) for (const wxString& w : warnings) msg += L"\u2022 " + w + "\n\n"; msg += _L("Continue slicing?"); - MessageDialog dlg(q, msg, _L("IDEX/IQEX Parallel Mode Warning"), wxICON_WARNING | wxYES | wxNO); - if (dlg.ShowModal() != wxID_YES) { + RichMessageDialog dlg(q, msg, _L("IDEX/IQEX Parallel Mode Warning"), wxICON_WARNING | wxYES | wxNO); + dlg.ShowCheckBox(_L("Don't show these warnings again")); + int result = dlg.ShowModal(); + if (dlg.IsCheckBoxChecked()) + wxGetApp().app_config->set("imex_pre_slice_warnings", "false"); + if (result != wxID_YES) { q->select_view_3D("3D"); return; } @@ -9928,15 +9932,13 @@ void Plater::priv::on_action_slice_all(SimpleEvent&) { if (q != nullptr) { // IMEX parallel mode warnings (all plates) - { + if (wxGetApp().app_config->get("imex_pre_slice_warnings") != "false") { wxString combined_msg; - std::vector warned_plates; int plate_count = partplate_list.get_plate_count(); for (int i = 0; i < plate_count; ++i) { PartPlate* plate = partplate_list.get_plate(i); std::vector warnings = collect_imex_warnings(plate); if (warnings.empty()) continue; - warned_plates.push_back(plate); combined_msg += wxString::Format(_L("Plate %d:\n"), i + 1); for (const wxString& w : warnings) combined_msg += L" \u2022 " + w + "\n"; @@ -9946,8 +9948,12 @@ void Plater::priv::on_action_slice_all(SimpleEvent&) wxString msg = _L("The following IDEX/IQEX parallel mode concerns were detected:\n\n") + combined_msg + _L("Continue slicing?"); - MessageDialog dlg(q, msg, _L("IDEX/IQEX Parallel Mode Warning"), wxICON_WARNING | wxYES | wxNO); - if (dlg.ShowModal() != wxID_YES) { + RichMessageDialog dlg(q, msg, _L("IDEX/IQEX Parallel Mode Warning"), wxICON_WARNING | wxYES | wxNO); + dlg.ShowCheckBox(_L("Don't show these warnings again")); + int result = dlg.ShowModal(); + if (dlg.IsCheckBoxChecked()) + wxGetApp().app_config->set("imex_pre_slice_warnings", "false"); + if (result != wxID_YES) { q->select_view_3D("3D"); return; } diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 90afb0928d..82af5a0208 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -5369,6 +5369,25 @@ if (is_marlin_flavor) optgroup->append_single_option_line("imex_nozzle_clearance_x"); optgroup->append_single_option_line("imex_nozzle_clearance_y"); optgroup->append_single_option_line("imex_carriage_margin"); + { + // Toggle for pre-slice IMEX safety warnings (stored in app_config, not printer profile) + auto line = Line{ L("Pre-slice warnings"), L("Show a warning dialog before slicing if IDEX/IQEX parallel mode " + "concerns are detected (bed temperature conflicts, filament type " + "mismatches, multi-material conflicts). Can be suppressed from the " + "dialog itself. Re-enable here if suppressed accidentally.") }; + line.widget = [](wxWindow* parent) -> wxSizer* { + auto* cb = new wxCheckBox(parent, wxID_ANY, wxEmptyString); + bool enabled = wxGetApp().app_config->get("imex_pre_slice_warnings") != "false"; + cb->SetValue(enabled); + cb->Bind(wxEVT_CHECKBOX, [cb](wxCommandEvent&) { + wxGetApp().app_config->set("imex_pre_slice_warnings", cb->GetValue() ? "true" : "false"); + }); + auto* s = new wxBoxSizer(wxHORIZONTAL); + s->Add(cb, 0, wxALIGN_CENTER_VERTICAL); + return s; + }; + optgroup->append_line(line); + } { static const wxString theme_choices[] = { _L("Standard"),