FIX: restore nozzle_volume_type later on_preset_loaded

Change-Id: I8fb9c8c5ff04f9f84a97750f48f763521b8f4b58
Jira: none
This commit is contained in:
chunmao.guo 2025-01-19 11:59:04 +08:00 committed by lane.wei
parent 91452df326
commit 1dc94cffd3
1 changed files with 7 additions and 7 deletions

View File

@ -4214,6 +4214,13 @@ void TabPrinter::on_preset_loaded()
if (!base_printer)
base_printer = &current_printer;
std::string base_name = base_printer->name;
// update the extruders count field
auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloatsNullable*>(m_config->option("nozzle_diameter"));
size_t extruders_count = nozzle_diameter->values.size();
// update the GUI field according to the number of nozzle diameters supplied
if (m_extruders_count != extruders_count)
extruders_count_changed(extruders_count);
if (base_name != m_base_preset_name) {
bool use_default_nozzle_volume_type = true;
m_base_preset_name = base_name;
@ -4228,13 +4235,6 @@ void TabPrinter::on_preset_loaded()
m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type")->values = current_printer.config.option<ConfigOptionEnumsGeneric>("default_nozzle_volume_type")->values;
}
}
// update the extruders count field
auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloatsNullable*>(m_config->option("nozzle_diameter"));
size_t extruders_count = nozzle_diameter->values.size();
// update the GUI field according to the number of nozzle diameters supplied
if (m_extruders_count != extruders_count)
extruders_count_changed(extruders_count);
}
void TabPrinter::update_pages()