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

Method AskForPorperty

plugins/twitch/chat-message-pattern.cpp:149–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149std::optional<ChatMessageProperty> PropertySelectionDialog::AskForPorperty(
150 const std::vector<ChatMessageProperty> &currentProperties)
151{
152 PropertySelectionDialog dialog(GetSettingsWindow());
153 dialog.setWindowTitle(obs_module_text("AdvSceneSwitcher.windowTitle"));
154
155 for (const auto &currentProperty : currentProperties) {
156 if (currentProperty.IsReusable()) {
157 continue;
158 }
159
160 const int idx = dialog._selection->findText(
161 currentProperty.GetLocale());
162 if (idx == -1) {
163 continue;
164 }
165
166 qobject_cast<QListView *>(dialog._selection->view())
167 ->setRowHidden(idx, true);
168 }
169
170 if (dialog.exec() != DialogCode::Accepted) {
171 return {};
172 }
173
174 const auto currentItem =
175 dialog._selection->itemData(dialog._selection->currentIndex());
176 const auto id = currentItem.toString().toStdString();
177 return ChatMessageProperty{
178 id, ChatMessageProperty::GetDefaultValue(id.c_str())};
179}
180
181ChatMessageEdit::ChatMessageEdit(QWidget *parent)
182 : ListEditor(parent, false),

Callers

nothing calls this directly

Calls 6

obs_module_textFunction · 0.85
IsReusableMethod · 0.80
GetSettingsWindowFunction · 0.50
GetLocaleMethod · 0.45
toStringMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected