Follow-up of 86d7e1fb90 -> Fixed update after switching tab after editing custom g-code in settings tabs

This commit is contained in:
enricoturri1966 2021-03-01 13:03:43 +01:00
parent 224f3e506c
commit 908c48ae6a
2 changed files with 30 additions and 11 deletions

View file

@ -549,9 +549,8 @@ void MainFrame::init_tabpanel()
wxWindow* panel = m_tabpanel->GetCurrentPage();
if (panel != nullptr) {
Tab* tab = dynamic_cast<Tab*>(panel);
if (tab && (tab->type() == Preset::TYPE_FILAMENT || tab->type() == Preset::TYPE_PRINTER))
if (!tab->validate_custom_gcodes())
evt.Veto();
if (tab != nullptr && !tab->validate_custom_gcodes())
evt.Veto();
}
});
#endif // ENABLE_VALIDATE_CUSTOM_GCODE