ENH: show category for multi extruders in search

Change-Id: I2441097f076e772dcc0b11245c6d22ed22bfad2b
Jira: STUDIO-10187
(cherry picked from commit 6eba5f3b4821c8302d1423090e3fcdf3309d83b9)
This commit is contained in:
chunmao.guo
2025-03-07 13:44:57 +08:00
committed by Noisyfox
parent f378a41f7f
commit 4472c801b9
3 changed files with 26 additions and 8 deletions

View File

@@ -4734,13 +4734,20 @@ if (is_marlin_flavor)
}
// BBS. No extra extruder page for single physical extruder machine
// # remove extra pages
auto &first_extruder_title = const_cast<wxString &>(m_pages[n_before_extruders]->title());
if (m_extruders_count < m_extruders_count_old) {
m_pages.erase( m_pages.begin() + n_before_extruders + m_extruders_count,
m_pages.begin() + n_before_extruders + m_extruders_count_old);
if (m_extruders_count == 1)
const_cast<wxString&>(m_pages[n_before_extruders]->title()) = wxString::Format("Extruder");
first_extruder_title = wxString::Format("Extruder");
} else if (m_extruders_count_old == 1) {
const_cast<wxString &>(m_pages[n_before_extruders]->title()) = wxString::Format("Extruder %d", 1);
first_extruder_title = wxString::Format("Extruder %d", 1);
}
auto & searcher = wxGetApp().sidebar().get_searcher();
for (auto &group : m_pages[n_before_extruders]->m_optgroups) {
group->set_config_category_and_type(first_extruder_title, m_type);
for (auto &opt : group->opt_map())
searcher.add_key(opt.first + "#0", m_type, group->title, first_extruder_title);
}
Thaw();