ConfigWizard: Select an appropriate printer based on the bundle order

This commit is contained in:
Vojtech Kral 2019-04-26 16:53:04 +02:00
parent c8815041e2
commit fb0836b0b2
6 changed files with 57 additions and 21 deletions

View file

@ -125,9 +125,6 @@ void config_wizard(int reason)
if (! wxGetApp().check_unsaved_changes())
return;
// save selected preset before config wizard running
const auto printer_preset_name = wxGetApp().preset_bundle->printers.get_edited_preset().name;
try {
ConfigWizard wizard(nullptr, static_cast<ConfigWizard::RunReason>(reason));
wizard.run(wxGetApp().preset_bundle, wxGetApp().preset_updater);
@ -136,10 +133,8 @@ void config_wizard(int reason)
show_error(nullptr, e.what());
}
// select old(before config wizard running) preset
wxGetApp().get_tab(Preset::TYPE_PRINTER)->select_preset(printer_preset_name);
// If old preset if invisible now, then first visible preset will be selected
// So, let control the case if multi-part object is on the scene and first visible preset is SLA
wxGetApp().load_current_presets();
if (wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA &&
wxGetApp().obj_list()->has_multi_part_objects())
{