timeline: implemented system of moving selections and making them undoable
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "node/block/transition/transition.h"
|
||||
#include "node/graph.h"
|
||||
#include "widget/nodeview/nodeviewundo.h"
|
||||
#include "widget/timelinewidget/timelinewidget.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
@@ -1696,4 +1697,22 @@ void TransitionRemoveCommand::undo_internal()
|
||||
track_->InvalidateCache(TimeRange(block_->in(), block_->out()), track_->block_input(), track_->block_input());
|
||||
}
|
||||
|
||||
TimelineSetSelectionsCommand::TimelineSetSelectionsCommand(TimelineWidget *timeline, const TimelineWidgetSelections &now, const TimelineWidgetSelections &old, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
timeline_(timeline),
|
||||
old_(old),
|
||||
now_(now)
|
||||
{
|
||||
}
|
||||
|
||||
void TimelineSetSelectionsCommand::redo()
|
||||
{
|
||||
timeline_->SetSelections(now_);
|
||||
}
|
||||
|
||||
void TimelineSetSelectionsCommand::undo()
|
||||
{
|
||||
timeline_->SetSelections(old_);
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
Reference in New Issue
Block a user