mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
Automatically connect local machine when switch to device tab
This commit is contained in:
@@ -5934,8 +5934,13 @@ std::map<std::string ,MachineObject*> DeviceManager::get_local_machine_list()
|
|||||||
|
|
||||||
void DeviceManager::load_last_machine()
|
void DeviceManager::load_last_machine()
|
||||||
{
|
{
|
||||||
if (userMachineList.empty()) return;
|
if (userMachineList.empty()) {
|
||||||
|
// Orca: connect LAN printers instead
|
||||||
|
const auto local_machine = std::find_if(localMachineList.begin(), localMachineList.end(), [](const std::pair<std::string, MachineObject*>& it) -> bool { return it.second->has_access_right();});
|
||||||
|
if (local_machine != localMachineList.end()) {
|
||||||
|
this->set_selected_machine(local_machine->second->dev_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (userMachineList.size() == 1) {
|
else if (userMachineList.size() == 1) {
|
||||||
this->set_selected_machine(userMachineList.begin()->second->dev_id);
|
this->set_selected_machine(userMachineList.begin()->second->dev_id);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user