FIX: move network hold to MainFrame

jira: [STUDIO-10994]
Change-Id: I2c30ba3b0f17d52079332634a9a2dd138859e083
(cherry picked from commit 506e82cb02a79d97a30effde53fe85c7d278858c)
This commit is contained in:
xin.zhang
2025-03-20 15:10:29 +08:00
committed by Noisyfox
parent c0c7d90845
commit 68741d019c
9 changed files with 93 additions and 64 deletions

View File

@@ -341,38 +341,9 @@ void MonitorPanel::update_all()
{
NetworkAgent* m_agent = wxGetApp().getAgent();
Slic3r::DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
if (!dev)
return;
if (!dev) return;
obj = dev->get_selected_machine();
// check valid machine
if (obj && dev->get_my_machine(obj->dev_id) == nullptr) {
dev->set_selected_machine("");
if (m_agent)
m_agent->set_user_selected_machine("");
show_status((int)MONITOR_NO_PRINTER);
return;
}
//BBS check mqtt connections if user is login
if (wxGetApp().is_user_login()) {
dev->check_pushing();
// check mqtt connection and reconnect if disconnected
try {
m_agent->refresh_connection();
}
catch (...) {
;
}
}
if (obj) {
wxGetApp().reset_to_active();
if (obj->connection_type() != last_conn_type) {
last_conn_type = obj->connection_type();
}
}
m_status_info_panel->obj = obj;
m_upgrade_panel->update(obj);
m_status_info_panel->m_media_play_ctrl->SetMachineObject(obj);
@@ -387,6 +358,7 @@ void MonitorPanel::update_all()
return;
}
if (obj->connection_type() != last_conn_type) { last_conn_type = obj->connection_type(); }
if (obj->is_connecting()) {
show_status(MONITOR_CONNECTING);
return;