Fixed wrong updating of the options group tree
This commit is contained in:
parent
64b905820d
commit
c4478ccffa
@ -1709,7 +1709,8 @@ void TabPrinter::build_extruder_pages(){
|
||||
size_t n_before_extruders = 2; // Count of pages before Extruder pages
|
||||
size_t n_after_single_extruder_MM = 2; // Count of pages after single_extruder_multi_material page
|
||||
|
||||
if (m_extruders_count_old == m_extruders_count || m_extruders_count <= 2)
|
||||
if (m_extruders_count_old == m_extruders_count ||
|
||||
(m_has_single_extruder_MM_page && m_extruders_count == 1))
|
||||
{
|
||||
// if we have a single extruder MM setup, add a page with configuration options:
|
||||
for (int i = 0; i < m_pages.size(); ++i) // first make sure it's not there already
|
||||
@ -1717,16 +1718,19 @@ void TabPrinter::build_extruder_pages(){
|
||||
m_pages.erase(m_pages.begin() + i);
|
||||
break;
|
||||
}
|
||||
if (m_extruders_count > 1 && m_config->opt_bool("single_extruder_multi_material")) {
|
||||
// create a page, but pretend it's an extruder page, so we can add it to m_pages ourselves
|
||||
auto page = add_options_page(_(L("Single extruder MM setup")), "printer_empty.png", true);
|
||||
auto optgroup = page->new_optgroup(_(L("Single extruder multimaterial parameters")));
|
||||
optgroup->append_single_option_line("cooling_tube_retraction");
|
||||
optgroup->append_single_option_line("cooling_tube_length");
|
||||
optgroup->append_single_option_line("parking_pos_retraction");
|
||||
m_pages.insert(m_pages.end() - n_after_single_extruder_MM, page);
|
||||
}
|
||||
m_has_single_extruder_MM_page = false;
|
||||
}
|
||||
if (m_extruders_count > 1 && m_config->opt_bool("single_extruder_multi_material") && !m_has_single_extruder_MM_page) {
|
||||
// create a page, but pretend it's an extruder page, so we can add it to m_pages ourselves
|
||||
auto page = add_options_page(_(L("Single extruder MM setup")), "printer_empty.png", true);
|
||||
auto optgroup = page->new_optgroup(_(L("Single extruder multimaterial parameters")));
|
||||
optgroup->append_single_option_line("cooling_tube_retraction");
|
||||
optgroup->append_single_option_line("cooling_tube_length");
|
||||
optgroup->append_single_option_line("parking_pos_retraction");
|
||||
m_pages.insert(m_pages.end() - n_after_single_extruder_MM, page);
|
||||
m_has_single_extruder_MM_page = true;
|
||||
}
|
||||
|
||||
|
||||
for (auto extruder_idx = m_extruders_count_old; extruder_idx < m_extruders_count; ++extruder_idx){
|
||||
//# build page
|
||||
|
@ -312,6 +312,7 @@ public:
|
||||
//Slic3r::GUI::Tab::Printer;
|
||||
class TabPrinter : public Tab
|
||||
{
|
||||
bool m_has_single_extruder_MM_page = false;
|
||||
public:
|
||||
wxButton* m_serial_test_btn;
|
||||
wxButton* m_octoprint_host_test_btn;
|
||||
|
Loading…
Reference in New Issue
Block a user