* @brief Opens the native MQTT publisher script editor dialog. */
| 1189 | * @brief Opens the native MQTT publisher script editor dialog. |
| 1190 | */ |
| 1191 | void DataModel::ProjectEditor::openMqttScriptEditor() |
| 1192 | { |
| 1193 | #ifdef BUILD_COMMERCIAL |
| 1194 | auto& pub = MQTT::Publisher::instance(); |
| 1195 | |
| 1196 | if (!m_mqttScriptEditor) { |
| 1197 | m_mqttScriptEditor = new MQTT::PublisherScriptEditor(nullptr); |
| 1198 | |
| 1199 | connect(m_mqttScriptEditor, |
| 1200 | &MQTT::PublisherScriptEditor::scriptApplied, |
| 1201 | this, |
| 1202 | [](const QString& code, int language) { |
| 1203 | auto& publisher = MQTT::Publisher::instance(); |
| 1204 | publisher.setScriptLanguage(language); |
| 1205 | publisher.setScriptCode(code); |
| 1206 | }); |
| 1207 | } |
| 1208 | |
| 1209 | m_mqttScriptEditor->displayDialog(pub.scriptCode(), pub.scriptLanguage()); |
| 1210 | #endif |
| 1211 | } |
| 1212 | |
| 1213 | /** |
| 1214 | * @brief Returns the form model for the currently selected action. |
nothing calls this directly
no test coverage detected