From 1f43dbeda04a7b9733eede5e0e2c3893bf091eab Mon Sep 17 00:00:00 2001 From: Ladislav Foldyna Date: Fri, 27 Sep 2024 09:02:23 +0200 Subject: [PATCH] Stats: Added a confirmation dialog for displaying over 50k QSOs on the map --- Changelog | 1 + ui/StatisticsWidget.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/Changelog b/Changelog index 21d2a11d..3c182a29 100644 --- a/Changelog +++ b/Changelog @@ -8,6 +8,7 @@ TBC - 0.39.0 - [CHANGED] - Awards - Bands are displayed based on the Settings (issue #452) - [CHANGED] - WSJTX - More reliable detection of CQ stations (PR #471 @aa5sh) - [CHANGED] - WSJTX - SOTA/POTA/WWFF/SIG are being added to the logged QSO (PR #463 @aa5sh) +- [CHANGED] - Stats - Add a confirmation dialog for displaying over 50k QSOs on the map - Fixed WSJT-X does not emit band change if rig is disconnected (issue #447) - Fixed Wrong import of ADIF file of another log program (issue #455) - Fixed WSJTX log record is stored incorrectly if it contains non-ASCII chars(issue #458) diff --git a/ui/StatisticsWidget.cpp b/ui/StatisticsWidget.cpp index 20da7e35..b3af98aa 100644 --- a/ui/StatisticsWidget.cpp +++ b/ui/StatisticsWidget.cpp @@ -575,12 +575,15 @@ void StatisticsWidget::drawPointsOnMap(QSqlQuery &query) QList stations; + qulonglong count = 0; + while ( query.next() ) { const Gridsquare stationGrid(query.value(1).toString()); if ( stationGrid.isValid() ) { + count++; double lat = stationGrid.getLatitude(); double lon = stationGrid.getLongitude(); stations.append(QString("[\"%1\", %2, %3, %4]").arg(query.value(0).toString()) @@ -590,6 +593,16 @@ void StatisticsWidget::drawPointsOnMap(QSqlQuery &query) } } + if ( count > 50000 ) + { + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, tr("Statistics"), tr("Over 50000 QSOs. Display them?"), + QMessageBox::Yes|QMessageBox::No); + + if ( reply != QMessageBox::Yes ) + stations.clear(); + } + QString javaScript = QString("grids_confirmed = [];" "grids_worked = [];" "drawPoints([%1]);"