Automatically connect local machine when switch to device tab
This commit is contained in:
parent
01bc090914
commit
09ee5fbc2c
1 changed files with 7 additions and 2 deletions
|
@ -5934,8 +5934,13 @@ std::map<std::string ,MachineObject*> DeviceManager::get_local_machine_list()
|
|||
|
||||
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) {
|
||||
this->set_selected_machine(userMachineList.begin()->second->dev_id);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue