From 18d3792d3759f7a72a60530bafcb22154b25857b Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 20 Aug 2019 18:45:12 +0200 Subject: [PATCH 1/2] Fixed a slack bug with wrong filament preset selection after importing of config --- src/slic3r/GUI/PresetBundle.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp index 7c9f7af4e9..3aee71c4c7 100644 --- a/src/slic3r/GUI/PresetBundle.cpp +++ b/src/slic3r/GUI/PresetBundle.cpp @@ -763,8 +763,11 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool } } // Load the configs into this->filaments and make them active. - this->filament_presets.clear(); - for (size_t i = 0; i < configs.size(); ++ i) { + this->filament_presets = std::vector(configs.size()); + // To avoid incorrect selection of the first filament preset (means a value of Preset->m_idx_selected) + // in a case when next added preset take a place of previosly selected preset, + // we should add presets from last to first + for (int i = (int)configs.size()-1; i >= 0; i--) { DynamicPrintConfig &cfg = configs[i]; // Split the "compatible_printers_condition" and "inherits" from the cummulative vectors to separate filament presets. cfg.opt_string("compatible_printers_condition", true) = compatible_printers_condition_values[i + 1]; @@ -789,7 +792,7 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool new_name, std::move(cfg), i == 0); loaded->save(); } - this->filament_presets.emplace_back(loaded->name); + this->filament_presets[i] = loaded->name; } } // 4) Load the project config values (the per extruder wipe matrix etc). From 6a2265150196a791e493ee16456ecc5ecdd85f6c Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 20 Aug 2019 20:24:37 +0200 Subject: [PATCH 2/2] Fixed a typo preventing compilation on Linux --- src/PrusaSlicer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index a75635ae60..3c0f27f4d8 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -68,7 +68,7 @@ int CLI::run(int argc, char **argv) std::string text = std::string("An error occured while setting up locale.\n") + ( #if !defined(_WIN32) && !defined(__APPLE__) // likely some linux system - "You may need to reconfigure the missing locales, likely by running the \"locale-gen\"" and \"dpkg-reconfigure locales\" commands.\n" + "You may need to reconfigure the missing locales, likely by running the \"locale-gen\" and \"dpkg-reconfigure locales\" commands.\n" #endif SLIC3R_APP_NAME " will now terminate.\n\n") + ex.what(); #if defined(_WIN32) && defined(SLIC3R_GUI)