Add copy, paste, cut functionality

CURA-7913
This commit is contained in:
c.lamboo 2023-08-04 13:24:06 +02:00
parent f71f39f8bd
commit f07faac422
3 changed files with 101 additions and 4 deletions

View file

@ -1,4 +1,4 @@
// Copyright (c) 2022 UltiMaker
// Copyright (c) 2023 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
pragma Singleton
@ -71,6 +71,10 @@ Item
property alias browsePackages: browsePackagesAction
property alias paste: pasteAction
property alias copy: copyAction
property alias cut: cutAction
UM.I18nCatalog{id: catalog; name: "cura"}
@ -309,6 +313,33 @@ Item
onTriggered: CuraActions.centerSelection()
}
Action
{
id: copyAction
text: catalog.i18nc("@action:inmenu menubar:edit", "Copy to clipboard")
onTriggered: CuraActions.copy()
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
shortcut: StandardKey.Copy
}
Action
{
id: pasteAction
text: catalog.i18nc("@action:inmenu menubar:edit", "Paste from clipboard")
onTriggered: CuraActions.paste()
enabled: UM.Controller.toolsEnabled
shortcut: StandardKey.Paste
}
Action
{
id: cutAction
text: catalog.i18nc("@action:inmenu menubar:edit", "Cut")
onTriggered: CuraActions.cut()
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
shortcut: StandardKey.Cut
}
Action
{
id: multiplySelectionAction