mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06:00
Disable menuItems if they aren't visible
This prevents the shortcuts from breaking
This commit is contained in:
parent
901f6c4b63
commit
288aeec2db
2 changed files with 3 additions and 1 deletions
|
@ -25,6 +25,7 @@ Cura.Menu
|
|||
id: openMenu
|
||||
action: Cura.Actions.open
|
||||
visible: base.fileProviderModel.count == 1
|
||||
enabled: base.fileProviderModel.count == 1
|
||||
}
|
||||
|
||||
OpenFilesMenu
|
||||
|
@ -42,7 +43,7 @@ Cura.Menu
|
|||
shortcut: StandardKey.Save
|
||||
text: catalog.i18nc("@title:menu menubar:file", "&Save Project...")
|
||||
visible: saveProjectMenu.model.count == 1
|
||||
enabled: UM.WorkspaceFileHandler.enabled
|
||||
enabled: UM.WorkspaceFileHandler.enabled && saveProjectMenu.model.count == 1
|
||||
onTriggered:
|
||||
{
|
||||
var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" };
|
||||
|
|
|
@ -41,6 +41,7 @@ Cura.Menu
|
|||
}
|
||||
}
|
||||
shortcut: model.shortcut
|
||||
enabled: saveProjectMenu.shouldBeVisible
|
||||
}
|
||||
onObjectAdded: saveProjectMenu.insertItem(index, object)
|
||||
onObjectRemoved: saveProjectMenu.removeItem(object)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue