diff options
author | bubnikv <bubnikv@gmail.com> | 2018-06-26 12:31:01 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-06-26 12:31:01 +0300 |
commit | 59510c42d1b2e03a9d08dedc5d330801f12e269a (patch) | |
tree | 2e1537a775b3ca3f65f2861f57094c58b71f645e /xs/src/slic3r/GUI/PresetBundle.cpp | |
parent | 1175dc95f688a8b17e75a7cdf5ef1b472905bede (diff) |
When loading an archive (AMF/3MF/Config), the original name
of the profile is show in braces next to the file name.
Diffstat (limited to 'xs/src/slic3r/GUI/PresetBundle.cpp')
-rw-r--r-- | xs/src/slic3r/GUI/PresetBundle.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/xs/src/slic3r/GUI/PresetBundle.cpp b/xs/src/slic3r/GUI/PresetBundle.cpp index 147975f16..fcf8ce859 100644 --- a/xs/src/slic3r/GUI/PresetBundle.cpp +++ b/xs/src/slic3r/GUI/PresetBundle.cpp @@ -618,21 +618,26 @@ 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) { - char suffix[64]; - if (i == 0) - suffix[0] = 0; - else - sprintf(suffix, " (%d)", i); - std::string new_name = name + suffix; // Load all filament presets, but only select the first one in the preset dialog. + Preset *loaded = nullptr; if (is_external) - this->filaments.load_external_preset(name_or_path, new_name, + loaded = &this->filaments.load_external_preset(name_or_path, name, (i < old_filament_profile_names->values.size()) ? old_filament_profile_names->values[i] : "", std::move(configs[i]), i == 0); - else - this->filaments.load_preset(this->filaments.path_from_name(new_name), - new_name, std::move(configs[i]), i == 0).save(); - this->filament_presets.emplace_back(new_name); + else { + // Used by the config wizard when creating a custom setup. + // Therefore this block should only be called for a single extruder. + char suffix[64]; + if (i == 0) + suffix[0] = 0; + else + sprintf(suffix, "%d", i); + std::string new_name = name + suffix; + loaded = &this->filaments.load_preset(this->filaments.path_from_name(new_name), + new_name, std::move(configs[i]), i == 0); + loaded->save(); + } + this->filament_presets.emplace_back(loaded->name); } } |