| 302 | } |
| 303 | |
| 304 | PauseEntryWidget::PauseEntryWidget(QWidget *parent, PauseEntry *s) |
| 305 | : SwitchWidget(parent, s, false, false) |
| 306 | { |
| 307 | pauseTypes = new QComboBox(); |
| 308 | pauseTargets = new QComboBox(); |
| 309 | windows = new QComboBox(); |
| 310 | |
| 311 | QWidget::connect(pauseTypes, SIGNAL(currentIndexChanged(int)), this, |
| 312 | SLOT(PauseTypeChanged(int))); |
| 313 | QWidget::connect(pauseTargets, SIGNAL(currentIndexChanged(int)), this, |
| 314 | SLOT(PauseTargetChanged(int))); |
| 315 | QWidget::connect(windows, SIGNAL(currentTextChanged(const QString &)), |
| 316 | this, SLOT(WindowChanged(const QString &))); |
| 317 | |
| 318 | populatePauseTypes(pauseTypes); |
| 319 | populatePauseTargets(pauseTargets); |
| 320 | PopulateWindowSelection(windows); |
| 321 | |
| 322 | windows->setEditable(true); |
| 323 | windows->setMaxVisibleItems(20); |
| 324 | |
| 325 | if (s) { |
| 326 | scenes->setCurrentText(GetWeakSourceName(s->scene).c_str()); |
| 327 | pauseTypes->setCurrentIndex(static_cast<int>(s->pauseType)); |
| 328 | pauseTargets->setCurrentIndex(static_cast<int>(s->pauseTarget)); |
| 329 | windows->setCurrentText(s->window.c_str()); |
| 330 | if (s->pauseType == PauseType::Scene) { |
| 331 | windows->setDisabled(true); |
| 332 | windows->setVisible(false); |
| 333 | } else { |
| 334 | scenes->setDisabled(true); |
| 335 | scenes->setVisible(false); |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | QHBoxLayout *mainLayout = new QHBoxLayout; |
| 340 | std::unordered_map<std::string, QWidget *> widgetPlaceholders = { |
| 341 | {"{{scenes}}", scenes}, |
| 342 | {"{{pauseTypes}}", pauseTypes}, |
| 343 | {"{{pauseTargets}}", pauseTargets}, |
| 344 | {"{{windows}}", windows}}; |
| 345 | |
| 346 | PlaceWidgets(obs_module_text("AdvSceneSwitcher.pauseTab.pauseEntry"), |
| 347 | mainLayout, widgetPlaceholders); |
| 348 | setLayout(mainLayout); |
| 349 | |
| 350 | switchData = s; |
| 351 | |
| 352 | loading = false; |
| 353 | } |
| 354 | |
| 355 | PauseEntry *PauseEntryWidget::getSwitchData() |
| 356 | { |
nothing calls this directly
no test coverage detected