Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions meshroom/ui/qml/GraphEditor/GraphEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ Item {
}
} else if (event.key === Qt.Key_D) {
duplicateNode(event.modifiers === Qt.AltModifier)
} else if (event.key === Qt.Key_X && event.modifiers === Qt.ControlModifier) {
copyNodes()
uigraph.removeNodes(uigraph.selectedNodes)
} else if (event.key === Qt.Key_C && event.modifiers === Qt.ControlModifier) {
copyNodes()
} else if (event.key === Qt.Key_V && event.modifiers === Qt.ControlModifier) {
Expand Down Expand Up @@ -476,6 +479,16 @@ Item {
onTriggered: Qt.openUrlExternally(Filepath.stringToUrl(nodeMenu.currentNode.internalFolder))
}
MenuSeparator {}
MenuItem {
text: "Cut Node(s)"
enabled: true
ToolTip.text: "Copy selection to the clipboard and remove it"
ToolTip.visible: hovered
onTriggered: {
copyNodes()
uigraph.removeNodes(uigraph.selectedNodes)
}
}
MenuItem {
text: "Copy Node(s)"
enabled: true
Expand Down
53 changes: 38 additions & 15 deletions meshroom/ui/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,38 @@ ApplicationWindow {
enabled: _reconstruction ? _reconstruction.undoStack.canRedo && !_reconstruction.undoStack.lockedRedo : false
onTriggered: _reconstruction.undoStack.redo()
}

function getSelectedNodesName()
{
if (!_reconstruction)
return ""
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: cutAction

property string tooltip: {
var s = "Copy selected node"
s += (_reconstruction && _reconstruction.selectedNodes.count > 1 ? "s (" : " (") + getSelectedNodesName()
s += ") to the clipboard and remove them from the graph"
return s
}
text: "Cut Node" + (_reconstruction && _reconstruction.selectedNodes.count > 1 ? "s " : " ")
enabled: _reconstruction ? _reconstruction.selectedNodes.count > 0 : false
onTriggered: {
graphEditor.copyNodes()
graphEditor.uigraph.removeNodes(graphEditor.uigraph.selectedNodes)
}
}

Action {
id: copyAction

Expand All @@ -533,21 +565,6 @@ ApplicationWindow {
text: "Copy Node" + (_reconstruction && _reconstruction.selectedNodes.count > 1 ? "s " : " ")
enabled: _reconstruction ? _reconstruction.selectedNodes.count > 0 : false
onTriggered: graphEditor.copyNodes()

function getSelectedNodesName()
{
if (!_reconstruction)
return ""
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 {
Expand All @@ -558,6 +575,7 @@ ApplicationWindow {
onTriggered: graphEditor.pasteNodes()
}


Action {
id: loadTemplateAction

Expand Down Expand Up @@ -794,6 +812,11 @@ ApplicationWindow {
ToolTip.visible: hovered
ToolTip.text: redoAction.tooltip
}
MenuItem {
action: cutAction
ToolTip.visible: hovered
ToolTip.text: cutAction.tooltip
}
MenuItem {
action: copyAction
ToolTip.visible: hovered
Expand Down