Reworked filaments / SLA materials in installation wizard:

1) When the wizard is initialized, filament and SLA profile names
   are verified and current names of renamed profiles are resolved.
   Fixes "Add/Remove Filaments is not hiding all of the un-checked filaments #3835"
2) When adding a printer model, default materials are installed in case
   the printer model has no default material installed.
3) When leaving the Filaments or SLA materials page, and some printer models
   have no material installed, those Printer Models are listed
   in a message box and only for those printer models the default
   materials are installed.
This commit is contained in:
bubnikv 2020-03-14 18:35:42 +01:00
parent fcb04039e8
commit a3ded8fa95
5 changed files with 149 additions and 87 deletions

View file

@ -381,7 +381,7 @@ void Preset::set_visible_from_appconfig(const AppConfig &app_config)
return;
is_visible = app_config.get_variant(vendor->id, model, variant);
} else if (type == TYPE_FILAMENT || type == TYPE_SLA_MATERIAL) {
const char *section_name = (type == TYPE_FILAMENT) ? "filaments" : "sla_materials";
const std::string &section_name = (type == TYPE_FILAMENT) ? AppConfig::SECTION_FILAMENTS : AppConfig::SECTION_MATERIALS;
if (app_config.has_section(section_name)) {
// Check whether this profile is marked as "installed" in PrusaSlicer.ini,
// or whether a profile is marked as "installed", which this profile may have been renamed from.
@ -1032,6 +1032,14 @@ const std::string& PresetCollection::get_preset_name_by_alias(const std::string&
return alias;
}
const std::string* PresetCollection::get_preset_name_renamed(const std::string &old_name) const
{
auto it_renamed = m_map_system_profile_renamed.find(old_name);
if (it_renamed != m_map_system_profile_renamed.end())
return &it_renamed->second;
return nullptr;
}
const std::string& PresetCollection::get_suffix_modified() {
return g_suffix_modified;
}