mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 10:51:22 +00:00
Code refactoring for better maintainability
This commit is contained in:
@@ -5049,8 +5049,8 @@ void TabPrinter::build_fff()
|
||||
}
|
||||
|
||||
// Register by hand so the UnsavedChanges dialog can render a row for it.
|
||||
wxGetApp().sidebar().get_searcher().add_key("printer_agent", m_type, optgroup->title,
|
||||
optgroup->config_category(), optgroup->icon);
|
||||
wxGetApp().sidebar().settings_index().add_key("printer_agent", m_type, optgroup->title,
|
||||
optgroup->config_category(), optgroup->icon);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5761,11 +5761,11 @@ if (is_marlin_flavor)
|
||||
} else if (m_extruders_count_old == 1) {
|
||||
first_extruder_title = wxString::Format("Extruder %d", 1);
|
||||
}
|
||||
auto & searcher = wxGetApp().sidebar().get_searcher();
|
||||
auto & index = wxGetApp().sidebar().settings_index();
|
||||
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, group->icon);
|
||||
index.add_key(opt.first + "#0", m_type, group->title, first_extruder_title, group->icon);
|
||||
}
|
||||
|
||||
Thaw();
|
||||
@@ -7867,10 +7867,10 @@ wxSizer* TabPrinter::create_bed_shape_widget(wxWindow* parent)
|
||||
}));
|
||||
|
||||
{
|
||||
Search::OptionsSearcher& searcher = wxGetApp().sidebar().get_searcher();
|
||||
const Search::GroupAndCategory& gc = searcher.get_group_and_category("printable_area");
|
||||
searcher.add_key("bed_custom_texture", m_type, gc.group, gc.category, gc.icon);
|
||||
searcher.add_key("bed_custom_model", m_type, gc.group, gc.category, gc.icon);
|
||||
Search::SettingsIndex& index = wxGetApp().sidebar().settings_index();
|
||||
const Search::GroupAndCategory& gc = index.get_group_and_category("printable_area");
|
||||
index.add_key("bed_custom_texture", m_type, gc.group, gc.category, gc.icon);
|
||||
index.add_key("bed_custom_model", m_type, gc.group, gc.category, gc.icon);
|
||||
}
|
||||
|
||||
return sizer;
|
||||
|
||||
Reference in New Issue
Block a user