mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 03:35:57 +08:00
Merge pull request #4245 from Ultimaker/CURA-5649_hide_gcodegz_in_save_dialog
CURA-5649 Do not show gcode.gz as an option in save file dialog
This commit is contained in:
commit
ff38ee2bed
@ -215,7 +215,6 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
self._message_box_callback = None
|
self._message_box_callback = None
|
||||||
self._message_box_callback_arguments = []
|
self._message_box_callback_arguments = []
|
||||||
self._preferred_mimetype = ""
|
|
||||||
self._i18n_catalog = None
|
self._i18n_catalog = None
|
||||||
|
|
||||||
self._currently_loading_files = []
|
self._currently_loading_files = []
|
||||||
@ -495,9 +494,6 @@ class CuraApplication(QtApplication):
|
|||||||
self.applicationShuttingDown.connect(self.saveSettings)
|
self.applicationShuttingDown.connect(self.saveSettings)
|
||||||
self.engineCreatedSignal.connect(self._onEngineCreated)
|
self.engineCreatedSignal.connect(self._onEngineCreated)
|
||||||
|
|
||||||
self.globalContainerStackChanged.connect(self._onGlobalContainerChanged)
|
|
||||||
self._onGlobalContainerChanged()
|
|
||||||
|
|
||||||
self.getCuraSceneController().setActiveBuildPlate(0) # Initialize
|
self.getCuraSceneController().setActiveBuildPlate(0) # Initialize
|
||||||
|
|
||||||
CuraApplication.Created = True
|
CuraApplication.Created = True
|
||||||
@ -981,30 +977,14 @@ class CuraApplication(QtApplication):
|
|||||||
self._camera_animation.setTarget(Selection.getSelectedObject(0).getWorldPosition())
|
self._camera_animation.setTarget(Selection.getSelectedObject(0).getWorldPosition())
|
||||||
self._camera_animation.start()
|
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()
|
requestAddPrinter = pyqtSignal()
|
||||||
activityChanged = pyqtSignal()
|
activityChanged = pyqtSignal()
|
||||||
sceneBoundingBoxChanged = pyqtSignal()
|
sceneBoundingBoxChanged = pyqtSignal()
|
||||||
preferredOutputMimetypeChanged = pyqtSignal()
|
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = activityChanged)
|
@pyqtProperty(bool, notify = activityChanged)
|
||||||
def platformActivity(self):
|
def platformActivity(self):
|
||||||
return self._platform_activity
|
return self._platform_activity
|
||||||
|
|
||||||
@pyqtProperty(str, notify=preferredOutputMimetypeChanged)
|
|
||||||
def preferredOutputMimetype(self):
|
|
||||||
return self._preferred_mimetype
|
|
||||||
|
|
||||||
@pyqtProperty(str, notify = sceneBoundingBoxChanged)
|
@pyqtProperty(str, notify = sceneBoundingBoxChanged)
|
||||||
def getSceneBoundingBoxString(self):
|
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()}
|
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()}
|
||||||
|
@ -61,6 +61,10 @@ class GlobalStack(CuraContainerStack):
|
|||||||
name = self.variant.getName()
|
name = self.variant.getName()
|
||||||
return name
|
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.
|
## Add an extruder to the list of extruders of this stack.
|
||||||
#
|
#
|
||||||
# \param extruder The extruder to add.
|
# \param extruder The extruder to add.
|
||||||
|
@ -16,7 +16,8 @@ def getMetaData():
|
|||||||
"extension": file_extension,
|
"extension": file_extension,
|
||||||
"description": catalog.i18nc("@item:inlistbox", "Compressed G-code File"),
|
"description": catalog.i18nc("@item:inlistbox", "Compressed G-code File"),
|
||||||
"mime_type": "application/gzip",
|
"mime_type": "application/gzip",
|
||||||
"mode": GCodeGzWriter.GCodeGzWriter.OutputMode.BinaryMode
|
"mode": GCodeGzWriter.GCodeGzWriter.OutputMode.BinaryMode,
|
||||||
|
"hide_in_file_dialog": True,
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ UM.MainWindow
|
|||||||
text: catalog.i18nc("@title:menu menubar:file","&Save...")
|
text: catalog.i18nc("@title:menu menubar:file","&Save...")
|
||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetype": "application/x-curaproject+xml" };
|
var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/x-curaproject+xml" };
|
||||||
if(UM.Preferences.getValue("cura/dialog_on_project_save"))
|
if(UM.Preferences.getValue("cura/dialog_on_project_save"))
|
||||||
{
|
{
|
||||||
saveWorkspaceDialog.args = args;
|
saveWorkspaceDialog.args = args;
|
||||||
@ -142,7 +142,7 @@ UM.MainWindow
|
|||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
var localDeviceId = "local_file";
|
var localDeviceId = "local_file";
|
||||||
UM.OutputDeviceManager.requestWriteToDevice(localDeviceId, PrintInformation.jobName, { "filter_by_machine": false, "preferred_mimetype": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"});
|
UM.OutputDeviceManager.requestWriteToDevice(localDeviceId, PrintInformation.jobName, { "filter_by_machine": false, "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ UM.MainWindow
|
|||||||
text: catalog.i18nc("@action:inmenu menubar:file", "Export Selection...");
|
text: catalog.i18nc("@action:inmenu menubar:file", "Export Selection...");
|
||||||
enabled: UM.Selection.hasSelection;
|
enabled: UM.Selection.hasSelection;
|
||||||
iconName: "document-save-as";
|
iconName: "document-save-as";
|
||||||
onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "preferred_mimetype": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"});
|
onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"});
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuSeparator { }
|
MenuSeparator { }
|
||||||
|
@ -7,6 +7,7 @@ import QtQuick.Controls.Styles 1.1
|
|||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
import UM 1.1 as UM
|
import UM 1.1 as UM
|
||||||
|
import Cura 1.0 as Cura
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: base;
|
id: base;
|
||||||
@ -257,7 +258,8 @@ Item {
|
|||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
forceActiveFocus();
|
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 {
|
style: ButtonStyle {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user