Tooltip in CP chart

A tooltip is now shown on the CP chart if you move
the cursor over a point in the chart. The old picker
ribbon is still shown when using left-click with
the dates and values shown in the controls.
This commit is contained in:
Mark Liversedge
2011-04-29 14:14:20 +01:00
parent 498a7e3ec4
commit 77358fd3a3
4 changed files with 99 additions and 0 deletions

View File

@@ -78,6 +78,29 @@ RideFile::seriesName(SeriesType series)
}
}
QString
RideFile::unitName(SeriesType series)
{
bool useMetricUnits = (appsettings->value(NULL, GC_UNIT).toString() == "Metric");
switch (series) {
case RideFile::secs: return QString(tr("seconds"));
case RideFile::cad: return QString(tr("rpm"));
case RideFile::hr: return QString(tr("bpm"));
case RideFile::km: return QString(useMetricUnits ? tr("km") : tr("miles"));
case RideFile::kph: return QString(useMetricUnits ? tr("kph") : tr("mph"));
case RideFile::nm: return QString(tr("N"));
case RideFile::watts: return QString(tr("watts"));
case RideFile::xPower: return QString(tr("watts"));
case RideFile::NP: return QString(tr("watts"));
case RideFile::alt: return QString(useMetricUnits ? tr("metres") : tr("feet"));
case RideFile::lon: return QString(tr("lon"));
case RideFile::lat: return QString(tr("lat"));
case RideFile::headwind: return QString(tr("kph"));
case RideFile::interval: return QString(tr("Interval"));
default: return QString(tr("Unknown"));
}
}
void
RideFile::clearIntervals()