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
This commit is contained in:
Konstantinos Karmas 2021-10-05 11:42:00 +02:00
parent 658e54c8e5
commit 8157cedfef

View file

@ -73,6 +73,9 @@ class MaterialManagementModel(QObject):
button_style = Message.ActionButtonStyle.LINK
)
sync_materials_message.actionTriggered.connect(self._onSyncMaterialsMessageActionTriggered)
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]):