mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-28 14:07:47 +02:00
Add "Copy" and "Paste" actions in the "Edit" menu
Also add a "Copy Node(s)" option in the nodes' right click menu.
This commit is contained in:
parent
e11452efdb
commit
ede24713d0
2 changed files with 51 additions and 7 deletions
|
@ -104,13 +104,6 @@ Item {
|
||||||
uigraph.removeNodes(uigraph.selectedNodes)
|
uigraph.removeNodes(uigraph.selectedNodes)
|
||||||
if (event.key === Qt.Key_D)
|
if (event.key === Qt.Key_D)
|
||||||
duplicateNode(event.modifiers == Qt.AltModifier)
|
duplicateNode(event.modifiers == Qt.AltModifier)
|
||||||
|
|
||||||
if (event.key === Qt.Key_C)
|
|
||||||
if (event.modifiers == Qt.ControlModifier)
|
|
||||||
copyNodes()
|
|
||||||
if (event.key === Qt.Key_V)
|
|
||||||
if (event.modifiers == Qt.ControlModifier)
|
|
||||||
pasteNodes()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
@ -407,6 +400,11 @@ Item {
|
||||||
onTriggered: Qt.openUrlExternally(Filepath.stringToUrl(nodeMenu.currentNode.internalFolder))
|
onTriggered: Qt.openUrlExternally(Filepath.stringToUrl(nodeMenu.currentNode.internalFolder))
|
||||||
}
|
}
|
||||||
MenuSeparator {}
|
MenuSeparator {}
|
||||||
|
MenuItem {
|
||||||
|
text: "Copy Node(s)"
|
||||||
|
enabled: true
|
||||||
|
onTriggered: copyNodes()
|
||||||
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: "Duplicate Node(s)" + (duplicateFollowingButton.hovered ? " From Here" : "")
|
text: "Duplicate Node(s)" + (duplicateFollowingButton.hovered ? " From Here" : "")
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
@ -393,6 +393,42 @@ ApplicationWindow {
|
||||||
enabled: _reconstruction.undoStack.canRedo && !_reconstruction.undoStack.lockedRedo
|
enabled: _reconstruction.undoStack.canRedo && !_reconstruction.undoStack.lockedRedo
|
||||||
onTriggered: _reconstruction.undoStack.redo()
|
onTriggered: _reconstruction.undoStack.redo()
|
||||||
}
|
}
|
||||||
|
Action {
|
||||||
|
id: copyAction
|
||||||
|
|
||||||
|
property string tooltip: {
|
||||||
|
var s = "Copy selected node"
|
||||||
|
s += (_reconstruction.selectedNodes.count > 1 ? "s (" : " (") + getSelectedNodesName()
|
||||||
|
s += ") to the clipboard"
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
text: "Copy Node" + (_reconstruction.selectedNodes.count > 1 ? "s " : " ")
|
||||||
|
shortcut: "Ctrl+C"
|
||||||
|
enabled: _reconstruction.selectedNodes.count > 0
|
||||||
|
onTriggered: graphEditor.copyNodes()
|
||||||
|
|
||||||
|
function getSelectedNodesName()
|
||||||
|
{
|
||||||
|
var nodesName = ""
|
||||||
|
for (var i = 0; i < _reconstruction.selectedNodes.count; i++)
|
||||||
|
{
|
||||||
|
if (nodesName !== "")
|
||||||
|
nodesName += ", "
|
||||||
|
var node = _reconstruction.selectedNodes.at(i)
|
||||||
|
nodesName += node.name
|
||||||
|
}
|
||||||
|
return nodesName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Action {
|
||||||
|
id: pasteAction
|
||||||
|
|
||||||
|
property string tooltip: "Paste the clipboard content to the scene if it contains valid nodes"
|
||||||
|
text: "Paste Node(s)"
|
||||||
|
shortcut: "Ctrl+V"
|
||||||
|
onTriggered: graphEditor.pasteNodes()
|
||||||
|
}
|
||||||
|
|
||||||
Action {
|
Action {
|
||||||
shortcut: "Ctrl+Shift+P"
|
shortcut: "Ctrl+Shift+P"
|
||||||
|
@ -568,6 +604,16 @@ ApplicationWindow {
|
||||||
ToolTip.visible: hovered
|
ToolTip.visible: hovered
|
||||||
ToolTip.text: redoAction.tooltip
|
ToolTip.text: redoAction.tooltip
|
||||||
}
|
}
|
||||||
|
MenuItem {
|
||||||
|
action: copyAction
|
||||||
|
ToolTip.visible: hovered
|
||||||
|
ToolTip.text: copyAction.tooltip
|
||||||
|
}
|
||||||
|
MenuItem {
|
||||||
|
action: pasteAction
|
||||||
|
ToolTip.visible: hovered
|
||||||
|
ToolTip.text: pasteAction.tooltip
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Menu {
|
Menu {
|
||||||
title: "View"
|
title: "View"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue