Fix of switching the default print / filament / sla print / sla material

profiles after switching the technology from FFF to SLA and vice versa.
The solution is to keep the print / filament / sla print / sla material
settings undefined until the particular technology is activated for
the first time. Then the settings name persists indefinitely even
if all the printes for that particular printer technology are deleted.
This commit is contained in:
bubnikv 2019-05-15 17:15:52 +02:00
parent f029ed8fe1
commit 79fe6b9db3
3 changed files with 28 additions and 35 deletions

View file

@ -820,6 +820,9 @@ void PresetCollection::load_bitmap_add(wxWindow *window, const std::string &file
const Preset* PresetCollection::get_selected_preset_parent() const
{
if (this->get_selected_idx() == -1)
// This preset collection has no preset activated yet. Only the get_edited_preset() is valid.
return nullptr;
const std::string &inherits = this->get_edited_preset().inherits();
if (inherits.empty())
return this->get_selected_preset().is_system ? &this->get_selected_preset() : nullptr;