* @brief Shows a native-template picker dialog and applies the chosen template. */
| 304 | * @brief Shows a native-template picker dialog and applies the chosen template. |
| 305 | */ |
| 306 | void DataModel::FrameParserModel::selectTemplate() |
| 307 | { |
| 308 | bool ok = false; |
| 309 | const auto name = QInputDialog::getItem(nullptr, |
| 310 | tr("Select Frame Parser Template"), |
| 311 | tr("Choose a template to load:"), |
| 312 | m_templateNames, |
| 313 | templateIndex(), |
| 314 | false, |
| 315 | &ok); |
| 316 | if (!ok) |
| 317 | return; |
| 318 | |
| 319 | const int idx = m_templateNames.indexOf(name); |
| 320 | if (idx >= 0) |
| 321 | setTemplateIndex(idx); |
| 322 | } |
| 323 | |
| 324 | /** |
| 325 | * @brief Selects the template at the registry index and seeds its default parameters. |