ENH: update how to load_ams_list

JIRA: [STUDIO-14255]
Change-Id: I204f881b72185ee16f8ff204feb6469504f9f86b
(cherry picked from commit 4150ff5c178de02dfa67e6bd90765e35c6a64e99)
This commit is contained in:
xin.zhang
2025-09-23 16:29:58 +08:00
committed by Noisyfox
parent 8b640a148e
commit fabc681442
8 changed files with 32 additions and 31 deletions

View File

@@ -3031,7 +3031,6 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event)
}
// Has changed machine unrecoverably
GUI::wxGetApp().sidebar().load_ams_list(obj->get_dev_id(), obj);
m_check_flag = false;
} else {
BOOST_LOG_TRIVIAL(error) << "on_selection_changed dev_id not found";
@@ -4522,6 +4521,13 @@ bool SelectMachineDialog::Show(bool show)
EnableEditing(true);
m_options_other->Show();
m_refresh_timer->Start(LIST_REFRESH_INTERVAL);
//set a default machine when obj is null
if (DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager()) {
if (!dev->get_selected_machine()) {
dev->load_last_machine();
}
};
} else {
m_refresh_timer->Stop();
return DPIDialog::Show(false);