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

@@ -1726,7 +1726,6 @@ void GUI_App::init_networking_callbacks()
obj->command_get_access_code();
if (m_agent)
m_agent->install_device_cert(obj->get_dev_id(), obj->is_lan_mode_printer());
GUI::wxGetApp().sidebar().load_ams_list(obj->get_dev_id(), obj);
}
});
});
@@ -1765,7 +1764,6 @@ void GUI_App::init_networking_callbacks()
obj->command_get_version();
event.SetInt(0);
event.SetString(obj->get_dev_id());
GUI::wxGetApp().sidebar().load_ams_list(obj->get_dev_id(), obj);
} else if (state == ConnectStatus::ConnectStatusFailed) {
// Orca: only update status if same device id
if (m_device_manager->selected_machine != dev_id) return;
@@ -1831,13 +1829,10 @@ void GUI_App::init_networking_callbacks()
auto sel = this->m_device_manager->get_selected_machine();
if (sel && sel->get_dev_id() == dev_id) {
obj->parse_json("cloud", msg);
GUI::wxGetApp().sidebar().load_ams_list(obj);
} else {
obj->parse_json("cloud", msg, true);
}
if (sel == obj || sel == nullptr) {
GUI::wxGetApp().sidebar().load_ams_list(obj->get_dev_id(), obj);
}
}
if (GUI::wxGetApp().plater())
@@ -1881,7 +1876,7 @@ void GUI_App::init_networking_callbacks()
if (MachineObject* obj = m_device_manager->get_my_machine(dev_id)) {
obj->parse_json("lan", msg);
if (this->m_device_manager->get_selected_machine() == obj) {
GUI::wxGetApp().sidebar().load_ams_list(obj->get_dev_id(), obj);
GUI::wxGetApp().sidebar().load_ams_list(obj);
}
}
@@ -3942,7 +3937,6 @@ void GUI_App::request_user_logout()
wxGetApp().check_and_keep_current_preset_changes(_L("User logged out"), header, ActionButtons::KEEP | ActionButtons::SAVE, &transfer_preset_changes);
m_device_manager->clean_user_info();
GUI::wxGetApp().sidebar().load_ams_list({}, {});
remove_user_presets();
enable_user_preset_folder(false);
preset_bundle->load_user_presets(DEFAULT_USER_FOLDER_NAME, ForwardCompatibilitySubstitutionRule::Enable);