Fix an issue that sync ams btn is not show/hide after printer agent changes

This commit is contained in:
SoftFever
2026-02-02 12:20:09 +08:00
parent 86421c6378
commit d817a4d5d4
2 changed files with 16 additions and 8 deletions

View File

@@ -820,8 +820,13 @@ void PhysicalPrinterDialog::check_host_key_valid()
void PhysicalPrinterDialog::OnOK(wxEvent& event)
{
wxGetApp().get_tab(Preset::TYPE_PRINTER)->save_preset("", false, false, true, m_preset_name );
wxGetApp().get_tab(Preset::TYPE_PRINTER)->save_preset("", false, false, true, m_preset_name);
event.Skip();
// Defer printer agent switch to ensure preset save completes first
wxGetApp().CallAfter([] {
wxGetApp().switch_printer_agent();
});
}
}} // namespace Slic3r::GUI