From 608c90a789b01c26d08eb3273d702774a1d25a3f Mon Sep 17 00:00:00 2001 From: Michael Morgan <84428382+aa5sh@users.noreply.github.com> Date: Fri, 18 Jul 2025 12:38:24 -0500 Subject: [PATCH 1/2] UpdateDXSpotStatus A quick example of what I would like to see. when I contact is logged update the DX Widget appropriately. So you know that status is now worked. Similar to what is currently done in the Alerts window. I find like some others I keep the DXWidget and Alerts up for different things. --- ui/DxWidget.cpp | 34 ++++++++++++++++++++++++++++++++++ ui/DxWidget.h | 1 + 2 files changed, 35 insertions(+) diff --git a/ui/DxWidget.cpp b/ui/DxWidget.cpp index 06b6794f..e66525d7 100644 --- a/ui/DxWidget.cpp +++ b/ui/DxWidget.cpp @@ -1231,8 +1231,42 @@ void DxWidget::setLastQSO(QSqlRecord qsoRecord) FCT_IDENTIFICATION; lastQSO = qsoRecord; + dxTableModel->updateWorkedStation(qsoRecord); + qWarning() << "In setLastQSO"; } +void DxTableModel::updateWorkedStation(QSqlRecord qsoRecord) //aa5sh +{ + FCT_IDENTIFICATION; + + QString callsign = qsoRecord.value("callsign").toString(); + + for (int row = 0; row < dxData.size(); ++row) + { + DxSpot &spot = dxData[row]; // Use a reference so we can modify it + if (spot.callsign == callsign) + { + qWarning() << "Updating spot" << spot.callsign << spot.freq; + + // Update the status using your dxcc lookup method + spot.status = Data::instance()->dxccStatus( + spot.dxcc.dxcc, + spot.band, + spot.modeGroupString + ); + + // Notify the view that the data for this row has changed + QModelIndex topLeft = index(row, 0); + QModelIndex bottomRight = index(row, columnCount() - 1); + emit dataChanged(topLeft, bottomRight); + + break; + } + } +} + + + void DxWidget::reloadSetting() { FCT_IDENTIFICATION; diff --git a/ui/DxWidget.h b/ui/DxWidget.h index afd2dab8..b1c4b075 100644 --- a/ui/DxWidget.h +++ b/ui/DxWidget.h @@ -43,6 +43,7 @@ class DxTableModel : public QAbstractTableModel { qint16 dedup_interval = DEDUPLICATION_TIME, double dedup_freq_tolerance = DEDUPLICATION_FREQ_TOLERANCE); const DxSpot getSpot(const QModelIndex& index) const {return dxData.at(index.row());}; + void updateWorkedStation(QSqlRecord qsoRecord); void clear(); private: From 1325a8b1a6c439b8f202a9a47f8087060eee0909 Mon Sep 17 00:00:00 2001 From: Michael Morgan <84428382+aa5sh@users.noreply.github.com> Date: Fri, 18 Jul 2025 12:40:09 -0500 Subject: [PATCH 2/2] Cleanup --- ui/DxWidget.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ui/DxWidget.cpp b/ui/DxWidget.cpp index e66525d7..1c662a94 100644 --- a/ui/DxWidget.cpp +++ b/ui/DxWidget.cpp @@ -1232,10 +1232,9 @@ void DxWidget::setLastQSO(QSqlRecord qsoRecord) lastQSO = qsoRecord; dxTableModel->updateWorkedStation(qsoRecord); - qWarning() << "In setLastQSO"; } -void DxTableModel::updateWorkedStation(QSqlRecord qsoRecord) //aa5sh +void DxTableModel::updateWorkedStation(QSqlRecord qsoRecord) { FCT_IDENTIFICATION; @@ -1243,19 +1242,15 @@ void DxTableModel::updateWorkedStation(QSqlRecord qsoRecord) //aa5sh for (int row = 0; row < dxData.size(); ++row) { - DxSpot &spot = dxData[row]; // Use a reference so we can modify it + DxSpot &spot = dxData[row]; if (spot.callsign == callsign) { - qWarning() << "Updating spot" << spot.callsign << spot.freq; - - // Update the status using your dxcc lookup method spot.status = Data::instance()->dxccStatus( spot.dxcc.dxcc, spot.band, spot.modeGroupString ); - // Notify the view that the data for this row has changed QModelIndex topLeft = index(row, 0); QModelIndex bottomRight = index(row, columnCount() - 1); emit dataChanged(topLeft, bottomRight);