Fixed function to get a profile name by alias for all preset collections

This commit is contained in:
YuSanka 2019-11-29 11:02:30 +01:00
parent 71f5ed5b9e
commit 22aa17128a
6 changed files with 24 additions and 6 deletions

View file

@ -3372,10 +3372,10 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
//! combo->GetStringSelection().ToUTF8().data());
const std::string& selected_string = combo->GetString(combo->GetSelection()).ToUTF8().data();
const std::string preset_name = wxGetApp().preset_bundle->filaments.get_preset_name_by_alias(selected_string);
const std::string preset_name = wxGetApp().preset_bundle->get_preset_name_by_alias(preset_type, selected_string);
if (preset_type == Preset::TYPE_FILAMENT) {
wxGetApp().preset_bundle->set_filament_preset(idx, /*selected_string*/preset_name);
wxGetApp().preset_bundle->set_filament_preset(idx, preset_name);
}
// TODO: ?
@ -3385,7 +3385,7 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
}
else {
wxWindowUpdateLocker noUpdates(sidebar->presets_panel());
wxGetApp().get_tab(preset_type)->select_preset(/*selected_string*/preset_name);
wxGetApp().get_tab(preset_type)->select_preset(preset_name);
}
// update plater with new config