feat: add "Don't show again" to IMEX pre-slice warnings

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 <noreply@anthropic.com>
This commit is contained in:
Clifford Garwood
2026-04-14 09:17:29 -04:00
co-authored by Claude Sonnet 4.6
parent 857bfbfb82
commit 84fc851846
2 changed files with 33 additions and 8 deletions
+14 -8
View File
@@ -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<wxString> 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<PartPlate*> 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<wxString> 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;
}
+19
View File
@@ -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"),