name every undo command

This commit is contained in:
itsmattkc
2023-03-12 00:49:03 -08:00
parent 019f095ee4
commit 2c2df99963
46 changed files with 172 additions and 122 deletions
+1 -1
View File
@@ -275,7 +275,7 @@ void TextGeneratorV3::GizmoDeactivated()
void TextGeneratorV3::SetVerticalAlignmentUndoable(Qt::Alignment a)
{
Core::instance()->undo_stack()->push(new NodeParamSetStandardValueCommand(NodeInput(this, kVerticalAlignmentInput), GetOurAlignmentFromQts(a)));
Core::instance()->undo_stack()->push(new NodeParamSetStandardValueCommand(NodeInput(this, kVerticalAlignmentInput), GetOurAlignmentFromQts(a)), tr("Set Text Vertical Alignment"));
}
}
+1 -1
View File
@@ -43,7 +43,7 @@ void TextGizmo::UpdateInputHtml(const QString &s, const rational &time)
if (input_.IsValid()) {
MultiUndoCommand *command = new MultiUndoCommand();
Node::SetValueAtTime(input_.input(), time, s, input_.track(), command, true);
Core::instance()->undo_stack()->push(command);
Core::instance()->undo_stack()->push(command, tr("Edit Text"));
}
}
+10
View File
@@ -1763,6 +1763,16 @@ void Node::ArrayResizeInternal(const QString &id, int size)
}
}
QString Node::GetConnectCommandString(Node *output, const NodeInput &input)
{
return tr("Connected %1 to %2 - %3").arg(output->GetLabelAndName(), input.node()->GetLabelAndName(), input.GetInputName());
}
QString Node::GetDisconnectCommandString(Node *output, const NodeInput &input)
{
return tr("Disconnected %1 from %2 - %3").arg(output->GetLabelAndName(), input.node()->GetLabelAndName(), input.GetInputName());
}
int Node::GetInternalInputArraySize(const QString &input)
{
return array_immediates_.value(input).size();
+3
View File
@@ -980,6 +980,9 @@ public:
virtual void AddedToGraphEvent(Project *p){}
virtual void RemovedFromGraphEvent(Project *p){}
static QString GetConnectCommandString(Node *output, const NodeInput &input);
static QString GetDisconnectCommandString(Node *output, const NodeInput &input);
static const QString kEnabledInput;
protected:
+9
View File
@@ -78,6 +78,15 @@ InputFlags NodeInput::GetFlags() const
}
}
QString NodeInput::GetInputName() const
{
if (IsValid()) {
return node_->GetInputName(input_);
} else {
return QString();
}
}
Node *NodeInput::GetConnectedOutput() const
{
if (IsValid()) {
+2
View File
@@ -258,6 +258,8 @@ public:
InputFlags GetFlags() const;
QString GetInputName() const;
Node *GetConnectedOutput() const;
NodeValue::Type GetDataType() const;