From 494370cc49bf2ae01e05f2b9b15519c3178e5509 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Wed, 4 May 2022 11:04:34 -0700 Subject: [PATCH] timeline: add rename action This used to be possible in properties, but then the properties action changed. Oops. --- app/widget/timelinewidget/timelinewidget.cpp | 16 ++++++++++++++++ app/widget/timelinewidget/timelinewidget.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/app/widget/timelinewidget/timelinewidget.cpp b/app/widget/timelinewidget/timelinewidget.cpp index eba333b85..4f2a67647 100644 --- a/app/widget/timelinewidget/timelinewidget.cpp +++ b/app/widget/timelinewidget/timelinewidget.cpp @@ -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 nodes(selected_blocks_.size()); + + for (int i=0; iLabelNodes(nodes); + Core::instance()->undo_stack()->pushIfHasChildren(command); +} + void TimelineWidget::AddGhost(TimelineViewGhostItem *ghost) { ghost_items_.append(ghost); diff --git a/app/widget/timelinewidget/timelinewidget.h b/app/widget/timelinewidget/timelinewidget.h index a0b9afaaa..cd515b67f 100644 --- a/app/widget/timelinewidget/timelinewidget.h +++ b/app/widget/timelinewidget/timelinewidget.h @@ -414,6 +414,8 @@ private slots: void RevealInProject(); + void RenameSelectedBlocks(); + }; }