mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 06:45:09 -06:00
Merge pull request #9371 from Ultimaker/CURA-8034_Prevent_saving_project_from_presliced_file
Set & use enabled property for saving projects when ufp/gcode is loaded
This commit is contained in:
commit
1459d2c462
3 changed files with 9 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue