| 202 | } |
| 203 | |
| 204 | ExecutableSwitchWidget::ExecutableSwitchWidget(QWidget *parent, |
| 205 | ExecutableSwitch *s) |
| 206 | : SwitchWidget(parent, s, true, true) |
| 207 | { |
| 208 | processes = new QComboBox(); |
| 209 | requiresFocus = new QCheckBox(obs_module_text( |
| 210 | "AdvSceneSwitcher.executableTab.requiresFocus")); |
| 211 | |
| 212 | QWidget::connect(processes, SIGNAL(currentTextChanged(const QString &)), |
| 213 | this, SLOT(ProcessChanged(const QString &))); |
| 214 | QWidget::connect(requiresFocus, SIGNAL(stateChanged(int)), this, |
| 215 | SLOT(FocusChanged(int))); |
| 216 | |
| 217 | PopulateProcessSelection(processes); |
| 218 | |
| 219 | processes->setEditable(true); |
| 220 | processes->setMaxVisibleItems(20); |
| 221 | |
| 222 | if (s) { |
| 223 | processes->setCurrentText(s->exe); |
| 224 | requiresFocus->setChecked(s->inFocus); |
| 225 | } |
| 226 | |
| 227 | QHBoxLayout *mainLayout = new QHBoxLayout; |
| 228 | std::unordered_map<std::string, QWidget *> widgetPlaceholders = { |
| 229 | {"{{processes}}", processes}, |
| 230 | {"{{requiresFocus}}", requiresFocus}, |
| 231 | {"{{scenes}}", scenes}, |
| 232 | {"{{transitions}}", transitions}}; |
| 233 | PlaceWidgets(obs_module_text("AdvSceneSwitcher.executableTab.entry"), |
| 234 | mainLayout, widgetPlaceholders); |
| 235 | setLayout(mainLayout); |
| 236 | |
| 237 | switchData = s; |
| 238 | |
| 239 | loading = false; |
| 240 | } |
| 241 | |
| 242 | ExecutableSwitch *ExecutableSwitchWidget::getSwitchData() |
| 243 | { |
nothing calls this directly
no test coverage detected