mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-01 20:00:40 +08:00
Fix for #12005 - 2.7.1: One particular .3mf project crashes when changing printer from XL to MK4
Follow-up 23ffd344: Note, that crash was caused by missing update of the active extruder.
This commit is contained in:
parent
540b800a5c
commit
c7fa6b0f73
@ -502,7 +502,7 @@ void Tab::OnActivate()
|
|||||||
update_btns_enabling();
|
update_btns_enabling();
|
||||||
m_btn_hide_incompatible_presets->Show(m_show_btn_incompatible_presets && m_type != Slic3r::Preset::TYPE_PRINTER);
|
m_btn_hide_incompatible_presets->Show(m_show_btn_incompatible_presets && m_type != Slic3r::Preset::TYPE_PRINTER);
|
||||||
if (TabFilament* tab = dynamic_cast<TabFilament*>(this))
|
if (TabFilament* tab = dynamic_cast<TabFilament*>(this))
|
||||||
tab->update_extruder_combobox();
|
tab->update_extruder_combobox_visibility();
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
@ -2104,15 +2104,16 @@ void TabFilament::create_extruder_combobox()
|
|||||||
m_h_buttons_sizer->Add(m_extruders_cb, 0, wxALIGN_CENTER_VERTICAL);
|
m_h_buttons_sizer->Add(m_extruders_cb, 0, wxALIGN_CENTER_VERTICAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabFilament::update_extruder_combobox_visibility()
|
||||||
|
{
|
||||||
|
const size_t extruder_cnt = static_cast<const ConfigOptionFloats*>(m_preset_bundle->printers.get_edited_preset().config.option("nozzle_diameter"))->values.size();
|
||||||
|
m_extruders_cb->Show(extruder_cnt > 1);
|
||||||
|
}
|
||||||
|
|
||||||
void TabFilament::update_extruder_combobox()
|
void TabFilament::update_extruder_combobox()
|
||||||
{
|
{
|
||||||
if (!m_presets_choice->IsShown())
|
|
||||||
return; // it will be updated later, on OnActive()
|
|
||||||
|
|
||||||
const size_t extruder_cnt = static_cast<const ConfigOptionFloats*>(m_preset_bundle->printers.get_edited_preset().config.option("nozzle_diameter"))->values.size();
|
const size_t extruder_cnt = static_cast<const ConfigOptionFloats*>(m_preset_bundle->printers.get_edited_preset().config.option("nozzle_diameter"))->values.size();
|
||||||
|
|
||||||
m_extruders_cb->Show(extruder_cnt > 1);
|
|
||||||
|
|
||||||
if (extruder_cnt != m_extruders_cb->GetCount()) {
|
if (extruder_cnt != m_extruders_cb->GetCount()) {
|
||||||
m_extruders_cb->Clear();
|
m_extruders_cb->Clear();
|
||||||
for (size_t id = 1; id <= extruder_cnt; id++)
|
for (size_t id = 1; id <= extruder_cnt; id++)
|
||||||
|
@ -496,6 +496,7 @@ public:
|
|||||||
bool set_active_extruder(int new_selected_extruder);
|
bool set_active_extruder(int new_selected_extruder);
|
||||||
void invalidate_active_extruder() { m_active_extruder = -1; }
|
void invalidate_active_extruder() { m_active_extruder = -1; }
|
||||||
void update_extruder_combobox();
|
void update_extruder_combobox();
|
||||||
|
void update_extruder_combobox_visibility();
|
||||||
int get_active_extruder() const { return m_active_extruder; }
|
int get_active_extruder() const { return m_active_extruder; }
|
||||||
|
|
||||||
const std::string& get_custom_gcode(const t_config_option_key& opt_key) override;
|
const std::string& get_custom_gcode(const t_config_option_key& opt_key) override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user