| 147 | } |
| 148 | |
| 149 | std::optional<ChatMessageProperty> PropertySelectionDialog::AskForPorperty( |
| 150 | const std::vector<ChatMessageProperty> ¤tProperties) |
| 151 | { |
| 152 | PropertySelectionDialog dialog(GetSettingsWindow()); |
| 153 | dialog.setWindowTitle(obs_module_text("AdvSceneSwitcher.windowTitle")); |
| 154 | |
| 155 | for (const auto ¤tProperty : 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 | |
| 181 | ChatMessageEdit::ChatMessageEdit(QWidget *parent) |
| 182 | : ListEditor(parent, false), |
nothing calls this directly
no test coverage detected