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:
@@ -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());
|
||||
|
||||
@@ -175,11 +175,6 @@ private slots:
|
||||
*/
|
||||
void AutoPositionDescendents();
|
||||
|
||||
/**
|
||||
* @brief Receiver for labelling a node from the context menu
|
||||
*/
|
||||
void ContextMenuLabelNode();
|
||||
|
||||
/**
|
||||
* @brief Receiver for the user changing the filter
|
||||
*/
|
||||
|
||||
@@ -291,10 +291,12 @@ bool NodeViewScene::GetEdgesAreCurved() const
|
||||
|
||||
void NodeViewScene::SetEdgesAreCurved(bool curved)
|
||||
{
|
||||
curved_edges_ = curved;
|
||||
if (curved_edges_ != curved) {
|
||||
curved_edges_ = curved;
|
||||
|
||||
foreach (NodeViewEdge* e, edge_map_) {
|
||||
e->SetCurved(curved_edges_);
|
||||
foreach (NodeViewEdge* e, edge_map_) {
|
||||
e->SetCurved(curved_edges_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user