From c1e92a575951069c354405cc1e9984d38e4339b8 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 16 Mar 2020 09:57:20 +0100 Subject: [PATCH] Fix of "Print settings reloaded with 0.05 layer and fill percentage changed after click on modified profile #3755" Combo box callback was not removing the "(modified)" suffix. --- src/slic3r/GUI/Plater.cpp | 4 ++-- src/slic3r/GUI/Preset.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 035aabf6e..f6be4bc68 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3635,8 +3635,8 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt) //! instead of //! combo->GetStringSelection().ToUTF8().data()); - const std::string& selected_string = combo->GetString(combo->GetSelection()).ToUTF8().data(); - const std::string preset_name = wxGetApp().preset_bundle->get_preset_name_by_alias(preset_type, selected_string); + const std::string preset_name = wxGetApp().preset_bundle->get_preset_name_by_alias(preset_type, + Preset::remove_suffix_modified(combo->GetString(combo->GetSelection()).ToUTF8().data())); if (preset_type == Preset::TYPE_FILAMENT) { wxGetApp().preset_bundle->set_filament_preset(idx, preset_name); diff --git a/src/slic3r/GUI/Preset.hpp b/src/slic3r/GUI/Preset.hpp index efcbd9a28..fee70c943 100644 --- a/src/slic3r/GUI/Preset.hpp +++ b/src/slic3r/GUI/Preset.hpp @@ -237,6 +237,7 @@ public: static void update_suffix_modified(); static const std::string& suffix_modified(); + static std::string remove_suffix_modified(const std::string& name); static void normalize(DynamicPrintConfig &config); // Report configuration fields, which are misplaced into a wrong group, remove them from the config. static std::string remove_invalid_keys(DynamicPrintConfig &config, const DynamicPrintConfig &default_config); @@ -244,7 +245,6 @@ public: protected: friend class PresetCollection; friend class PresetBundle; - static std::string remove_suffix_modified(const std::string &name); }; bool is_compatible_with_print (const PresetWithVendorProfile &preset, const PresetWithVendorProfile &active_print, const PresetWithVendorProfile &active_printer);