diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index b99319274..0b2af37b8 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -33,7 +33,7 @@ void ConfigManipulation::toggle_field(const std::string& opt_key, const bool tog cb_toggle_field(opt_key, toggle, opt_index); } -void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config, bool set_support_material_overhangs_queried) +void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config) { // #ys_FIXME_to_delete //! Temporary workaround for the correct updates of the TextCtrl (like "layer_height"): @@ -160,12 +160,10 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con apply(config, &new_conf); } - support_material_overhangs_queried = set_support_material_overhangs_queried; - if (config->opt_bool("support_material")) { // Ask only once. - if (!support_material_overhangs_queried) { - support_material_overhangs_queried = true; + if (!m_support_material_overhangs_queried) { + m_support_material_overhangs_queried = true; if (!config->opt_bool("overhangs")/* != 1*/) { wxString msg_text = _(L("Supports work better, if the following feature is enabled:\n" "- Detect bridging perimeters")); @@ -184,7 +182,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con } } else { - support_material_overhangs_queried = false; + m_support_material_overhangs_queried = false; } if (config->option("fill_density")->value == 100) { diff --git a/src/slic3r/GUI/ConfigManipulation.hpp b/src/slic3r/GUI/ConfigManipulation.hpp index 8ebfad0ea..0b50c8ab0 100644 --- a/src/slic3r/GUI/ConfigManipulation.hpp +++ b/src/slic3r/GUI/ConfigManipulation.hpp @@ -20,7 +20,9 @@ namespace GUI { class ConfigManipulation { bool is_msg_dlg_already_exist{ false }; - bool support_material_overhangs_queried{ false }; + + bool m_support_material_overhangs_queried{false}; + bool m_is_initialized_support_material_overhangs_queried{ false }; // function to loading of changed configuration std::function load_config = nullptr; @@ -50,12 +52,19 @@ public: void toggle_field(const std::string& field_key, const bool toggle, int opt_index = -1); // FFF print - void update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config = false, bool set_support_material_overhangs_queried = false); + void update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config = false); void toggle_print_fff_options(DynamicPrintConfig* config); // SLA print void update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config = false); void toggle_print_sla_options(DynamicPrintConfig* config); + + bool is_initialized_support_material_overhangs_queried() { return m_is_initialized_support_material_overhangs_queried; } + void initialize_support_material_overhangs_queried(bool queried) + { + m_is_initialized_support_material_overhangs_queried = true; + m_support_material_overhangs_queried = queried; + } }; } // GUI diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index a51b0e160..1a96f4baf 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1740,11 +1740,14 @@ void TabPrint::update() // Note: This workaround works till "support_material" and "overhangs" is exclusive sets of mutually no-exclusive parameters. // But it should be corrected when we will have more such sets. // Disable check of the compatibility of the "support_material" and "overhangs" options for saved user profile - const Preset& selected_preset = m_preset_bundle->prints.get_selected_preset(); - bool is_user_and_saved_preset = !selected_preset.is_system && !selected_preset.is_dirty; - bool support_material_overhangs_queried = m_config->opt_bool("support_material") && !m_config->opt_bool("overhangs"); + if (!m_config_manipulation.is_initialized_support_material_overhangs_queried()) { + const Preset& selected_preset = m_preset_bundle->prints.get_selected_preset(); + bool is_user_and_saved_preset = !selected_preset.is_system && !selected_preset.is_dirty; + bool support_material_overhangs_queried = m_config->opt_bool("support_material") && !m_config->opt_bool("overhangs"); + m_config_manipulation.initialize_support_material_overhangs_queried(is_user_and_saved_preset && support_material_overhangs_queried); + } - m_config_manipulation.update_print_fff_config(m_config, true, is_user_and_saved_preset && support_material_overhangs_queried); + m_config_manipulation.update_print_fff_config(m_config, true); update_description_lines(); Layout();