| 965 | } |
| 966 | |
| 967 | void AdvSceneSwitcher::SetupGeneralTab() |
| 968 | { |
| 969 | if (switcher->switchIfNotMatching == NoMatchBehavior::SWITCH) { |
| 970 | ui->noMatchSwitch->setChecked(true); |
| 971 | ui->noMatchSwitchScene->setEnabled(true); |
| 972 | } else if (switcher->switchIfNotMatching == |
| 973 | NoMatchBehavior::NO_SWITCH) { |
| 974 | ui->noMatchDontSwitch->setChecked(true); |
| 975 | ui->noMatchSwitchScene->setEnabled(false); |
| 976 | } else { |
| 977 | ui->noMatchRandomSwitch->setChecked(true); |
| 978 | ui->noMatchSwitchScene->setEnabled(false); |
| 979 | } |
| 980 | ui->noMatchSwitchScene->SetScene(switcher->nonMatchingScene); |
| 981 | ui->noMatchSwitchScene->LockToMainCanvas(); |
| 982 | |
| 983 | connect(ui->noMatchSwitchScene, &SceneSelectionWidget::SceneChanged, |
| 984 | this, [this](const SceneSelection &scene) { |
| 985 | if (loading) { |
| 986 | return; |
| 987 | } |
| 988 | std::lock_guard<std::mutex> lock(switcher->m); |
| 989 | switcher->nonMatchingScene = scene; |
| 990 | }); |
| 991 | |
| 992 | DurationSelection *noMatchDelay = new DurationSelection(); |
| 993 | noMatchDelay->SetDuration(switcher->noMatchDelay); |
| 994 | noMatchDelay->setToolTip(obs_module_text( |
| 995 | "AdvSceneSwitcher.generalTab.generalBehavior.onNoMatchDelay.tooltip")); |
| 996 | ui->noMatchLayout->addWidget(noMatchDelay); |
| 997 | QWidget::connect(noMatchDelay, |
| 998 | SIGNAL(DurationChanged(const Duration &)), this, |
| 999 | SLOT(NoMatchDelayDurationChanged(const Duration &))); |
| 1000 | |
| 1001 | ui->checkInterval->setValue(switcher->interval); |
| 1002 | SetCheckIntervalTooLowVisibility(); |
| 1003 | |
| 1004 | ui->enableCooldown->setChecked(switcher->enableCooldown); |
| 1005 | ui->cooldownTime->setEnabled(switcher->enableCooldown); |
| 1006 | ui->cooldownTime->SetDuration(switcher->cooldown); |
| 1007 | ui->cooldownTime->setToolTip(obs_module_text( |
| 1008 | "AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint")); |
| 1009 | QWidget::connect(ui->cooldownTime, |
| 1010 | SIGNAL(DurationChanged(const Duration &)), this, |
| 1011 | SLOT(CooldownDurationChanged(const Duration &))); |
| 1012 | |
| 1013 | PopulateLogLevelSelection(ui->logLevel); |
| 1014 | ui->logLevel->setCurrentIndex( |
| 1015 | ui->logLevel->findData(static_cast<int>(GetLogLevel()))); |
| 1016 | |
| 1017 | ui->saveWindowGeo->setChecked(switcher->saveWindowGeo); |
| 1018 | ui->showTrayNotifications->setChecked( |
| 1019 | switcher->showSystemTrayNotifications); |
| 1020 | ui->uiHintsDisable->setChecked(switcher->disableHints); |
| 1021 | ui->disableComboBoxFilter->setChecked( |
| 1022 | switcher->disableFilterComboboxFilter); |
| 1023 | FilterComboBox::SetFilterBehaviourEnabled( |
| 1024 | !switcher->disableFilterComboboxFilter); |
nothing calls this directly
no test coverage detected