FIX: [STUDIO-1525] not switch preset after cancel edit dialog

Change-Id: I91810298da40250e3c5def72737b2be6df764a3b
This commit is contained in:
chunmao.guo 2022-12-02 10:49:31 +08:00 committed by Lane.Wei
parent 50a5f8bddf
commit 5a6263c9f3
8 changed files with 29 additions and 14 deletions

View file

@ -773,11 +773,11 @@ void PlaterPresetComboBox::OnSelect(wxCommandEvent &evt)
evt.Skip();
}
void PlaterPresetComboBox::switch_to_tab()
bool PlaterPresetComboBox::switch_to_tab()
{
Tab* tab = wxGetApp().get_tab(m_type);
if (!tab)
return;
return false;
//BBS Select NoteBook Tab params
if (tab->GetParent() == wxGetApp().params_panel())
@ -793,8 +793,12 @@ void PlaterPresetComboBox::switch_to_tab()
if (!boost::algorithm::starts_with(selected_preset, Preset::suffix_modified()))
{
const std::string& preset_name = wxGetApp().preset_bundle->filaments.get_preset_name_by_alias(selected_preset);
wxGetApp().get_tab(m_type)->select_preset(preset_name);
wxGetApp().get_tab(m_type)->get_combo_box()->set_filament_idx(m_filament_idx);
if (wxGetApp().get_tab(m_type)->select_preset(preset_name))
wxGetApp().get_tab(m_type)->get_combo_box()->set_filament_idx(m_filament_idx);
else {
wxGetApp().params_dialog()->Hide();
return false;
}
}
}
@ -819,6 +823,8 @@ void PlaterPresetComboBox::switch_to_tab()
}
}
*/
return true;
}
void PlaterPresetComboBox::change_extruder_color()