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

Method SetupInfoLabel

lib/utils/temp-variable.cpp:666–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

664}
665
666QString TempVariableSelection::SetupInfoLabel()
667{
668 auto currentSelection = _selection->itemData(_selection->currentIndex())
669 .value<TempVariableRef>();
670 const auto segment = currentSelection._segment.lock();
671 if (!segment) {
672 _info->setToolTip("");
673 _info->hide();
674 return "";
675 }
676
677 auto macro = segment->GetMacro();
678 if (!macro) {
679 _info->setToolTip("");
680 _info->hide();
681 return "";
682 }
683 auto var = currentSelection.GetTempVariable(macro);
684 if (!var) {
685 _info->setToolTip("");
686 _info->hide();
687 return "";
688 }
689 auto description = QString::fromStdString(var->_description);
690 std::lock_guard<std::mutex> lock(var->_lastValuesMutex);
691 if (!var->_lastValues.empty()) {
692 if (!description.isEmpty()) {
693 description += QString("\n\n");
694 }
695 description +=
696 QString(obs_module_text(
697 "AdvSceneSwitcher.tempVar.selectionInfo.lastValues")) +
698 "\n";
699 for (const auto &value : var->_lastValues) {
700 description += "\n" + QString::fromStdString(value);
701 }
702 }
703 _info->setToolTip(description);
704 _info->setVisible(!description.isEmpty());
705 return description;
706}
707
708MacroSegment *TempVariableSelection::GetSegment() const
709{

Callers

nothing calls this directly

Calls 5

obs_module_textFunction · 0.85
GetTempVariableMethod · 0.80
setToolTipMethod · 0.45
GetMacroMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected