Fix of #5450 - Wrong printer preset after loading 3mf project file when having multiple presets for one physical printer

This commit is contained in:
YuSanka 2020-12-15 12:09:03 +01:00
parent 82fe571cdc
commit 43581059ff
3 changed files with 10 additions and 2 deletions

View file

@ -876,7 +876,7 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool
// Activate the physical printer profile if possible.
PhysicalPrinter *pp = this->physical_printers.find_printer(physical_printer, true);
if (pp != nullptr && std::find(pp->preset_names.begin(), pp->preset_names.end(), this->printers.get_edited_preset().name) != pp->preset_names.end())
this->physical_printers.select_printer(*pp);
this->physical_printers.select_printer(pp->name, this->printers.get_edited_preset().name);
else
this->physical_printers.unselect_printer();
}
@ -1396,7 +1396,7 @@ size_t PresetBundle::load_configbundle(const std::string &path, unsigned int fla
if (! active_printer.empty())
printers.select_preset_by_name(active_printer, true);
if (! active_physical_printer.empty())
physical_printers.select_printer(active_physical_printer +" * " + active_printer);
physical_printers.select_printer(active_physical_printer, active_printer);
// Activate the first filament preset.
if (! active_filaments.empty() && ! active_filaments.front().empty())
filaments.select_preset_by_name(active_filaments.front(), true);