mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-11 19:58:49 -05:00
Cleanup
This commit is contained in:
@@ -279,11 +279,7 @@ void MacroActionSequenceEdit::MacroRemove(const QString &)
|
||||
|
||||
void MacroActionSequenceEdit::Add(const std::string &name)
|
||||
{
|
||||
if (_loading || !_entryData) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
MacroRef macro(name);
|
||||
_entryData->_macros.push_back(macro);
|
||||
adjustSize();
|
||||
@@ -291,39 +287,27 @@ void MacroActionSequenceEdit::Add(const std::string &name)
|
||||
|
||||
void MacroActionSequenceEdit::Remove(int idx)
|
||||
{
|
||||
if (_loading || !_entryData) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_macros.erase(std::next(_entryData->_macros.begin(), idx));
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
void MacroActionSequenceEdit::Up(int idx)
|
||||
{
|
||||
if (_loading || !_entryData) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
std::swap(_entryData->_macros[idx], _entryData->_macros[idx - 1]);
|
||||
}
|
||||
|
||||
void MacroActionSequenceEdit::Down(int idx)
|
||||
{
|
||||
auto lock = LockContext();
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
std::swap(_entryData->_macros[idx], _entryData->_macros[idx + 1]);
|
||||
}
|
||||
|
||||
void MacroActionSequenceEdit::Replace(int idx, const std::string &name)
|
||||
{
|
||||
if (_loading || !_entryData) {
|
||||
return;
|
||||
}
|
||||
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
MacroRef macro(name);
|
||||
auto lock = LockContext();
|
||||
_entryData->_macros[idx] = macro;
|
||||
adjustSize();
|
||||
}
|
||||
@@ -344,11 +328,7 @@ void MacroActionSequenceEdit::ContinueFromClicked()
|
||||
|
||||
void MacroActionSequenceEdit::RestartChanged(int state)
|
||||
{
|
||||
if (_loading || !_entryData) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_restart = state;
|
||||
}
|
||||
|
||||
@@ -377,32 +357,20 @@ void MacroActionSequenceEdit::UpdateStatusLine()
|
||||
|
||||
void MacroActionSequenceEdit::ActionChanged(int value)
|
||||
{
|
||||
if (_loading || !_entryData) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_action = static_cast<MacroActionSequence::Action>(value);
|
||||
SetWidgetVisibility();
|
||||
}
|
||||
|
||||
void MacroActionSequenceEdit::MacroChanged(const QString &text)
|
||||
{
|
||||
if (_loading || !_entryData) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_macro = text;
|
||||
}
|
||||
|
||||
void MacroActionSequenceEdit::ResetIndexChanged(const NumberVariable<int> &value)
|
||||
{
|
||||
if (_loading || !_entryData) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
GUARD_LOADING_AND_LOCK();
|
||||
_entryData->_resetIndex = value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user