diff options
author | Konstantinos Karmas <konskarm@gmail.com> | 2021-10-05 12:42:00 +0300 |
---|---|---|
committer | Konstantinos Karmas <konskarm@gmail.com> | 2021-10-05 12:42:00 +0300 |
commit | 8157cedfefa7232e7dd5cac4b9a200c05d805be9 (patch) | |
tree | c5845cf6368a911e7de3b5787e3edebdc47823ff /cura/Machines | |
parent | 658e54c8e513366434aa8b5a8840ed92968b8d4a (diff) |
Show the message only if there are printers that support material export
If none of the user's printers support exporting materials to it, then the message should not be shown.
CURA-8254
Diffstat (limited to 'cura/Machines')
-rw-r--r-- | cura/Machines/Models/MaterialManagementModel.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cura/Machines/Models/MaterialManagementModel.py b/cura/Machines/Models/MaterialManagementModel.py index 468d28709b..5d56fb73ca 100644 --- a/cura/Machines/Models/MaterialManagementModel.py +++ b/cura/Machines/Models/MaterialManagementModel.py @@ -73,7 +73,10 @@ class MaterialManagementModel(QObject): button_style = Message.ActionButtonStyle.LINK ) sync_materials_message.actionTriggered.connect(self._onSyncMaterialsMessageActionTriggered) - sync_materials_message.show() + container_registry = cura.CuraApplication.CuraApplication.getInstance().getContainerRegistry() + global_stacks = container_registry.findContainerStacks(type = "machine") + if any([stack.supportsMaterialExport for stack in global_stacks]): + sync_materials_message.show() def _onSyncMaterialsMessageActionTriggered(self, sync_message: Optional[Message], sync_message_action: Optional[str]): if sync_message_action == "sync": |