| 825 | } |
| 826 | |
| 827 | void MemoryDialog::submitCellEdit(int row, int col) |
| 828 | { |
| 829 | auto* indexItem = m_table->item(row, 0); |
| 830 | auto* item = m_table->item(row, col); |
| 831 | if (!indexItem || !item) |
| 832 | return; |
| 833 | |
| 834 | QString commandSuffix; |
| 835 | QMap<QString, QString> kvs; |
| 836 | if (!buildMemoryFieldUpdate(col, item, commandSuffix, kvs)) |
| 837 | return; |
| 838 | |
| 839 | const int memIdx = indexItem->data(Qt::UserRole).toInt(); |
| 840 | if (col == 3 && memIdx == m_pendingEditMemoryIndex) { |
| 841 | m_pendingEditMemoryIndex = -1; |
| 842 | m_pendingEditRetries = 0; |
| 843 | } |
| 844 | RadioModel* const model = m_model; |
| 845 | const QPointer<MemoryDialog> dialogGuard(this); |
| 846 | model->sendCmdPublic(QString("memory set %1 %2").arg(memIdx).arg(commandSuffix), |
| 847 | [model, dialogGuard, memIdx, kvs](int code, const QString&) { |
| 848 | if (code == 0) { |
| 849 | model->handleMemoryStatus(memIdx, kvs); |
| 850 | return; |
| 851 | } |
| 852 | if (dialogGuard) |
| 853 | dialogGuard->populateTable(); |
| 854 | }); |
| 855 | } |
| 856 | |
| 857 | void MemoryDialog::onAdd() |
| 858 | { |
nothing calls this directly
no test coverage detected