Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ui/StatisticsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ void StatisticsWidget::refreshGraph()
switch ( ui->statTypeSecCombo->currentIndex() )
{
case 0: // Distance
{
QString distCoef = QString::number(Gridsquare::localeDistanceCoef(locale));
stmt = QString("WITH hist AS ( "
" SELECT CAST((distance * %1)/500.00 AS INTEGER) * 500 as dist_floor, "
Expand All @@ -297,6 +298,12 @@ void StatisticsWidget::refreshGraph()
" ORDER BY 1").arg(distCoef);
break;
}
case 1: // Operator callsigns
stmt = "SELECT COALESCE(NULLIF(TRIM(operator), ''), '" + tr("Not specified") + "'), COUNT(1) "
"FROM contacts WHERE " + genericFilter.join(" AND ") + " "
"GROUP BY 1 ORDER BY 2 DESC, 1";
break;
}

qCDebug(runtime) << stmt;

Expand Down Expand Up @@ -723,6 +730,7 @@ void StatisticsWidget::setSubTypesCombo(int mainTypeIdx)
QString unit;
Gridsquare::distance2localeUnitDistance(0, unit, locale);
ui->statTypeSecCombo->addItem(tr("Distance") + QString(" [%1]").arg(unit));
ui->statTypeSecCombo->addItem(tr("Operator Callsign"));
}
break;

Expand Down