Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2019-08-20 19:45:12 +0300
committerYuSanka <yusanka@gmail.com>2019-08-20 19:45:12 +0300
commit18d3792d3759f7a72a60530bafcb22154b25857b (patch)
tree332573291a3052cd861c071b396b364e8b9a09d7 /src/slic3r/GUI/PresetBundle.cpp
parent448d773da0e6d9ee31448d8a8817971269f59d7f (diff)
Fixed a slack bug with wrong filament preset selection after importing of config
Diffstat (limited to 'src/slic3r/GUI/PresetBundle.cpp')
-rw-r--r--src/slic3r/GUI/PresetBundle.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp
index 7c9f7af4e..3aee71c4c 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<std::string>(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).