FIX: [STUDIO-1574] not switch filament preset after wizard

Change-Id: Ica703553a6994456f12b509564443902697ed374
This commit is contained in:
chunmao.guo 2022-12-05 11:24:12 +08:00 committed by Lane.Wei
parent f49c4c7e4c
commit 8cee81b5ef
5 changed files with 16 additions and 43 deletions

View file

@ -703,7 +703,7 @@ Sidebar::Sidebar(Plater *parent)
(project_config.option<ConfigOptionFloat>("flush_multiplier"))->set(new ConfigOptionFloat(dlg.get_flush_multiplier()));
wxGetApp().app_config->set("flush_multiplier", std::to_string(dlg.get_flush_multiplier()));
wxGetApp().preset_bundle->update_filament_info_to_app_config(*wxGetApp().app_config);
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
wxGetApp().plater()->update_project_dirty_from_presets();
wxPostEvent(parent, SimpleEvent(EVT_SCHEDULE_BACKGROUND_PROCESS, parent));
@ -726,7 +726,7 @@ Sidebar::Sidebar(Plater *parent)
wxGetApp().preset_bundle->set_num_filaments(filament_count, new_color);
wxGetApp().plater()->on_filaments_change(filament_count);
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
wxGetApp().preset_bundle->update_filament_info_to_app_config(*wxGetApp().app_config);
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
});
p->m_bpButton_add_filament = add_btn;
@ -751,7 +751,7 @@ Sidebar::Sidebar(Plater *parent)
wxGetApp().preset_bundle->set_num_filaments(filament_count);
wxGetApp().plater()->on_filaments_change(filament_count);
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
wxGetApp().preset_bundle->update_filament_info_to_app_config(*wxGetApp().app_config);
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
});
p->m_bpButton_del_filament = del_btn;
@ -1352,7 +1352,7 @@ void Sidebar::sync_ams_list()
for (auto &c : p->combos_filament)
c->update();
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
wxGetApp().preset_bundle->update_filament_info_to_app_config(*wxGetApp().app_config);
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
}
ObjectList* Sidebar::obj_list()
@ -5382,7 +5382,7 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
if (preset_type == Preset::TYPE_FILAMENT) {
wxGetApp().preset_bundle->set_filament_preset(idx, preset_name);
wxGetApp().plater()->update_project_dirty_from_presets();
wxGetApp().preset_bundle->update_filament_info_to_app_config(*wxGetApp().app_config);
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
}
bool select_preset = !combo->selection_is_changed_according_to_physical_printers();
@ -7376,7 +7376,7 @@ void Plater::load_project(wxString const& filename2,
reset_project_dirty_initial_presets();
update_project_dirty_from_presets();
wxGetApp().preset_bundle->update_filament_info_to_app_config(*wxGetApp().app_config);
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
// if res is empty no data has been loaded
if (!res.empty() && (load_restore || !(strategy & LoadStrategy::Silence))) {