Rework SourceSelectionWidget to support widget caching

This commit is contained in:
WarmUpTill
2025-05-20 21:37:18 +02:00
committed by WarmUpTill
parent 3dd3f576c3
commit ba3e87a761
15 changed files with 125 additions and 78 deletions

View File

@@ -235,6 +235,7 @@ static QStringList getSlideshowNames()
QStringList list;
obs_enum_sources(sourceEnum, &list);
list.sort();
return list;
}
@@ -244,7 +245,7 @@ MacroConditionSlideshowEdit::MacroConditionSlideshowEdit(
_conditions(new QComboBox(this)),
_index(new VariableSpinBox(this)),
_path(new VariableLineEdit(this)),
_sources(new SourceSelectionWidget(this, QStringList(), true)),
_sources(new SourceSelectionWidget(this, getSlideshowNames, true)),
_regex(new RegexConfigWidget(this)),
_layout(new QHBoxLayout())
{
@@ -253,10 +254,6 @@ MacroConditionSlideshowEdit::MacroConditionSlideshowEdit(
_index->setMinimum(1);
populateConditionSelection(_conditions);
auto sources = getSlideshowNames();
sources.sort();
_sources->SetSourceNameList(sources);
QWidget::connect(_conditions, SIGNAL(currentIndexChanged(int)), this,
SLOT(ConditionChanged(int)));
QWidget::connect(_sources,