mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-21 13:19:37 +08:00
Set & use enabled property for saving projects when ufp/gcode is loaded
CURA-8034
This commit is contained in:
parent
2b63fb1081
commit
cc1aadde12
@ -1268,10 +1268,11 @@ class CuraApplication(QtApplication):
|
||||
if other_bb is not None:
|
||||
scene_bounding_box = scene_bounding_box + node.getBoundingBox()
|
||||
|
||||
|
||||
if print_information:
|
||||
print_information.setPreSliced(is_block_slicing_node)
|
||||
|
||||
self.getWorkspaceFileHandler().setEnabled(not is_block_slicing_node)
|
||||
|
||||
if not scene_bounding_box:
|
||||
scene_bounding_box = AxisAlignedBox.Null
|
||||
|
||||
|
@ -40,6 +40,7 @@ Menu
|
||||
shortcut: visible ? StandardKey.Save : ""
|
||||
text: catalog.i18nc("@title:menu menubar:file", "&Save Project...")
|
||||
visible: saveProjectMenu.model.count == 1
|
||||
enabled: UM.WorkspaceFileHandler.enabled
|
||||
onTriggered:
|
||||
{
|
||||
var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" };
|
||||
@ -62,6 +63,7 @@ Menu
|
||||
id: saveProjectMenu
|
||||
model: projectOutputDevicesModel
|
||||
visible: model.count > 1
|
||||
enabled: UM.WorkspaceFileHandler.enabled
|
||||
}
|
||||
|
||||
MenuSeparator { }
|
||||
|
@ -23,6 +23,11 @@ Menu
|
||||
text: model.name
|
||||
onTriggered:
|
||||
{
|
||||
if(!UM.WorkspaceFileHandler.enabled)
|
||||
{
|
||||
// Prevent shortcut triggering if the item is disabled!
|
||||
return
|
||||
}
|
||||
var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" };
|
||||
if (UM.Preferences.getValue("cura/dialog_on_project_save"))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user