diff --git a/src/CriticalPowerWindow.cpp b/src/CriticalPowerWindow.cpp index 22a2b1437..ca32b0897 100644 --- a/src/CriticalPowerWindow.cpp +++ b/src/CriticalPowerWindow.cpp @@ -51,6 +51,18 @@ CriticalPowerWindow::CriticalPowerWindow(const QDir &home, Context *context, boo // layout reveal controls QHBoxLayout *revealLayout = new QHBoxLayout; revealLayout->setContentsMargins(0,0,0,0); + + rPercent = new QCheckBox(tr("Percentage of Best")); + rHeat = new QCheckBox("Show Heat"); + + QVBoxLayout *checks = new QVBoxLayout; + checks->addStretch(); + checks->addWidget(rPercent); + checks->addWidget(rHeat); + checks->addStretch(); + + revealLayout->addStretch(); + revealLayout->addLayout(checks); revealLayout->addStretch(); setRevealLayout(revealLayout); @@ -376,8 +388,10 @@ CriticalPowerWindow::CriticalPowerWindow(const QDir &home, Context *context, boo connect(shadeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(shadingSelected(int))); connect(shadeIntervalsCheck, SIGNAL(stateChanged(int)), this, SLOT(shadeIntervalsChanged(int))); connect(showHeatCheck, SIGNAL(stateChanged(int)), this, SLOT(showHeatChanged(int))); + connect(rHeat, SIGNAL(stateChanged(int)), this, SLOT(rHeatChanged(int))); connect(showHeatByDateCheck, SIGNAL(stateChanged(int)), this, SLOT(showHeatByDateChanged(int))); connect(showPercentCheck, SIGNAL(stateChanged(int)), this, SLOT(showPercentChanged(int))); + connect(rPercent, SIGNAL(stateChanged(int)), this, SLOT(rPercentChanged(int))); connect(dateSetting, SIGNAL(useCustomRange(DateRange)), this, SLOT(useCustomRange(DateRange))); connect(dateSetting, SIGNAL(useThruToday()), this, SLOT(useThruToday())); connect(dateSetting, SIGNAL(useStandardRange()), this, SLOT(useStandardRange())); @@ -1259,22 +1273,35 @@ void CriticalPowerWindow::showPercentChanged(int state) { cpintPlot->setShowPercent(state); + rPercent->setChecked(state); // redraw if (rangemode) dateRangeChanged(DateRange()); else cpintPlot->calculate(currentRide); } +void +CriticalPowerWindow::rPercentChanged(int check) +{ + showPercentCheck->setChecked(check); +} + void CriticalPowerWindow::showHeatChanged(int state) { cpintPlot->setShowHeat(state); + rHeat->setChecked(state); // redraw if (rangemode) dateRangeChanged(DateRange()); else cpintPlot->calculate(currentRide); } +void +CriticalPowerWindow::rHeatChanged(int check) +{ + showHeatCheck->setChecked(check); +} void CriticalPowerWindow::showHeatByDateChanged(int state) diff --git a/src/CriticalPowerWindow.h b/src/CriticalPowerWindow.h index 3681daee6..a2be501e1 100644 --- a/src/CriticalPowerWindow.h +++ b/src/CriticalPowerWindow.h @@ -86,7 +86,7 @@ class CriticalPowerWindow : public GcChartWindow } // reveal - bool hasReveal() { return false; } + bool hasReveal() { return true; } void deleteCpiFile(QString filename); @@ -218,6 +218,10 @@ class CriticalPowerWindow : public GcChartWindow void modelParametersChanged(); // we changed the intervals void modelChanged(); // we changed the model type + // reveal controls changed + void rPercentChanged(int check); + void rHeatChanged(int check); + private: void updateCpint(double minutes); void hideIntervalCurve(int index); @@ -245,6 +249,7 @@ class CriticalPowerWindow : public GcChartWindow QCheckBox *showHeatCheck; QCheckBox *showHeatByDateCheck; QCheckBox *showPercentCheck; + QCheckBox *rPercent, *rHeat; QwtPlotPicker *picker; void addSeries(); Seasons *seasons;