MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / submitCellEdit

Method submitCellEdit

src/gui/MemoryDialog.cpp:827–855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

825}
826
827void 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
857void MemoryDialog::onAdd()
858{

Callers

nothing calls this directly

Calls 5

buildMemoryFieldUpdateFunction · 0.85
sendCmdPublicMethod · 0.80
handleMemoryStatusMethod · 0.80
dataMethod · 0.45
populateTableMethod · 0.45

Tested by

no test coverage detected