mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -06:00
ENH:disconnect lan mode printer when switing other printers
Change-Id: Ibd2d80e248b8a25a103cec75fdc9cd11b84e8b48
This commit is contained in:
parent
fdd659cefe
commit
ede8a2dc30
3 changed files with 4 additions and 4 deletions
|
@ -3956,7 +3956,7 @@ void DeviceManager::clean_user_info()
|
|||
userMachineList.clear();
|
||||
}
|
||||
|
||||
bool DeviceManager::set_selected_machine(std::string dev_id)
|
||||
bool DeviceManager::set_selected_machine(std::string dev_id, bool need_disconnect)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "set_selected_machine=" << dev_id;
|
||||
auto my_machine_list = get_my_machine_list();
|
||||
|
@ -3966,7 +3966,7 @@ bool DeviceManager::set_selected_machine(std::string dev_id)
|
|||
auto last_selected = my_machine_list.find(selected_machine);
|
||||
if (last_selected != my_machine_list.end()) {
|
||||
if (last_selected->second->connection_type() == "lan") {
|
||||
if (last_selected->second->is_connecting())
|
||||
if (last_selected->second->is_connecting() && !need_disconnect)
|
||||
return false;
|
||||
m_agent->disconnect_printer();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue