Honor symbolic default bed types for new printers (#15273)

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
This commit is contained in:
TheLegendTubaGuy
2026-09-03 19:42:31 -03:00
committed by GitHub
co-authored by Rodrigo Faselli
parent b370d8ef31
commit 7acea3ed09
5 changed files with 60 additions and 8 deletions
+10
View File
@@ -2920,6 +2920,16 @@ void PresetBundle::load_selections(AppConfig &config, const PresetPreferences& p
// If executed due to a Config Wizard update, preferred_printer contains the first newly installed printer, otherwise nullptr.
const Preset *preferred_printer = printers.find_system_preset_by_model_and_variant(preferred_selection.printer_model_id, preferred_selection.printer_variant);
printers.select_preset_by_name(preferred_printer ? preferred_printer->name : initial_printer_profile_name, true);
Preset &selected_printer = printers.get_edited_preset();
if (selected_printer.printer_technology() == ptFFF) {
BedType bed_type = selected_printer.get_default_bed_type(this);
const std::string saved_bed_type = config.get_printer_setting(selected_printer.name, "curr_bed_type");
const int saved_bed_type_value = atoi(saved_bed_type.c_str());
if (saved_bed_type_value > btDefault && saved_bed_type_value < btCount)
bed_type = static_cast<BedType>(saved_bed_type_value);
project_config.set_key_value("curr_bed_type", new ConfigOptionEnum<BedType>(bed_type));
config.set("curr_bed_type", std::to_string(static_cast<int>(bed_type)));
}
CNumericLocalesSetter locales_setter;
// Orca: load from orca_presets