mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +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:
|
if other_bb is not None:
|
||||||
scene_bounding_box = scene_bounding_box + node.getBoundingBox()
|
scene_bounding_box = scene_bounding_box + node.getBoundingBox()
|
||||||
|
|
||||||
|
|
||||||
if print_information:
|
if print_information:
|
||||||
print_information.setPreSliced(is_block_slicing_node)
|
print_information.setPreSliced(is_block_slicing_node)
|
||||||
|
|
||||||
|
self.getWorkspaceFileHandler().setEnabled(not is_block_slicing_node)
|
||||||
|
|
||||||
if not scene_bounding_box:
|
if not scene_bounding_box:
|
||||||
scene_bounding_box = AxisAlignedBox.Null
|
scene_bounding_box = AxisAlignedBox.Null
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ Menu
|
|||||||
shortcut: visible ? StandardKey.Save : ""
|
shortcut: visible ? StandardKey.Save : ""
|
||||||
text: catalog.i18nc("@title:menu menubar:file", "&Save Project...")
|
text: catalog.i18nc("@title:menu menubar:file", "&Save Project...")
|
||||||
visible: saveProjectMenu.model.count == 1
|
visible: saveProjectMenu.model.count == 1
|
||||||
|
enabled: UM.WorkspaceFileHandler.enabled
|
||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" };
|
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
|
id: saveProjectMenu
|
||||||
model: projectOutputDevicesModel
|
model: projectOutputDevicesModel
|
||||||
visible: model.count > 1
|
visible: model.count > 1
|
||||||
|
enabled: UM.WorkspaceFileHandler.enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuSeparator { }
|
MenuSeparator { }
|
||||||
|
@ -23,6 +23,11 @@ Menu
|
|||||||
text: model.name
|
text: model.name
|
||||||
onTriggered:
|
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" };
|
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"))
|
if (UM.Preferences.getValue("cura/dialog_on_project_save"))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user