mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 12:18:35 -05:00
Add un-/pause option to macro tab context menu
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
Some checks failed
debian-build / build (push) Has been cancelled
Check locale / ubuntu64 (push) Has been cancelled
Push to master / Check Formatting 🔍 (push) Has been cancelled
Push to master / Build Project 🧱 (push) Has been cancelled
Push to master / Create Release 🛫 (push) Has been cancelled
This commit is contained in:
@@ -745,6 +745,17 @@ void AdvSceneSwitcher::ShowMacroContextMenu(const QPoint &pos)
|
||||
remove->setDisabled(ui->macros->SelectionEmpty());
|
||||
menu.addSeparator();
|
||||
|
||||
auto pause = menu.addAction(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.pause"), this,
|
||||
&AdvSceneSwitcher::PauseSelectedMacros);
|
||||
pause->setDisabled(ui->macros->SelectionEmpty());
|
||||
|
||||
auto unpause = menu.addAction(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.unpause"), this,
|
||||
&AdvSceneSwitcher::UnpauseSelectedMacros);
|
||||
unpause->setDisabled(ui->macros->SelectionEmpty());
|
||||
menu.addSeparator();
|
||||
|
||||
auto group = menu.addAction(
|
||||
obs_module_text("AdvSceneSwitcher.macroTab.group"), ui->macros,
|
||||
&MacroTree::GroupSelectedItems);
|
||||
@@ -805,6 +816,48 @@ void AdvSceneSwitcher::CopyMacro()
|
||||
MacroSignalManager::Instance()->Add(QString::fromStdString(name));
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::PauseSelectedMacros()
|
||||
{
|
||||
auto selectedMacros = GetSelectedMacros();
|
||||
if (selectedMacros.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
for (const auto ¯o : selectedMacros) {
|
||||
if (macro->IsGroup()) {
|
||||
for (const auto &subitem :
|
||||
GetGroupMacroEntries(macro.get())) {
|
||||
subitem->SetPaused(true);
|
||||
}
|
||||
} else {
|
||||
macro->SetPaused(true);
|
||||
}
|
||||
}
|
||||
ui->macros->UpdateRunningStates();
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::UnpauseSelectedMacros()
|
||||
{
|
||||
auto selectedMacros = GetSelectedMacros();
|
||||
if (selectedMacros.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock = LockContext();
|
||||
for (const auto ¯o : selectedMacros) {
|
||||
if (macro->IsGroup()) {
|
||||
for (const auto &subitem :
|
||||
GetGroupMacroEntries(macro.get())) {
|
||||
subitem->SetPaused(false);
|
||||
}
|
||||
} else {
|
||||
macro->SetPaused(false);
|
||||
}
|
||||
}
|
||||
ui->macros->UpdateRunningStates();
|
||||
}
|
||||
|
||||
bool MacroTabIsInFocus()
|
||||
{
|
||||
return AdvSceneSwitcher::window &&
|
||||
|
||||
Reference in New Issue
Block a user