From 8157cedfefa7232e7dd5cac4b9a200c05d805be9 Mon Sep 17 00:00:00 2001 From: Konstantinos Karmas Date: Tue, 5 Oct 2021 11:42:00 +0200 Subject: [PATCH] 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 --- cura/Machines/Models/MaterialManagementModel.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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":