diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 23a11a2bb3..dab3de3ab8 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -215,7 +215,6 @@ class CuraApplication(QtApplication): self._message_box_callback = None self._message_box_callback_arguments = [] - self._preferred_mimetype = "" self._i18n_catalog = None self._currently_loading_files = [] @@ -514,9 +513,6 @@ class CuraApplication(QtApplication): self.applicationShuttingDown.connect(self.saveSettings) self.engineCreatedSignal.connect(self._onEngineCreated) - self.globalContainerStackChanged.connect(self._onGlobalContainerChanged) - self._onGlobalContainerChanged() - self.getCuraSceneController().setActiveBuildPlate(0) # Initialize CuraApplication.Created = True @@ -997,30 +993,14 @@ class CuraApplication(QtApplication): self._camera_animation.setTarget(Selection.getSelectedObject(0).getWorldPosition()) self._camera_animation.start() - def _onGlobalContainerChanged(self): - if self._global_container_stack is not None: - machine_file_formats = [file_type.strip() for file_type in self._global_container_stack.getMetaDataEntry("file_formats").split(";")] - new_preferred_mimetype = "" - if machine_file_formats: - new_preferred_mimetype = machine_file_formats[0] - - if new_preferred_mimetype != self._preferred_mimetype: - self._preferred_mimetype = new_preferred_mimetype - self.preferredOutputMimetypeChanged.emit() - requestAddPrinter = pyqtSignal() activityChanged = pyqtSignal() sceneBoundingBoxChanged = pyqtSignal() - preferredOutputMimetypeChanged = pyqtSignal() @pyqtProperty(bool, notify = activityChanged) def platformActivity(self): return self._platform_activity - @pyqtProperty(str, notify=preferredOutputMimetypeChanged) - def preferredOutputMimetype(self): - return self._preferred_mimetype - @pyqtProperty(str, notify = sceneBoundingBoxChanged) def getSceneBoundingBoxString(self): return self._i18n_catalog.i18nc("@info 'width', 'depth' and 'height' are variable names that must NOT be translated; just translate the format of ##x##x## mm.", "%(width).1f x %(depth).1f x %(height).1f mm") % {'width' : self._scene_bounding_box.width.item(), 'depth': self._scene_bounding_box.depth.item(), 'height' : self._scene_bounding_box.height.item()} diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py index dda21f3719..36084b7d4d 100755 --- a/cura/Settings/GlobalStack.py +++ b/cura/Settings/GlobalStack.py @@ -61,6 +61,10 @@ class GlobalStack(CuraContainerStack): name = self.variant.getName() return name + @pyqtProperty(str, constant = True) + def preferred_output_file_formats(self) -> str: + return self.getMetaDataEntry("file_formats") + ## Add an extruder to the list of extruders of this stack. # # \param extruder The extruder to add. diff --git a/plugins/GCodeGzWriter/__init__.py b/plugins/GCodeGzWriter/__init__.py index e257bcb011..95949eee74 100644 --- a/plugins/GCodeGzWriter/__init__.py +++ b/plugins/GCodeGzWriter/__init__.py @@ -16,7 +16,8 @@ def getMetaData(): "extension": file_extension, "description": catalog.i18nc("@item:inlistbox", "Compressed G-code File"), "mime_type": "application/gzip", - "mode": GCodeGzWriter.GCodeGzWriter.OutputMode.BinaryMode + "mode": GCodeGzWriter.GCodeGzWriter.OutputMode.BinaryMode, + "hide_in_file_dialog": True, }] } } diff --git a/resources/qml/SaveButton.qml b/resources/qml/SaveButton.qml index 0e0eec7277..2a0a523026 100644 --- a/resources/qml/SaveButton.qml +++ b/resources/qml/SaveButton.qml @@ -7,6 +7,7 @@ import QtQuick.Controls.Styles 1.1 import QtQuick.Layouts 1.1 import UM 1.1 as UM +import Cura 1.0 as Cura Item { id: base; @@ -257,7 +258,8 @@ Item { onClicked: { forceActiveFocus(); - UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice, PrintInformation.jobName, { "filter_by_machine": true, "preferred_mimetype":Printer.preferredOutputMimetype }); + UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice, PrintInformation.jobName, + { "filter_by_machine": true, "preferred_mimetypes": Cura.MachineManager.activeMachine.preferred_output_file_formats }); } style: ButtonStyle {