mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
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:
parent
658e54c8e5
commit
8157cedfef
1 changed files with 4 additions and 1 deletions
|
@ -73,7 +73,10 @@ class MaterialManagementModel(QObject):
|
||||||
button_style = Message.ActionButtonStyle.LINK
|
button_style = Message.ActionButtonStyle.LINK
|
||||||
)
|
)
|
||||||
sync_materials_message.actionTriggered.connect(self._onSyncMaterialsMessageActionTriggered)
|
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]):
|
def _onSyncMaterialsMessageActionTriggered(self, sync_message: Optional[Message], sync_message_action: Optional[str]):
|
||||||
if sync_message_action == "sync":
|
if sync_message_action == "sync":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue