mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 09:05:57 -05:00
type undo / redo
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "macro-condition-edit.hpp"
|
||||
#include "macro-undo-redo.hpp"
|
||||
|
||||
#include "advanced-scene-switcher.hpp"
|
||||
#include "condition-logic.hpp"
|
||||
@@ -250,6 +251,11 @@ void MacroConditionEdit::ConditionSelectionChanged(const QString &text)
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string oldId = (*_entryData)->GetId();
|
||||
const int oldLogic = (int)(*_entryData)->GetLogicType();
|
||||
OBSDataAutoRelease oldData = obs_data_create();
|
||||
(*_entryData)->Save(oldData);
|
||||
|
||||
auto temp = DurationModifier();
|
||||
_dur->SetValue(temp);
|
||||
HeaderInfoChanged("");
|
||||
@@ -267,6 +273,12 @@ void MacroConditionEdit::ConditionSelectionChanged(const QString &text)
|
||||
(*_entryData)->PostLoad();
|
||||
RunAndClearPostLoadSteps();
|
||||
}
|
||||
|
||||
OBSDataAutoRelease newData = obs_data_create();
|
||||
(*_entryData)->Save(newData);
|
||||
RegisterSegmentTypeChangeUndoRedo(
|
||||
macro, MacroEdit::SegmentType::CONDITION, idx, oldId, oldData,
|
||||
oldLogic, id, newData, (int)(*_entryData)->GetLogicType());
|
||||
auto widget =
|
||||
MacroConditionFactory::CreateWidget(id, this, *_entryData);
|
||||
QWidget::connect(widget, SIGNAL(HeaderInfoChanged(const QString &)),
|
||||
|
||||
Reference in New Issue
Block a user