Skip to content

Commit

Permalink
Stats: Added a confirmation dialog for displaying over 50k QSOs on th…
Browse files Browse the repository at this point in the history
…e map
  • Loading branch information
foldynl committed Sep 27, 2024
1 parent 256c74c commit 1f43dbe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions ui/StatisticsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,12 +575,15 @@ void StatisticsWidget::drawPointsOnMap(QSqlQuery &query)

QList<QString> 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())
Expand All @@ -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]);"
Expand Down

0 comments on commit 1f43dbe

Please sign in to comment.