From e2475c95768378e06e2ed8c3863a7fcdd8cdfc35 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 17 Aug 2021 11:56:58 +0200 Subject: [PATCH] Workaround for #6814 --- src/slic3r/GUI/ConfigManipulation.cpp | 4 ++-- src/slic3r/GUI/ConfigManipulation.hpp | 2 +- src/slic3r/GUI/Tab.cpp | 11 ++++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 070773c11..7c0110a1f 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) +void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config, bool set_support_material_overhangs_queried) { // #ys_FIXME_to_delete //! Temporary workaround for the correct updates of the TextCtrl (like "layer_height"): @@ -160,7 +160,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con apply(config, &new_conf); } - static bool support_material_overhangs_queried = false; + static bool support_material_overhangs_queried = set_support_material_overhangs_queried; if (config->opt_bool("support_material")) { // Ask only once. diff --git a/src/slic3r/GUI/ConfigManipulation.hpp b/src/slic3r/GUI/ConfigManipulation.hpp index 1e91dbec2..e96ea3a4d 100644 --- a/src/slic3r/GUI/ConfigManipulation.hpp +++ b/src/slic3r/GUI/ConfigManipulation.hpp @@ -49,7 +49,7 @@ 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); + void update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config = false, bool set_support_material_overhangs_queried = false); void toggle_print_fff_options(DynamicPrintConfig* config); // SLA print diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 8b3cd4cf8..a51b0e160 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1735,7 +1735,16 @@ void TabPrint::update() m_update_cnt++; - m_config_manipulation.update_print_fff_config(m_config, true); + // see https://github.com/prusa3d/PrusaSlicer/issues/6814 + // ysFIXME: It's temporary workaround and should be clewer reworked: + // 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"); + + m_config_manipulation.update_print_fff_config(m_config, true, is_user_and_saved_preset && support_material_overhangs_queried); update_description_lines(); Layout();