diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index e0a272f082..6f619ec8eb 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -4110,7 +4110,8 @@ bool DeviceManager::set_selected_machine(std::string dev_id, bool need_disconnec if (last_selected->second->connection_type() == "lan") { if (last_selected->second->is_connecting() && !need_disconnect) return false; - m_agent->disconnect_printer(); + + if (!need_disconnect) {m_agent->disconnect_printer();} } } @@ -4124,7 +4125,7 @@ bool DeviceManager::set_selected_machine(std::string dev_id, bool need_disconnec } else { // lan mode printer reconnect printer if (m_agent) { - m_agent->disconnect_printer(); + if (!need_disconnect) {m_agent->disconnect_printer();} it->second->reset(); it->second->connect(); it->second->set_lan_mode_connection_state(true); diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 5efdc62c7c..7ec78315e9 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1876,7 +1876,7 @@ void GUI_App::init_networking_callbacks() } else if (state == ConnectStatus::ConnectStatusFailed) { obj->set_access_code(""); obj->set_user_access_code(""); - m_device_manager->set_selected_machine(""); + m_device_manager->set_selected_machine("", true); wxString text; if (msg == "5") { text = wxString::Format(_L("Incorrect password")); @@ -1887,7 +1887,7 @@ void GUI_App::init_networking_callbacks() } event.SetInt(0); } else if (state == ConnectStatus::ConnectStatusLost) { - m_device_manager->set_selected_machine(""); + m_device_manager->set_selected_machine("", true); event.SetInt(0); BOOST_LOG_TRIVIAL(info) << "set_on_local_connect_fn: state = lost"; } else {