mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 21:05:56 +08:00
"Printer settings" > "Bed shape" : Fixed an update of the revert buttons status, when custom bed texture and/or model is changed
This commit is contained in:
parent
c36af0e739
commit
31e4a20f6d
@ -597,6 +597,12 @@ void ConfigOptionsGroup::back_to_sys_value(const std::string& opt_key)
|
|||||||
void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config, const std::string& opt_key)
|
void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config, const std::string& opt_key)
|
||||||
{
|
{
|
||||||
boost::any value;
|
boost::any value;
|
||||||
|
if (opt_key == "bed_shape") {
|
||||||
|
for (const std::string& key : {"bed_custom_texture", "bed_custom_model"}) {
|
||||||
|
value = config.opt_string(key);
|
||||||
|
this->change_opt_value(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (opt_key == "extruders_count") {
|
if (opt_key == "extruders_count") {
|
||||||
auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("nozzle_diameter"));
|
auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("nozzle_diameter"));
|
||||||
value = int(nozzle_diameter->values.size());
|
value = int(nozzle_diameter->values.size());
|
||||||
|
@ -593,12 +593,32 @@ void Tab::update_changed_ui()
|
|||||||
const bool deep_compare = (m_type == Slic3r::Preset::TYPE_PRINTER || m_type == Slic3r::Preset::TYPE_SLA_MATERIAL);
|
const bool deep_compare = (m_type == Slic3r::Preset::TYPE_PRINTER || m_type == Slic3r::Preset::TYPE_SLA_MATERIAL);
|
||||||
auto dirty_options = m_presets->current_dirty_options(deep_compare);
|
auto dirty_options = m_presets->current_dirty_options(deep_compare);
|
||||||
auto nonsys_options = m_presets->current_different_from_parent_options(deep_compare);
|
auto nonsys_options = m_presets->current_different_from_parent_options(deep_compare);
|
||||||
if (m_type == Preset::TYPE_PRINTER && static_cast<TabPrinter*>(this)->m_printer_technology == ptFFF) {
|
if (m_type == Preset::TYPE_PRINTER) {
|
||||||
TabPrinter* tab = static_cast<TabPrinter*>(this);
|
{
|
||||||
if (tab->m_initial_extruders_count != tab->m_extruders_count)
|
auto check_bed_custom_options = [](std::vector<std::string>& keys) {
|
||||||
dirty_options.emplace_back("extruders_count");
|
bool was_deleted = false;
|
||||||
if (tab->m_sys_extruders_count != tab->m_extruders_count)
|
for (std::vector<std::string>::iterator it = keys.begin(); it != keys.end(); ) {
|
||||||
nonsys_options.emplace_back("extruders_count");
|
if (*it == "bed_custom_texture" || *it == "bed_custom_model") {
|
||||||
|
it = keys.erase(it);
|
||||||
|
was_deleted = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
if (was_deleted && std::find(keys.begin(), keys.end(), "bed_shape") == keys.end())
|
||||||
|
keys.emplace_back("bed_shape");
|
||||||
|
};
|
||||||
|
check_bed_custom_options(dirty_options);
|
||||||
|
check_bed_custom_options(nonsys_options);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (static_cast<TabPrinter*>(this)->m_printer_technology == ptFFF) {
|
||||||
|
TabPrinter* tab = static_cast<TabPrinter*>(this);
|
||||||
|
if (tab->m_initial_extruders_count != tab->m_extruders_count)
|
||||||
|
dirty_options.emplace_back("extruders_count");
|
||||||
|
if (tab->m_sys_extruders_count != tab->m_extruders_count)
|
||||||
|
nonsys_options.emplace_back("extruders_count");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& it : m_options_list)
|
for (auto& it : m_options_list)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user