Skip to content

Commit

Permalink
Merge pull request #19393 from Ultimaker/CURA-11958_fix_autoselect_mb…
Browse files Browse the repository at this point in the history
…ot_format

[CURA-11958] fix auto-select `.makerbot` format
  • Loading branch information
HellAholic authored Jul 26, 2024
2 parents 44ad932 + c8e87b8 commit 931aac2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cura/Settings/GlobalStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ def supportsMaterialExport(self):
"""
return self.getMetaDataEntry("supports_material_export", False)

@pyqtProperty("QVariantList", constant = True)
def getOutputFileFormats(self) -> List[str]:
"""
Which output formats the printer supports.
:return: A list of strings with MIME-types.
"""
all_formats_str = self.getMetaDataEntry("file_formats", "")
return all_formats_str.split(";")

@classmethod
def getLoadingPriority(cls) -> int:
return 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Item
anchors.rightMargin: UM.Theme.getSize("thin_margin").height

enabled: UM.Backend.state == UM.Backend.Done
currentIndex: UM.Backend.state == UM.Backend.Done ? dfFilenameTextfield.text.startsWith("MM")? 1 : 0 : 2
currentIndex: UM.Backend.state == UM.Backend.Done ? (Cura.MachineManager.activeMachine.getOutputFileFormats.includes("application/x-makerbot") ? 1 : 0) : 2

textRole: "text"
valueRole: "value"
Expand Down

0 comments on commit 931aac2

Please sign in to comment.