From e05080c53b571b005748f05ae06007999ede86c1 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 27 Oct 2020 22:53:43 +0100 Subject: [PATCH] Fixed update of the field related to the "extruders_count" parameter after printer preset change --- src/slic3r/GUI/Tab.cpp | 10 ++++++++++ src/slic3r/GUI/Tab.hpp | 1 + 2 files changed, 11 insertions(+) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 11e4f2510..a2199d5a2 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2717,6 +2717,16 @@ void TabPrinter::update_pages() rebuild_page_tree(); } +void TabPrinter::reload_config() +{ + Tab::reload_config(); + + // "extruders_count" doesn't update from the update_config(), + // so update it implicitly + if (m_active_page && m_active_page->title() == "General") + m_active_page->set_value("extruders_count", int(m_extruders_count)); +} + void TabPrinter::activate_selected_page(std::function throw_if_canceled) { Tab::activate_selected_page(throw_if_canceled); diff --git a/src/slic3r/GUI/Tab.hpp b/src/slic3r/GUI/Tab.hpp index 8c00f825c..8b73b61be 100644 --- a/src/slic3r/GUI/Tab.hpp +++ b/src/slic3r/GUI/Tab.hpp @@ -465,6 +465,7 @@ public: void build_print_host_upload_group(Page* page); void build_fff(); void build_sla(); + void reload_config() override; void activate_selected_page(std::function throw_if_canceled) override; void clear_pages() override; void toggle_options() override;