mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 10:47:50 -06:00
Purging volumes button is only shown when the wipe tower is enabled and we have single extruder MM printer with more than one extruder
This commit is contained in:
parent
706dd7020f
commit
6af45362ce
2 changed files with 23 additions and 10 deletions
|
@ -335,15 +335,28 @@ void Tab::on_value_change(std::string opt_key, boost::any value)
|
||||||
bool val = m_config->opt_float("brim_width") > 0.0 ? true : false;
|
bool val = m_config->opt_float("brim_width") > 0.0 ? true : false;
|
||||||
get_optgroup()->set_value("brim", val);
|
get_optgroup()->set_value("brim", val);
|
||||||
}
|
}
|
||||||
if (opt_key == "wipe_tower"){
|
|
||||||
m_config->opt_bool("wipe_tower") ?
|
if (opt_key == "wipe_tower" || opt_key == "single_extruder_multi_material" || opt_key == "extruders_count" )
|
||||||
get_wiping_dialog_button()->Show() :
|
update_wiping_button_visibility();
|
||||||
get_wiping_dialog_button()->Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Show/hide the 'purging volumes' button
|
||||||
|
void Tab::update_wiping_button_visibility() {
|
||||||
|
bool wipe_tower_enabled = dynamic_cast<ConfigOptionBool*>( (m_preset_bundle->prints.get_edited_preset().config ).option("wipe_tower"))->value;
|
||||||
|
bool multiple_extruders = dynamic_cast<ConfigOptionFloats*>((m_preset_bundle->printers.get_edited_preset().config).option("nozzle_diameter"))->values.size() > 1;
|
||||||
|
bool single_extruder_mm = dynamic_cast<ConfigOptionBool*>( (m_preset_bundle->printers.get_edited_preset().config).option("single_extruder_multi_material"))->value;
|
||||||
|
|
||||||
|
if (wipe_tower_enabled && multiple_extruders && single_extruder_mm)
|
||||||
|
get_wiping_dialog_button()->Show();
|
||||||
|
else get_wiping_dialog_button()->Hide();
|
||||||
|
|
||||||
|
(get_wiping_dialog_button()->GetParent())->Layout();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Call a callback to update the selection of presets on the platter:
|
// Call a callback to update the selection of presets on the platter:
|
||||||
// To update the content of the selection boxes,
|
// To update the content of the selection boxes,
|
||||||
// to update the filament colors of the selection boxes,
|
// to update the filament colors of the selection boxes,
|
||||||
|
@ -373,10 +386,7 @@ void Tab::update_frequently_changed_parameters()
|
||||||
bool val = m_config->opt_float("brim_width") > 0.0 ? true : false;
|
bool val = m_config->opt_float("brim_width") > 0.0 ? true : false;
|
||||||
get_optgroup()->set_value("brim", val);
|
get_optgroup()->set_value("brim", val);
|
||||||
|
|
||||||
m_config->opt_bool("wipe_tower") ?
|
update_wiping_button_visibility();
|
||||||
get_wiping_dialog_button()->Show() :
|
|
||||||
get_wiping_dialog_button()->Hide();
|
|
||||||
(get_wiping_dialog_button()->GetParent())->Layout();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tab::reload_compatible_printers_widget()
|
void Tab::reload_compatible_printers_widget()
|
||||||
|
@ -1062,6 +1072,8 @@ void TabPrinter::build()
|
||||||
if (opt_key.compare("extruders_count")==0 || opt_key.compare("single_extruder_multi_material")==0) {
|
if (opt_key.compare("extruders_count")==0 || opt_key.compare("single_extruder_multi_material")==0) {
|
||||||
extruders_count_changed(extruders_count);
|
extruders_count_changed(extruders_count);
|
||||||
update_dirty();
|
update_dirty();
|
||||||
|
if (opt_key.compare("single_extruder_multi_material")==0) // the single_extruder_multimaterial was added to force pages
|
||||||
|
on_value_change(opt_key, value); // rebuild - let's make sure the on_value_change is not skipped
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
update_dirty();
|
update_dirty();
|
||||||
|
|
|
@ -174,6 +174,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
void on_presets_changed();
|
void on_presets_changed();
|
||||||
void update_frequently_changed_parameters();
|
void update_frequently_changed_parameters();
|
||||||
|
void update_wiping_button_visibility();
|
||||||
};
|
};
|
||||||
|
|
||||||
//Slic3r::GUI::Tab::Print;
|
//Slic3r::GUI::Tab::Print;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue