Clarify Create nozzle for existing printer (#11773)

* Update CreatePresetsDialog.cpp

* add information for existing nozzles
This commit is contained in:
yw4z
2026-05-15 05:03:17 +03:00
committed by GitHub
parent 40888242c6
commit cf0dfd12ce

View File

@@ -3378,9 +3378,30 @@ bool CreatePrinterPresetDialog::validate_input_valid()
if (auto preset = wxGetApp().preset_bundle->printers.find_preset(custom_printer_name)) {
if (preset->is_system) {
MessageDialog dlg(this, _L("The system preset does not allow creation. \nPlease re-enter the printer model or nozzle diameter."), wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Info"),
wxYES | wxYES_DEFAULT | wxCENTRE);
dlg.ShowModal();
// ORCA offer switcing to existing preset to reduce confusion
std::string diameters;
auto printer_model = preset->config.opt_string("printer_model");
for (auto &preset : wxGetApp().preset_bundle->printers) {
if (preset.config.opt_string("printer_model") == printer_model)
diameters += preset.config.opt_string("printer_variant") + " ";
}
MessageDialog dlg(this, _L("The system preset does not allow creation. \nPlease re-enter the printer model or nozzle diameter.")
+ _L("\n\nAvailable nozzle profiles for this printer:")
+ "\n" + diameters
+ _L("\n\nChoose YES to switch existing preset:")
+ "\n" + preset->name
, wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Info")
, wxYES | wxYES_DEFAULT | wxNO | wxCENTRE);
if (dlg.ShowModal() == wxID_YES){
auto bundle = wxGetApp().preset_bundle;
bundle->printers.select_preset_by_name(preset->name, true);
bundle->update_compatible(PresetSelectCompatibleType::Always);
wxGetApp().load_current_presets();
wxGetApp().mainframe->update_side_preset_ui();
wxGetApp().sidebar().update_ui_from_settings();
wxGetApp().sidebar().update_all_preset_comboboxes();
EndModal(wxID_CANCEL);
}
return false;
}
}