FIX: remove legacy MQTT optimizations; disconnect previous printer on switch

jira: STUDIO-13455

Change-Id: I88f48801f443b3830fbd2bccbc53577f615e6d96
(cherry picked from commit 562ac1a3e7e75e1cab5e42ab09cec719bf698184)
(cherry picked from commit 5143086c5efb4d974e27ba4f55bd82752ded0a93)
This commit is contained in:
haolin.tian
2025-07-25 14:46:33 +08:00
committed by Noisyfox
parent d05420615b
commit e17c8bfb80
7 changed files with 20 additions and 106 deletions

View File

@@ -1697,13 +1697,6 @@ void GUI_App::init_networking_callbacks()
MachineObject *obj = dev->get_selected_machine();
if (!obj) return;
if (obj->nt_try_local_tunnel && obj->connection_type() == "cloud") {
if (obj->is_connected()) {
obj->disconnect();
}
obj->nt_reset_data();
}
/* resubscribe the cache dev list */
if (this->is_enable_multi_machine()) {
@@ -1776,7 +1769,7 @@ void GUI_App::init_networking_callbacks()
} else if (state == ConnectStatus::ConnectStatusFailed) {
// Orca: avoid showing same error message multiple times until next connection attempt.
const auto already_disconnected = m_device_manager->selected_machine.empty();
m_device_manager->set_selected_machine("", true);
m_device_manager->set_selected_machine("");
if (!already_disconnected) {
wxString text;
if (msg == "5") {
@@ -1791,7 +1784,7 @@ void GUI_App::init_networking_callbacks()
}
event.SetInt(-1);
} else if (state == ConnectStatus::ConnectStatusLost) {
m_device_manager->set_selected_machine("", true);
m_device_manager->set_selected_machine("");
event.SetInt(-1);
BOOST_LOG_TRIVIAL(info) << "set_on_local_connect_fn: state = lost";
} else {