MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / PauseEntryWidget

Method PauseEntryWidget

lib/legacy/switch-pause.cpp:304–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304PauseEntryWidget::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
355PauseEntry *PauseEntryWidget::getSwitchData()
356{

Callers

nothing calls this directly

Calls 8

populatePauseTypesFunction · 0.85
populatePauseTargetsFunction · 0.85
GetWeakSourceNameFunction · 0.85
PlaceWidgetsFunction · 0.85
obs_module_textFunction · 0.85
setCurrentTextMethod · 0.80
PopulateWindowSelectionFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected