name every undo command
This commit is contained in:
@@ -401,7 +401,7 @@ void CurveView::FirstChanceMouseRelease(QMouseEvent *event)
|
||||
|
||||
dragging_bezier_pt_ = nullptr;
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Moved Keyframe Bezier Control Point"));
|
||||
}
|
||||
|
||||
void CurveView::KeyframeDragStart(QMouseEvent *event)
|
||||
|
||||
@@ -330,7 +330,7 @@ void CurveWidget::KeyframeTypeButtonTriggered(bool checked)
|
||||
command->add_child(new KeyframeSetTypeCommand(item, new_type));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Changed Type of %1 Keyframe(s) to %2"));
|
||||
}
|
||||
|
||||
void CurveWidget::InputSelectionChanged(const NodeKeyframeTrackReference& ref)
|
||||
|
||||
@@ -61,7 +61,7 @@ void KeyframeView::DeleteSelected()
|
||||
command->add_child(new NodeParamRemoveKeyframeCommand(key));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Deleted %1 Keyframe(s)").arg(GetSelectedKeyframes().size()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ bool KeyframeView::Paste(std::function<Node *(const QString &)> find_node_functi
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Pasted %1 Keyframe(s)").arg(keys.size()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ void KeyframeView::mouseReleaseEvent(QMouseEvent *event)
|
||||
MultiUndoCommand* command = new MultiUndoCommand();
|
||||
selection_manager_.DragStop(command);
|
||||
KeyframeDragRelease(event, command);
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Moved %1 Keyframe(s)").arg(selection_manager_.GetSelectedObjects().size()));
|
||||
} else if (selection_manager_.IsRubberBanding()) {
|
||||
selection_manager_.RubberBandStop();
|
||||
Redraw();
|
||||
@@ -612,7 +612,7 @@ void KeyframeView::ShowContextMenu()
|
||||
foreach (NodeKeyframe* item, GetSelectedKeyframes()) {
|
||||
command->add_child(new KeyframeSetTypeCommand(item, new_type));
|
||||
}
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Set Type of %1 Keyframe(s)").arg(GetSelectedKeyframes().size()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ void MulticamWidget::Switch(int source, bool split_clip)
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Switched Multi-Camera Source"));
|
||||
|
||||
display_->update();
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@ void NodeParamView::DeleteSelected()
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(c);
|
||||
Core::instance()->undo_stack()->push(c, tr("Deleted %1 Node(s)").arg(selected_nodes_.size()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ bool NodeParamView::Paste(QWidget *parent, std::function<QHash<Node *, Node*>(co
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Pasted %1 Node(s)").arg(nodes_to_paste_as_new.size()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ void NodeParamViewConnectedLabel::ShowLabelContextMenu()
|
||||
|
||||
QAction* disconnect_action = m.addAction(tr("Disconnect"));
|
||||
connect(disconnect_action, &QAction::triggered, this, [this](){
|
||||
Core::instance()->undo_stack()->push(new NodeEdgeRemoveCommand(connected_node_, input_));
|
||||
Core::instance()->undo_stack()->push(new NodeEdgeRemoveCommand(connected_node_, input_), Node::GetDisconnectCommandString(connected_node_, input_));
|
||||
});
|
||||
|
||||
m.exec(QCursor::pos());
|
||||
|
||||
@@ -180,7 +180,7 @@ void NodeParamViewContext::AddEffectMenuItemTriggered(QAction *a)
|
||||
command->add_child(new NodeEdgeAddCommand(n, ctx_input));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Added %1 to Node Chain").arg(n->Name()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -458,7 +458,8 @@ void NodeParamViewItemBody::ArrayAppendClicked()
|
||||
for (auto it=array_ui_.cbegin(); it!=array_ui_.cend(); it++) {
|
||||
if (it.value().append_btn == sender()) {
|
||||
NodeInput real_input = NodeGroup::ResolveInput(NodeInput(it.key().node, it.key().input));
|
||||
Core::instance()->undo_stack()->push(new NodeArrayInsertCommand(real_input.node(), real_input.input(), real_input.GetArraySize()));
|
||||
Core::instance()->undo_stack()->push(new NodeArrayInsertCommand(real_input.node(), real_input.input(), real_input.GetArraySize()),
|
||||
tr("Appended Array Element In %1 - %2").arg(real_input.node()->GetLabelAndName(), real_input.GetInputName()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -470,7 +471,8 @@ void NodeParamViewItemBody::ArrayInsertClicked()
|
||||
if (it.value().array_insert_btn == sender()) {
|
||||
// Found our input and element
|
||||
NodeInput ic = NodeGroup::ResolveInput(it.key());
|
||||
Core::instance()->undo_stack()->push(new NodeArrayInsertCommand(ic.node(), ic.input(), ic.element()));
|
||||
Core::instance()->undo_stack()->push(new NodeArrayInsertCommand(ic.node(), ic.input(), ic.element()),
|
||||
tr("Inserted Array Element In %1 - %2").arg(ic.node()->GetLabelAndName(), ic.GetInputName()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -482,7 +484,8 @@ void NodeParamViewItemBody::ArrayRemoveClicked()
|
||||
if (it.value().array_remove_btn == sender()) {
|
||||
// Found our input and element
|
||||
NodeInput ic = NodeGroup::ResolveInput(it.key());
|
||||
Core::instance()->undo_stack()->push(new NodeArrayRemoveCommand(ic.node(), ic.input(), ic.element()));
|
||||
Core::instance()->undo_stack()->push(new NodeArrayRemoveCommand(ic.node(), ic.input(), ic.element()),
|
||||
tr("Removed Array Element In %1 - %2").arg(ic.node()->GetLabelAndName(), ic.GetInputName()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ void NodeParamViewKeyframeControl::ToggleKeyframe(bool e)
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Toggled Keyframe"));
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::UpdateState()
|
||||
@@ -228,6 +228,8 @@ void NodeParamViewKeyframeControl::KeyframeEnableBtnClicked(bool e)
|
||||
|
||||
MultiUndoCommand* command = new MultiUndoCommand();
|
||||
|
||||
QString command_name;
|
||||
|
||||
if (e) {
|
||||
// Enable keyframing
|
||||
command->add_child(new NodeParamSetKeyframingCommand(input_, true));
|
||||
@@ -245,6 +247,8 @@ void NodeParamViewKeyframeControl::KeyframeEnableBtnClicked(bool e)
|
||||
|
||||
command->add_child(new NodeParamInsertKeyframeCommand(input_.node(), key));
|
||||
}
|
||||
|
||||
command_name = tr("Enabled Keyframing On %1 - %2").arg(input_.node()->GetLabelAndName(), input_.GetInputName());
|
||||
} else {
|
||||
// Confirm the user wants to clear all keyframes
|
||||
if (QMessageBox::warning(this,
|
||||
@@ -270,13 +274,14 @@ void NodeParamViewKeyframeControl::KeyframeEnableBtnClicked(bool e)
|
||||
// Disable keyframing
|
||||
command->add_child(new NodeParamSetKeyframingCommand(input_, false));
|
||||
|
||||
command_name = tr("Disabled Keyframing On %1 - %2").arg(input_.node()->GetLabelAndName(), input_.GetInputName());
|
||||
} else {
|
||||
// Disable action has effectively been ignored
|
||||
enable_key_btn_->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, command_name);
|
||||
}
|
||||
|
||||
void NodeParamViewKeyframeControl::KeyframeEnableChanged(const NodeInput &input, bool e)
|
||||
|
||||
@@ -190,7 +190,7 @@ void NodeParamViewWidgetBridge::SetInputValue(const QVariant &value, int track)
|
||||
|
||||
SetInputValueInternal(value, track, command, true);
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, GetCommandName());
|
||||
}
|
||||
|
||||
void NodeParamViewWidgetBridge::SetInputValueInternal(const QVariant &value, int track, MultiUndoCommand *command, bool insert_on_all_tracks_if_no_key)
|
||||
@@ -218,7 +218,7 @@ void NodeParamViewWidgetBridge::ProcessSlider(NumericSliderBase *slider, int sli
|
||||
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
dragger_.End(command);
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, GetCommandName());
|
||||
|
||||
} else {
|
||||
|
||||
@@ -314,7 +314,7 @@ void NodeParamViewWidgetBridge::WidgetCallback()
|
||||
n->SetInputProperty(GetInnerInput().input(), QStringLiteral("col_look"), c.color_output().look());
|
||||
n->blockSignals(false);
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, GetCommandName());
|
||||
break;
|
||||
}
|
||||
case NodeValue::kText:
|
||||
@@ -532,6 +532,12 @@ rational NodeParamViewWidgetBridge::GetCurrentTimeAsNodeTime() const
|
||||
}
|
||||
}
|
||||
|
||||
QString NodeParamViewWidgetBridge::GetCommandName() const
|
||||
{
|
||||
NodeInput i = GetInnerInput();
|
||||
return tr("Edited Value Of %1 - %2").arg(i.node()->GetLabelAndName(), i.node()->GetInputName(i.input()));
|
||||
}
|
||||
|
||||
void NodeParamViewWidgetBridge::SetTimebase(const rational& timebase)
|
||||
{
|
||||
if (GetDataType() == NodeValue::kRational) {
|
||||
|
||||
@@ -93,6 +93,8 @@ private:
|
||||
return input_hierarchy_.last();
|
||||
}
|
||||
|
||||
QString GetCommandName() const;
|
||||
|
||||
NodeValue::Type GetDataType() const
|
||||
{
|
||||
return GetOuterInput().GetDataType();
|
||||
|
||||
@@ -141,11 +141,13 @@ void NodeView::DeleteSelected()
|
||||
{
|
||||
NodeViewDeleteCommand* command = new NodeViewDeleteCommand();
|
||||
|
||||
int count = 0;
|
||||
|
||||
foreach (NodeViewContext *ctx, scene_.context_map()) {
|
||||
ctx->DeleteSelected(command);
|
||||
count += ctx->DeleteSelected(command);
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Deleted %1 Node(s)").arg(count));
|
||||
}
|
||||
|
||||
void NodeView::SelectAll()
|
||||
@@ -356,7 +358,7 @@ void NodeView::SetColorLabel(int index)
|
||||
command->add_child(new NodeOverrideColorCommand(node, index));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Set Color of %1 Node(s)").arg(selected_nodes_.size()));
|
||||
}
|
||||
|
||||
void NodeView::ZoomIn()
|
||||
@@ -411,7 +413,7 @@ void NodeView::keyPressEvent(QKeyEvent *event)
|
||||
}
|
||||
}
|
||||
}
|
||||
Core::instance()->undo_stack()->push(pos_command);
|
||||
Core::instance()->undo_stack()->push(pos_command, tr("Moved %1 Node(s)").arg(selected_nodes_.size()));
|
||||
break;
|
||||
}
|
||||
case Qt::Key_Escape:
|
||||
@@ -579,9 +581,10 @@ void NodeView::mouseReleaseEvent(QMouseEvent *event)
|
||||
command->add_child(new NodeSetPositionCommand(i->GetNode(), i->GetContext(), current_pos));
|
||||
}
|
||||
}
|
||||
dragging_items_.clear();
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Moved %1 Node(s)").arg(dragging_items_.size()));
|
||||
|
||||
dragging_items_.clear();
|
||||
|
||||
if (!had_attached_items) {
|
||||
super::mouseReleaseEvent(event);
|
||||
@@ -674,7 +677,7 @@ void NodeView::dropEvent(QDropEvent *event)
|
||||
if (Node *drop_ctx = GetContextAtMousePos(event->pos())) {
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
QVector<Node*> select_nodes = ProcessDroppingAttachedNodes(command, drop_ctx, event->pos());
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Dropped %1 Node(s)").arg(select_nodes.size()));
|
||||
|
||||
DeselectAll();
|
||||
scene_.context_map().value(drop_ctx)->Select(select_nodes);
|
||||
@@ -1431,7 +1434,7 @@ void NodeView::GroupNodes()
|
||||
// Do command
|
||||
Core::instance()->LabelNodes({group}, command);
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Grouped Nodes"));
|
||||
}
|
||||
|
||||
void NodeView::UngroupNodes()
|
||||
@@ -1466,7 +1469,7 @@ void NodeView::UngroupNodes()
|
||||
command->add_child(new NodeSetPositionCommand(it.key(), context, group->GetNodePositionDataInContext(it.key())));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Ungrouped Nodes"));
|
||||
}
|
||||
|
||||
void NodeView::ShowNodeProperties()
|
||||
@@ -1622,6 +1625,8 @@ void NodeView::EndEdgeDrag(bool cancel)
|
||||
create_edge_input_item_->SetHighlighted(false);
|
||||
}
|
||||
|
||||
QString command_name;
|
||||
|
||||
NodeInput &creating_input = create_edge_input_;
|
||||
if (create_edge_output_item_ && create_edge_input_item_ && !cancel) {
|
||||
if (creating_input.IsValid()) {
|
||||
@@ -1658,6 +1663,8 @@ void NodeView::EndEdgeDrag(bool cancel)
|
||||
if (!cancel) {
|
||||
command->add_child(new NodeEdgeAddCommand(creating_output, creating_input));
|
||||
|
||||
command_name = Node::GetConnectCommandString(creating_output, creating_input);
|
||||
|
||||
// If the output is not in the input's context, add it now. We check the item rather than
|
||||
// the node itself, because sometimes a node may not be in the context but another node
|
||||
// representing it will be (e.g. groups)
|
||||
@@ -1680,7 +1687,7 @@ void NodeView::EndEdgeDrag(bool cancel)
|
||||
}
|
||||
create_edge_expanded_items_.clear();
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, command_name);
|
||||
}
|
||||
|
||||
void NodeView::PostPaste(const QVector<Node *> &new_nodes, const Node::PositionMap &map)
|
||||
|
||||
@@ -191,8 +191,10 @@ void NodeViewContext::SetCurvedEdges(bool e)
|
||||
}
|
||||
}
|
||||
|
||||
void NodeViewContext::DeleteSelected(NodeViewDeleteCommand *command)
|
||||
int NodeViewContext::DeleteSelected(NodeViewDeleteCommand *command)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
// Delete any selected edges
|
||||
foreach (NodeViewEdge *edge, edges_) {
|
||||
if (edge->isSelected()) {
|
||||
@@ -204,8 +206,11 @@ void NodeViewContext::DeleteSelected(NodeViewDeleteCommand *command)
|
||||
foreach (NodeViewItem *node, item_map_) {
|
||||
if (node->isSelected()) {
|
||||
command->AddNode(node->GetNode(), context_);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
void NodeViewContext::Select(const QVector<Node *> &nodes)
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
|
||||
void SetCurvedEdges(bool e);
|
||||
|
||||
void DeleteSelected(NodeViewDeleteCommand *command);
|
||||
int DeleteSelected(NodeViewDeleteCommand *command);
|
||||
|
||||
void Select(const QVector<Node*> &nodes);
|
||||
|
||||
|
||||
@@ -487,7 +487,7 @@ void ProjectExplorer::ReplaceSelectedFootage()
|
||||
p->add_child(new NodeRenameCommand(footage, QFileInfo(file).fileName()));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(p);
|
||||
Core::instance()->undo_stack()->push(p, tr("Replaced Footage"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -666,7 +666,7 @@ void ProjectExplorer::DeleteSelected()
|
||||
bool check_if_item_is_in_use = true;
|
||||
|
||||
if (DeleteItemsInternal(selected, check_if_item_is_in_use, command)) {
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Deleted %1 Item(s)").arg(selected.size()));
|
||||
} else {
|
||||
delete command;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ bool ProjectViewModel::setData(const QModelIndex &index, const QVariant &value,
|
||||
|
||||
nrc->AddNode(item, value.toString());
|
||||
|
||||
Core::instance()->undo_stack()->push(nrc);
|
||||
Core::instance()->undo_stack()->push(nrc, tr("Renamed Item \"%1\" to \"%2\"").arg(item->GetLabel(), new_name));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -357,7 +357,7 @@ bool ProjectViewModel::dropMimeData(const QMimeData *data, Qt::DropAction action
|
||||
// Loop through all data
|
||||
MultiUndoCommand* move_command = new MultiUndoCommand();
|
||||
|
||||
move_command->set_name(tr("Move Items"));
|
||||
int count = 0;
|
||||
|
||||
while (!stream.atEnd()) {
|
||||
stream >> streams >> item_ptr;
|
||||
@@ -371,10 +371,11 @@ bool ProjectViewModel::dropMimeData(const QMimeData *data, Qt::DropAction action
|
||||
&& (!dynamic_cast<Folder*>(item) || !ItemIsParentOfChild(static_cast<Folder*>(item), drop_location))) {
|
||||
move_command->add_child(new NodeEdgeRemoveCommand(item, NodeInput(item->folder(), Folder::kChildInput, item->folder()->index_of_child_in_array(item))));
|
||||
move_command->add_child(new FolderAddChild(drop_location, item));
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(move_command);
|
||||
Core::instance()->undo_stack()->push(move_command, tr("Move %1 Item(s)").arg(count));
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
@@ -558,7 +558,7 @@ void TimeBasedWidget::SetPoint(Timeline::MovementMode m, const rational& time)
|
||||
// Set workarea
|
||||
command->add_child(new WorkareaSetRangeCommand(points, TimeRange(in_point, out_point)));
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Set In/Out Point"));
|
||||
}
|
||||
|
||||
void TimeBasedWidget::ResetPoint(Timeline::MovementMode m)
|
||||
@@ -581,7 +581,7 @@ void TimeBasedWidget::ResetPoint(Timeline::MovementMode m)
|
||||
r.set_out(TimelineWorkArea::kResetOut);
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(new WorkareaSetRangeCommand(points, r));
|
||||
Core::instance()->undo_stack()->push(new WorkareaSetRangeCommand(points, r), tr("Reset In/Out Points"));
|
||||
}
|
||||
|
||||
void TimeBasedWidget::PageScrollInternal(QScrollBar *bar, int maximum, int screen_position, bool whole_page_scroll)
|
||||
@@ -648,7 +648,7 @@ void TimeBasedWidget::ClearInOutPoints()
|
||||
return;
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(new WorkareaSetEnabledCommand(GetConnectedNode()->project(), GetConnectedNode()->GetWorkArea(), false));
|
||||
Core::instance()->undo_stack()->push(new WorkareaSetEnabledCommand(GetConnectedNode()->project(), GetConnectedNode()->GetWorkArea(), false), tr("Cleared In/Out Points"));
|
||||
}
|
||||
|
||||
void TimeBasedWidget::SetMarker()
|
||||
@@ -685,7 +685,7 @@ void TimeBasedWidget::SetMarker()
|
||||
}
|
||||
|
||||
if (marker) {
|
||||
Core::instance()->undo_stack()->push(new MarkerAddCommand(markers, marker));
|
||||
Core::instance()->undo_stack()->push(new MarkerAddCommand(markers, marker), tr("Added Marker"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ void TimelineWidget::SplitAtPlayhead()
|
||||
}
|
||||
|
||||
if (!blocks_to_split.isEmpty()) {
|
||||
Core::instance()->undo_stack()->push(new BlockSplitPreservingLinksCommand(blocks_to_split, {playhead_time}));
|
||||
Core::instance()->undo_stack()->push(new BlockSplitPreservingLinksCommand(blocks_to_split, {playhead_time}), tr("Split Clips At Playhead"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,7 +545,7 @@ void TimelineWidget::DeleteSelected(bool ripple)
|
||||
command->add_child(ripple_command);
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Deleted Clips"));
|
||||
|
||||
// Ensures any current drag operations are cancelled
|
||||
ClearGhosts();
|
||||
@@ -583,14 +583,14 @@ void TimelineWidget::InsertFootageAtPlayhead(const QVector<ViewerOutput*>& foota
|
||||
{
|
||||
auto command = new MultiUndoCommand();
|
||||
import_tool_->PlaceAt(footage, GetConnectedNode()->GetPlayhead(), true, command, 0, true);
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Inserted Footage At Playhead"));
|
||||
}
|
||||
|
||||
void TimelineWidget::OverwriteFootageAtPlayhead(const QVector<ViewerOutput *> &footage)
|
||||
{
|
||||
auto command = new MultiUndoCommand();
|
||||
import_tool_->PlaceAt(footage, GetConnectedNode()->GetPlayhead(), false, command, 0, true);
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Overwrote Footage At Playhead"));
|
||||
}
|
||||
|
||||
void TimelineWidget::ToggleLinksOnSelected()
|
||||
@@ -616,7 +616,7 @@ void TimelineWidget::ToggleLinksOnSelected()
|
||||
return;
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(new NodeLinkManyCommand(blocks, link));
|
||||
Core::instance()->undo_stack()->push(new NodeLinkManyCommand(blocks, link), tr("Linked Clips"));
|
||||
}
|
||||
|
||||
void TimelineWidget::AddDefaultTransitionsToSelected()
|
||||
@@ -631,7 +631,7 @@ void TimelineWidget::AddDefaultTransitionsToSelected()
|
||||
}
|
||||
|
||||
if (!blocks.isEmpty()) {
|
||||
Core::instance()->undo_stack()->push(new TimelineAddDefaultTransitionCommand(blocks, timebase()));
|
||||
Core::instance()->undo_stack()->push(new TimelineAddDefaultTransitionCommand(blocks, timebase()), tr("Added Default Transitions"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -755,7 +755,7 @@ void TimelineWidget::DeleteInToOut(bool ripple)
|
||||
GetConnectedNode()->SetPlayhead(GetConnectedNode()->GetWorkArea()->in());
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Deleted In To Out"));
|
||||
}
|
||||
|
||||
void TimelineWidget::ToggleSelectedEnabled()
|
||||
@@ -773,7 +773,7 @@ void TimelineWidget::ToggleSelectedEnabled()
|
||||
!i->is_enabled()));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Toggled Clips Enabled"));
|
||||
}
|
||||
|
||||
void TimelineWidget::SetColorLabel(int index)
|
||||
@@ -784,7 +784,7 @@ void TimelineWidget::SetColorLabel(int index)
|
||||
command->add_child(new NodeOverrideColorCommand(b, index));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Set Colors of %1 Clips").arg(selected_blocks_.size()));
|
||||
}
|
||||
|
||||
void TimelineWidget::NudgeLeft()
|
||||
@@ -845,7 +845,7 @@ void TimelineWidget::RecordingCallback(const QString &filename, const TimeRange
|
||||
import_command->add_child(subimport_command);
|
||||
|
||||
import_tool_->PlaceAt({task.GetImportedFootage().front()}, time.in(), false, import_command, track.index());
|
||||
Core::instance()->undo_stack()->push(import_command);
|
||||
Core::instance()->undo_stack()->push(import_command, tr("Recorded Audio Clip"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -977,7 +977,7 @@ void TimelineWidget::NestSelectedClips()
|
||||
// Place new sequence in this sequence
|
||||
import_tool_->PlaceAt({nest}, start_time, false, meta_command, index);
|
||||
|
||||
Core::instance()->undo_stack()->push(meta_command);
|
||||
Core::instance()->undo_stack()->push(meta_command, tr("Nested Clips"));
|
||||
}
|
||||
|
||||
void TimelineWidget::ClearTentativeSubtitleTrack()
|
||||
@@ -1452,7 +1452,7 @@ void TimelineWidget::RenameSelectedBlocks()
|
||||
}
|
||||
|
||||
Core::instance()->LabelNodes(nodes);
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Renamed %1 Clip(s)").arg(nodes.size()));
|
||||
}
|
||||
|
||||
void TimelineWidget::TrackAboutToBeDeleted(Track *track)
|
||||
@@ -1461,7 +1461,7 @@ void TimelineWidget::TrackAboutToBeDeleted(Track *track)
|
||||
// User is deleting the tentative subtitle track. Technically they shouldn't do this, but they
|
||||
// might if they misinterpret it as permanent. If so, we handle it cleanly by pushing our
|
||||
// command as if the action really were permanent.
|
||||
Core::instance()->undo_stack()->push(TakeSubtitleSectionCommand());
|
||||
Core::instance()->undo_stack()->push(TakeSubtitleSectionCommand(), tr("Created Subtitle Track"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1475,7 +1475,7 @@ void TimelineWidget::SetSelectedClipsAutocaching(bool e)
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, e ? tr("Enabled Auto-Caching On %1 Clip(s)").arg(selected_blocks_.size()) : tr("Disabled Auto-Caching On %1 Clip(s)").arg(selected_blocks_.size()));
|
||||
}
|
||||
|
||||
void TimelineWidget::CacheClips()
|
||||
@@ -1574,7 +1574,7 @@ void TimelineWidget::MulticamEnabledTriggered(bool e)
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, e ? tr("Multi-Cam Enabled On %1 Clip(s)").arg(selected_blocks_.size()) : tr("Multi-Cam Disabled On %1 Clip(s)").arg(selected_blocks_.size()));
|
||||
}
|
||||
|
||||
void TimelineWidget::ForceUpdateRubberBand()
|
||||
@@ -1633,7 +1633,7 @@ void TimelineWidget::NudgeInternal(rational amount)
|
||||
new_sel.ShiftTime(amount);
|
||||
command->add_child(new TimelineWidget::SetSelectionsCommand(this, new_sel, GetSelections()));
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Nudged Clips"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1685,7 +1685,7 @@ void TimelineWidget::MoveToPlayheadInternal(bool out)
|
||||
}
|
||||
command->add_child(new SetSelectionsCommand(this, new_sel, GetSelections()));
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Moved Clip(s) To Point"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1875,7 +1875,7 @@ void TimelineWidget::RippleTo(Timeline::MovementMode mode)
|
||||
in_ripple,
|
||||
out_ripple);
|
||||
|
||||
Core::instance()->undo_stack()->push(c);
|
||||
Core::instance()->undo_stack()->push(c, tr("Rippled Clip(s) To Point"));
|
||||
|
||||
// If we rippled, ump to where new cut is if applicable
|
||||
if (mode == Timeline::kTrimIn) {
|
||||
@@ -1918,7 +1918,7 @@ void TimelineWidget::EditTo(Timeline::MovementMode mode)
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Cut Clip(s) To Point"));
|
||||
}
|
||||
|
||||
void TimelineWidget::UpdateViewports(const Track::Type &type)
|
||||
@@ -1986,7 +1986,7 @@ bool TimelineWidget::PasteInternal(bool insert)
|
||||
paste_start + in));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Pasted %1 Clip(s)").arg(res.GetLoadData().properties.size()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ void AddTool::MouseRelease(TimelineViewMouseEvent *event)
|
||||
|
||||
CreateAddableClip(command, s, ghost_->GetTrack(), ghost_->GetAdjustedIn(), ghost_->GetAdjustedLength(), r);
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, qApp->translate("AddTool", "Added Clip"));
|
||||
}
|
||||
|
||||
parent()->ClearGhosts();
|
||||
|
||||
@@ -184,7 +184,7 @@ void ImportTool::DragDrop(TimelineViewMouseEvent *event)
|
||||
if (!dragged_footage_.isEmpty()) {
|
||||
auto command = new MultiUndoCommand();
|
||||
DropGhosts(event->GetModifiers() & Qt::ControlModifier, command);
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, qApp->translate("ImportTool", "Dropped Footage Into Sequence"));
|
||||
|
||||
event->accept();
|
||||
} else {
|
||||
|
||||
@@ -815,7 +815,7 @@ void PointerTool::FinishDrag(TimelineViewMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, qApp->translate("PointerTool", "Moved Clips"));
|
||||
}
|
||||
|
||||
Timeline::MovementMode PointerTool::IsCursorInTrimHandle(Block *block, qreal cursor_x)
|
||||
|
||||
@@ -93,7 +93,7 @@ void RazorTool::MouseRelease(TimelineViewMouseEvent *event)
|
||||
split_tracks_.clear();
|
||||
|
||||
if (!blocks_to_split.isEmpty()) {
|
||||
Core::instance()->undo_stack()->push(new BlockSplitPreservingLinksCommand(blocks_to_split, {split_time}));
|
||||
Core::instance()->undo_stack()->push(new BlockSplitPreservingLinksCommand(blocks_to_split, {split_time}), qApp->translate("RazorTool", "Split Clips"));
|
||||
}
|
||||
|
||||
dragging_ = false;
|
||||
|
||||
@@ -169,7 +169,7 @@ void RippleTool::FinishDrag(TimelineViewMouseEvent *event)
|
||||
}
|
||||
command->add_child(new TimelineWidget::SetSelectionsCommand(parent(), new_sel, parent()->GetSelections(), false));
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, qApp->translate("RippleTool", "Rippled Clips"));
|
||||
} else {
|
||||
delete command;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ void SlipTool::FinishDrag(TimelineViewMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, qApp->translate("SlipTool", "Slipped %1 Clip(s)").arg(parent()->GetGhostItems().size()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ void TransitionTool::MouseRelease(TimelineViewMouseEvent *event)
|
||||
command->add_child(new NodeSetPositionCommand(block_to_transition, transition, QPointF(-1, 0)));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, qApp->translate("TransitionTool", "Created Transition"));
|
||||
|
||||
parent()->SetViewTransitionOverlay(nullptr, nullptr);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ void TrackViewItem::ShowContextMenu(const QPoint &p)
|
||||
void TrackViewItem::DeleteTrack()
|
||||
{
|
||||
emit AboutToDeleteTrack(track_);
|
||||
Core::instance()->undo_stack()->push(new TimelineRemoveTrackCommand(track_));
|
||||
Core::instance()->undo_stack()->push(new TimelineRemoveTrackCommand(track_), tr("Deleted Track \"%1\"").arg(track_->GetLabelOrName()));
|
||||
}
|
||||
|
||||
void TrackViewItem::DeleteAllEmptyTracks()
|
||||
@@ -172,7 +172,7 @@ void TrackViewItem::DeleteAllEmptyTracks()
|
||||
foreach (Track *track, tracks_to_remove) {
|
||||
command->add_child(new TimelineRemoveTrackCommand(track));
|
||||
}
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Deleted All Empty Tracks"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void SeekableWidget::DeleteSelected()
|
||||
command->add_child(new MarkerRemoveCommand(marker));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Deleted %1 Marker(s)").arg(selection_manager_.GetSelectedObjects().size()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ bool SeekableWidget::PasteMarkers()
|
||||
command->add_child(new MarkerAddCommand(markers_, m));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Pasted %1 Marker(s)").arg(markers.size()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,7 @@ void SeekableWidget::mouseReleaseEvent(QMouseEvent *event)
|
||||
if (selection_manager_.IsDragging()) {
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
selection_manager_.DragStop(command);
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Moved %1 Marker(s)").arg(selection_manager_.GetSelectedObjects().size()));
|
||||
}
|
||||
|
||||
if (GetSnapService()) {
|
||||
@@ -364,7 +364,7 @@ void SeekableWidget::SetMarkerColor(int c)
|
||||
command->add_child(new MarkerChangeColorCommand(marker, c));
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Changed Color of %1 Marker(s)").arg(selection_manager_.GetSelectedObjects().size()));
|
||||
}
|
||||
|
||||
void SeekableWidget::ShowMarkerProperties()
|
||||
@@ -608,13 +608,17 @@ void SeekableWidget::CommitResizeHandle()
|
||||
{
|
||||
MultiUndoCommand *command = new MultiUndoCommand();
|
||||
|
||||
QString command_name;
|
||||
|
||||
if (TimelineMarker *marker = dynamic_cast<TimelineMarker*>(resize_item_)) {
|
||||
command->add_child(new MarkerChangeTimeCommand(marker, marker->time(), resize_item_range_));
|
||||
command_name = tr("Changed Marker Length");
|
||||
} else if (TimelineWorkArea *workarea = dynamic_cast<TimelineWorkArea*>(resize_item_)) {
|
||||
command->add_child(new WorkareaSetRangeCommand(workarea, workarea->range(), resize_item_range_));
|
||||
command_name = tr("Changed Workarea Length");
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, command_name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -557,7 +557,7 @@ void ViewerWidget::CreateAddableAt(const QRectF &f)
|
||||
shape->SetRect(f, s->GetVideoParams(), command);
|
||||
}
|
||||
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Created Shape"));
|
||||
SetGizmos(clip);
|
||||
}
|
||||
}
|
||||
@@ -1235,7 +1235,7 @@ void ViewerWidget::ContextMenuSetPlaybackRes(QAction *action)
|
||||
vp.set_divider(div);
|
||||
|
||||
auto c = new NodeParamSetStandardValueCommand(NodeKeyframeTrackReference(NodeInput(GetConnectedNode(), ViewerOutput::kVideoParamsInput, 0)), QVariant::fromValue(vp));
|
||||
Core::instance()->undo_stack()->push(c);
|
||||
Core::instance()->undo_stack()->push(c, tr("Changed Playback Resolution"));
|
||||
}
|
||||
|
||||
void ViewerWidget::ContextMenuDisableSafeMargins()
|
||||
|
||||
@@ -946,7 +946,7 @@ bool ViewerDisplayWidget::OnMouseRelease(QMouseEvent *e)
|
||||
if (DraggableGizmo *draggable = dynamic_cast<DraggableGizmo*>(current_gizmo_)) {
|
||||
draggable->DragEnd(command);
|
||||
}
|
||||
Core::instance()->undo_stack()->push(command);
|
||||
Core::instance()->undo_stack()->push(command, tr("Dragged Gizmo"));
|
||||
gizmo_drag_started_ = false;
|
||||
}
|
||||
current_gizmo_ = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user