* @brief Applies a live-driver property edit and rebuilds the form on transport mode changes. */
| 3068 | * @brief Applies a live-driver property edit and rebuilds the form on transport mode changes. |
| 3069 | */ |
| 3070 | void DataModel::ProjectEditor::handleSourcePropertyChange(QStandardItem* item) |
| 3071 | { |
| 3072 | const QString key = item->data(ParameterKey).toString(); |
| 3073 | const QVariant val = item->data(EditableValue); |
| 3074 | IO::HAL_Driver* drv = |
| 3075 | IO::ConnectionManager::instance().driverForEditing(m_selectedSource.sourceId); |
| 3076 | if (drv) |
| 3077 | drv->setDriverProperty(key, val); |
| 3078 | |
| 3079 | DataModel::ProjectModel::instance().captureSourceSettings(m_selectedSource.sourceId); |
| 3080 | |
| 3081 | static const QStringList kModeKeys = { |
| 3082 | QStringLiteral("socketTypeIndex"), |
| 3083 | QStringLiteral("protocolIndex"), |
| 3084 | }; |
| 3085 | if (kModeKeys.contains(key)) |
| 3086 | buildSourceModel(m_selectedSource); |
| 3087 | } |
| 3088 | |
| 3089 | /** |
| 3090 | * @brief Dispatches source form edits to ProjectModel or the live driver. |
nothing calls this directly
no test coverage detected