diff options
author | c.lamboo <casperlamboo@gmail.com> | 2022-09-06 14:52:10 +0300 |
---|---|---|
committer | c.lamboo <casperlamboo@gmail.com> | 2022-09-06 14:52:10 +0300 |
commit | 148263a06828e6b5669854a6f0feacba7d4bc2ce (patch) | |
tree | 9e74e95650e929f740d60a1a1e034d96cb1186b8 /cura/Machines | |
parent | 6253fb2fdc1340a0c457771c7eb6b44f081a5215 (diff) |
Move `hasNetworkedConnection` to `GlobalStack`
From code review
CURA-9277
Co-authored-by: Joey <j.delarago@ultimaker.com>
Diffstat (limited to 'cura/Machines')
-rw-r--r-- | cura/Machines/Models/MachineListModel.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/cura/Machines/Models/MachineListModel.py b/cura/Machines/Models/MachineListModel.py index 8750da6305..919d593200 100644 --- a/cura/Machines/Models/MachineListModel.py +++ b/cura/Machines/Models/MachineListModel.py @@ -89,15 +89,7 @@ class MachineListModel(ListModel): machines_manager = CuraApplication.getInstance().getMachineManager() online_machine_stacks = machines_manager.getMachinesWithDefinition(definition_id, online_only = True) - def online_machines_has_connection_filter(machine_stack): - # This is required because machines loaded from projects have the is_online="True" but no connection type. - # We want to display them the same way as unconnected printers in this case. - has_connection = False - for connection_type in [ConnectionType.NetworkConnection.value, ConnectionType.CloudConnection.value]: - has_connection |= connection_type in machine_stack.configuredConnectionTypes - return has_connection - - online_machine_stacks = list(filter(online_machines_has_connection_filter, online_machine_stacks)) + online_machine_stacks = list(filter(lambda machine: machine.hasNetworkedConnection(), online_machine_stacks)) other_machine_stacks.remove(abstract_machine) if abstract_machine in online_machine_stacks: |