timeline: add rename action

This used to be possible in properties, but then the properties action changed. Oops.
This commit is contained in:
itsmattkc
2022-05-04 11:04:34 -07:00
parent d55d9c820f
commit 494370cc49
2 changed files with 18 additions and 0 deletions
@@ -1079,6 +1079,9 @@ void TimelineWidget::ShowContextMenu()
}
}
QAction* rename_action = menu.addAction(tr("Rename"));
connect(rename_action, &QAction::triggered, this, &TimelineWidget::RenameSelectedBlocks);
QAction* properties_action = menu.addAction(tr("Properties"));
connect(properties_action, &QAction::triggered, this, &TimelineWidget::ShowSpeedDurationDialogForSelectedClips);
}
@@ -1232,6 +1235,19 @@ void TimelineWidget::RevealInProject()
emit RevealViewerInProject(item_to_reveal);
}
void TimelineWidget::RenameSelectedBlocks()
{
MultiUndoCommand *command = new MultiUndoCommand();
QVector<Node*> nodes(selected_blocks_.size());
for (int i=0; i<nodes.size(); i++) {
nodes[i] = selected_blocks_[i];
}
Core::instance()->LabelNodes(nodes);
Core::instance()->undo_stack()->pushIfHasChildren(command);
}
void TimelineWidget::AddGhost(TimelineViewGhostItem *ghost)
{
ghost_items_.append(ghost);
@@ -414,6 +414,8 @@ private slots:
void RevealInProject();
void RenameSelectedBlocks();
};
}