| 269 | } |
| 270 | |
| 271 | MacroConditionSourceEdit::MacroConditionSourceEdit( |
| 272 | QWidget *parent, std::shared_ptr<MacroConditionSource> entryData) |
| 273 | : QWidget(parent), |
| 274 | _sources(new SourceSelectionWidget(this, getSourcesList, true)), |
| 275 | _conditions(new QComboBox()), |
| 276 | _getSettings(new QPushButton(obs_module_text( |
| 277 | "AdvSceneSwitcher.condition.source.getSettings"))), |
| 278 | _settings(new VariableTextEdit(this)), |
| 279 | _regex(new RegexConfigWidget(parent)), |
| 280 | _settingSelection(new SourceSettingSelection()), |
| 281 | _refreshSettingSelection(new QPushButton(obs_module_text( |
| 282 | "AdvSceneSwitcher.condition.source.refresh"))), |
| 283 | _size(new VariableSpinBox(this)), |
| 284 | _sizeCompareMethods(new QComboBox()), |
| 285 | _includeDefaults(new QCheckBox( |
| 286 | obs_module_text( |
| 287 | "AdvSceneSwitcher.condition.source.includeDefaults"), |
| 288 | this)) |
| 289 | { |
| 290 | populateSelection(_conditions, sourceConditionTypes); |
| 291 | populateSelection(_sizeCompareMethods, compareMethods); |
| 292 | |
| 293 | _refreshSettingSelection->setToolTip(obs_module_text( |
| 294 | "AdvSceneSwitcher.condition.source.refresh.tooltip")); |
| 295 | _size->setMaximum(999999); |
| 296 | |
| 297 | QWidget::connect(_sources, |
| 298 | SIGNAL(SourceChanged(const SourceSelection &)), this, |
| 299 | SLOT(SourceChanged(const SourceSelection &))); |
| 300 | QWidget::connect(_conditions, SIGNAL(currentIndexChanged(int)), this, |
| 301 | SLOT(ConditionChanged(int))); |
| 302 | QWidget::connect(_getSettings, SIGNAL(clicked()), this, |
| 303 | SLOT(GetSettingsClicked())); |
| 304 | QWidget::connect(_settings, SIGNAL(textChanged()), this, |
| 305 | SLOT(SettingsChanged())); |
| 306 | QWidget::connect(_regex, |
| 307 | SIGNAL(RegexConfigChanged(const RegexConfig &)), this, |
| 308 | SLOT(RegexChanged(const RegexConfig &))); |
| 309 | QWidget::connect(_settingSelection, |
| 310 | SIGNAL(SelectionChanged(const SourceSetting &)), this, |
| 311 | SLOT(SettingSelectionChanged(const SourceSetting &))); |
| 312 | QWidget::connect(_refreshSettingSelection, SIGNAL(clicked()), this, |
| 313 | SLOT(RefreshVariableSourceSelectionValue())); |
| 314 | QWidget::connect( |
| 315 | _size, |
| 316 | SIGNAL(NumberVariableChanged(const NumberVariable<int> &)), |
| 317 | this, SLOT(SizeChanged(const NumberVariable<int> &))); |
| 318 | QWidget::connect(_sizeCompareMethods, SIGNAL(currentIndexChanged(int)), |
| 319 | this, SLOT(CompareMethodChanged(int))); |
| 320 | QWidget::connect(_includeDefaults, SIGNAL(stateChanged(int)), this, |
| 321 | SLOT(IncludeDefaultsChanged(int))); |
| 322 | |
| 323 | auto line1Layout = new QHBoxLayout; |
| 324 | line1Layout->setContentsMargins(0, 0, 0, 0); |
| 325 | PlaceWidgets(obs_module_text( |
| 326 | "AdvSceneSwitcher.condition.source.entry.line1"), |
| 327 | line1Layout, |
| 328 | {{"{{sources}}", _sources}, |
nothing calls this directly
no test coverage detected