keyframe values can now be set in graph editor
This commit is contained in:
@@ -1301,3 +1301,34 @@ void RippleAction::redo() {
|
||||
}
|
||||
ca->redo();
|
||||
}
|
||||
|
||||
SetDouble::SetDouble(double* pointer, double new_value) :
|
||||
p(pointer),
|
||||
oldval(*pointer),
|
||||
newval(new_value),
|
||||
old_project_changed(mainWindow->isWindowModified())
|
||||
{}
|
||||
|
||||
void SetDouble::undo() {
|
||||
*p = oldval;
|
||||
mainWindow->setWindowModified(old_project_changed);
|
||||
}
|
||||
|
||||
void SetDouble::redo() {
|
||||
*p = newval;
|
||||
mainWindow->setWindowModified(true);
|
||||
}
|
||||
|
||||
SetQVariant::SetQVariant(QVariant *itarget, const QVariant &iold, const QVariant &inew) :
|
||||
target(itarget),
|
||||
old_val(iold),
|
||||
new_val(inew)
|
||||
{}
|
||||
|
||||
void SetQVariant::undo() {
|
||||
*target = old_val;
|
||||
}
|
||||
|
||||
void SetQVariant::redo() {
|
||||
*target = new_val;
|
||||
}
|
||||
|
||||
@@ -524,6 +524,18 @@ private:
|
||||
bool old_project_changed;
|
||||
};
|
||||
|
||||
class SetDouble : public QUndoCommand {
|
||||
public:
|
||||
SetDouble(double* pointer, double new_value);
|
||||
void undo();
|
||||
void redo();
|
||||
private:
|
||||
double* p;
|
||||
double oldval;
|
||||
double newval;
|
||||
bool old_project_changed;
|
||||
};
|
||||
|
||||
class SetString : public QUndoCommand {
|
||||
public:
|
||||
SetString(QString* pointer, QString new_value);
|
||||
@@ -606,4 +618,15 @@ public:
|
||||
void redo();
|
||||
};
|
||||
|
||||
class SetQVariant : public QUndoCommand {
|
||||
public:
|
||||
SetQVariant(QVariant* itarget, const QVariant& iold, const QVariant& inew);
|
||||
void undo();
|
||||
void redo();
|
||||
private:
|
||||
QVariant* target;
|
||||
QVariant old_val;
|
||||
QVariant new_val;
|
||||
};
|
||||
|
||||
#endif // UNDO_H
|
||||
|
||||
Reference in New Issue
Block a user