diff --git a/src/slic3r/GUI/PhysicalPrinterDialog.cpp b/src/slic3r/GUI/PhysicalPrinterDialog.cpp index 8237ddd99..f67af6dfc 100644 --- a/src/slic3r/GUI/PhysicalPrinterDialog.cpp +++ b/src/slic3r/GUI/PhysicalPrinterDialog.cpp @@ -462,7 +462,7 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr choice->set_selection(); } - update(); + update(true); } void PhysicalPrinterDialog::update_printhost_buttons() @@ -632,11 +632,12 @@ void PhysicalPrinterDialog::update_host_type(bool printer_change) Choice* choice = dynamic_cast(ht); choice->set_values(types); - int index_in_choice = (printer_change ? 0 : last_in_conf); + int dif = (int)ht->m_opt.enum_def->values().size() - (int)types.size(); + int index_in_choice = (printer_change ? std::clamp(last_in_conf - ((int)ht->m_opt.enum_def->values().size() - (int)types.size()), 0, (int)ht->m_opt.enum_def->values().size() - 1) : last_in_conf); choice->set_value(index_in_choice); if (link.supported && link.label == _(ht->m_opt.enum_def->label(index_in_choice))) m_config->set_key_value("host_type", new ConfigOptionEnum(htPrusaLink)); - else if (link.supported && link.label == _(ht->m_opt.enum_def->label(index_in_choice))) + else if (connect.supported && connect.label == _(ht->m_opt.enum_def->label(index_in_choice))) m_config->set_key_value("host_type", new ConfigOptionEnum(htPrusaConnect)); else { int host_type = std::clamp(index_in_choice + ((int)ht->m_opt.enum_def->values().size() - (int)types.size()), 0, (int)ht->m_opt.enum_def->values().size() - 1);