Fixed a Crash on switch printer technology, when "Materials" tab is shown.

+ Fixed Plater selection, when no"Printer" tab is selected and some printer with other technology is installed from Wizard

(SPE-2459)
This commit is contained in:
YuSanka 2024-08-26 21:02:30 +02:00 committed by Lukas Matena
parent 016103dd95
commit 6782922d8b
2 changed files with 9 additions and 3 deletions

View File

@ -3308,6 +3308,13 @@ bool GUI_App::run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage
if (res) {
load_current_presets();
for (Tab* tab : tabs_list) {
if (tab->type() == Preset::TYPE_PRINTER) {
if (!tab->IsShown())
mainframe->select_tab(size_t(0));
break;
}
}
// #ysFIXME - delete after testing: This part of code looks redundant. All checks are inside ConfigWizard::priv::apply_config()
if (preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA)
may_switch_to_SLA_preset(_L("Configuration is editing from ConfigWizard"));

View File

@ -5548,9 +5548,8 @@ void TabSLAMaterial::update()
void TabSLAMaterial::update_description_lines()
{
if (m_active_page && m_active_page->title() == "Material" && m_z_correction_to_mm_description) {
auto cfg = m_preset_bundle->full_config();
double lh = cfg.opt_float("layer_height");
int zlayers = cfg.opt_int("zcorrection_layers");
double lh = m_preset_bundle->sla_prints.get_edited_preset().config.opt_float("layer_height");
int zlayers = m_config->opt_int("zcorrection_layers");
m_z_correction_to_mm_description->SetText(GUI::format_wxstr(_L("The current Z-axis height correction is: %1% mm"), zlayers * lh));
}