mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 17:58:03 -06:00
Show preset_tree according to preset inheritance
This commit is contained in:
parent
affaeef2ab
commit
674ddcd73a
4 changed files with 65 additions and 15 deletions
|
@ -417,6 +417,16 @@ const Preset* PresetCollection::get_selected_preset_parent() const
|
|||
return (preset == nullptr || preset->is_default || preset->is_external) ? nullptr : preset;
|
||||
}
|
||||
|
||||
const Preset* PresetCollection::get_preset_parent(const Preset& child) const
|
||||
{
|
||||
auto *inherits = dynamic_cast<const ConfigOptionString*>(child.config.option("inherits"));
|
||||
if (inherits == nullptr || inherits->value.empty())
|
||||
// return this->get_selected_preset().is_system ? &this->get_selected_preset() : nullptr;
|
||||
return nullptr;
|
||||
const Preset* preset = this->find_preset(inherits->value, false);
|
||||
return (preset == nullptr/* || preset->is_default */|| preset->is_external) ? nullptr : preset;
|
||||
}
|
||||
|
||||
const std::string& PresetCollection::get_suffix_modified() {
|
||||
return g_suffix_modified;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue