FIX:If the current preset cannot find PrinterModel, it will be found from the inherited parent preset

jira: STUDIO-10343
Change-Id: I4d3599ad4f7f4b21762cc0eee1174f6f05298e34
This commit is contained in:
zhou.xu 2025-02-17 14:35:06 +08:00 committed by lane.wei
parent 3e55bddcee
commit 7dd4b1e9e1
1 changed files with 4 additions and 0 deletions

View File

@ -2413,6 +2413,10 @@ bool Sidebar::reset_bed_type_combox_choices() {
auto bundle = wxGetApp().preset_bundle;
const Preset * curr = &bundle->printers.get_selected_preset();
const VendorProfile::PrinterModel *pm = PresetUtils::system_printer_model(*curr);
if (!pm) {
auto curr_parent = bundle->printers.get_selected_preset_parent();
pm = PresetUtils::system_printer_model(*curr_parent);
}
if (m_last_combo_bedtype_count != 0 && pm) {
auto cur_count = (int) BedType::btCount - 1 - pm->not_support_bed_types.size();
if (cur_count == m_last_combo_bedtype_count) {//no change