nodes/clips: use node label as clip name and allow changing multiple labels at once

Merges the "clip name" and "node label" into the same entity.
This commit is contained in:
itsmattkc
2020-06-16 16:23:05 +10:00
parent cbbf1c9149
commit 41b04d976c
11 changed files with 55 additions and 70 deletions
+6 -32
View File
@@ -490,15 +490,13 @@ void NodeView::ShowContextMenu(const QPoint &pos)
if (itemAt(pos) && !selected.isEmpty()) {
if (selected.size() == 1) {
// Label node action
QAction* label_action = m.addAction(tr("Label"));
connect(label_action, &QAction::triggered, this, [this](){
Core::instance()->LabelNodes(scene_.GetSelectedNodes());
});
// Label node action
QAction* label_action = m.addAction(tr("Label"));
connect(label_action, &QAction::triggered, this, &NodeView::ContextMenuLabelNode);
m.addSeparator();
}
m.addSeparator();
// Auto-position action
QAction* autopos = m.addAction(tr("Auto-Position"));
@@ -591,30 +589,6 @@ void NodeView::AutoPositionDescendents()
}
}
void NodeView::ContextMenuLabelNode()
{
QList<Node*> nodes = scene_.GetSelectedNodes();
if (nodes.isEmpty()) {
return;
}
Node* n = nodes.first();
bool ok;
QString s = QInputDialog::getText(this,
tr("Label Node"),
tr("Set node label"),
QLineEdit::Normal,
n->GetLabel(),
&ok);
if (ok) {
n->SetLabel(s);
}
}
void NodeView::ContextMenuFilterChanged(QAction *action)
{
FilterMode filter = static_cast<FilterMode>(action->data().toInt());