Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2022-08-31 11:39:05 +0300
committerJaime van Kessel <nallath@gmail.com>2022-08-31 11:39:05 +0300
commit4c55befad7a835d72138c2edc8a23fd3988fb462 (patch)
tree6766f88bdf44c3162be2919ad832aa935ff91c5a /cura/Machines
parentb9e8bca01298ecc7f1708ea811f2eb6eb929895e (diff)
parentd20a83d9aa6d8120b11505799f45a1199bd089c0 (diff)
Merge branch 'main' of github.com:Ultimaker/Cura into CURA-8463_cloud_configuration
Diffstat (limited to 'cura/Machines')
-rw-r--r--cura/Machines/Models/MachineListModel.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/cura/Machines/Models/MachineListModel.py b/cura/Machines/Models/MachineListModel.py
index b3e3bd4f71..323848697d 100644
--- a/cura/Machines/Models/MachineListModel.py
+++ b/cura/Machines/Models/MachineListModel.py
@@ -11,6 +11,7 @@ from UM.Qt.ListModel import ListModel
from UM.Settings.ContainerStack import ContainerStack
from UM.i18n import i18nCatalog
from UM.Util import parseBool
+from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
from cura.Settings.GlobalStack import GlobalStack
@@ -91,10 +92,17 @@ class MachineListModel(ListModel):
if parseBool(container_stack.getMetaDataEntry("hidden", False)):
return
+ # 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
+ has_connection |= parseBool(container_stack.getMetaDataEntry("is_abstract_machine", False))
+ for connection_type in [ConnectionType.NetworkConnection.value, ConnectionType.CloudConnection.value]:
+ has_connection |= connection_type in container_stack.configuredConnectionTypes
+
self.appendItem({"name": container_stack.getName(),
"id": container_stack.getId(),
"metadata": container_stack.getMetaData().copy(),
- "isOnline": parseBool(container_stack.getMetaDataEntry("is_online", False)),
+ "isOnline": parseBool(container_stack.getMetaDataEntry("is_online", False)) and has_connection,
"isAbstractMachine": parseBool(container_stack.getMetaDataEntry("is_abstract_machine", False)),
"machineCount": machine_count,
})