Add support for "current scene" to populateSceneSelection()

This commit is contained in:
WarmUpTill
2021-06-21 20:13:39 +02:00
committed by WarmUpTill
parent 7cfa956b80
commit 0bc15b4c2d
4 changed files with 21 additions and 10 deletions

View File

@@ -538,8 +538,8 @@ void populateProcessSelection(QComboBox *sel, bool addSelect)
sel->setCurrentIndex(0);
}
void populateSceneSelection(QComboBox *sel, bool addPrevious,
bool addSceneGroup,
void populateSceneSelection(QComboBox *sel, bool addPrevious, bool addCurrent,
bool addAny, bool addSceneGroup,
std::deque<SceneGroup> *sceneGroups, bool addSelect,
std::string selectText, bool selectable)
{
@@ -551,11 +551,6 @@ void populateSceneSelection(QComboBox *sel, bool addPrevious,
temp++;
}
if (addPrevious) {
sel->addItem(obs_module_text(
"AdvSceneSwitcher.selectPreviousScene"));
}
if (addSceneGroup && sceneGroups) {
for (auto &sg : *sceneGroups) {
sel->addItem(QString::fromStdString(sg.name));
@@ -576,6 +571,21 @@ void populateSceneSelection(QComboBox *sel, bool addPrevious,
}
}
sel->setCurrentIndex(0);
if (addPrevious) {
sel->insertItem(
1, obs_module_text(
"AdvSceneSwitcher.selectPreviousScene"));
}
if (addCurrent) {
sel->insertItem(
1,
obs_module_text("AdvSceneSwitcher.selectCurrentScene"));
}
if (addAny) {
sel->insertItem(
1, obs_module_text("AdvSceneSwitcher.selectAnyScene"));
}
}
static inline void hasFilterEnum(obs_source_t *, obs_source_t *filter,