remember smoothing across restarts

fixes #18
This commit is contained in:
Sean Rhea
2010-01-17 20:54:47 -08:00
parent 29487ed774
commit 9509e083b7
2 changed files with 8 additions and 1 deletions

View File

@@ -191,7 +191,7 @@ AllPlot::AllPlot(QWidget *parent, MainWindow *mainWindow):
settings(NULL),
unit(0),
rideItem(NULL),
smooth(30), bydist(false),
bydist(false),
shade_zones(true),
showPowerState(0),
showHrState(Qt::Checked),
@@ -204,6 +204,10 @@ AllPlot::AllPlot(QWidget *parent, MainWindow *mainWindow):
useMetricUnits = (unit.toString() == "Metric");
smooth = settings->value(GC_RIDE_PLOT_SMOOTHING).toInt();
if (smooth < 2)
smooth = 30;
// create a background object for shading
bg = new AllPlotBackground(this);
bg->attach(this);
@@ -659,6 +663,8 @@ void
AllPlot::setSmoothing(int value)
{
smooth = value;
boost::shared_ptr<QSettings> settings = GetApplicationSettings();
settings->setValue(GC_RIDE_PLOT_SMOOTHING, value);
recalc();
}

View File

@@ -30,6 +30,7 @@
#define GC_SETTINGS_SPLITTER_SIZES "mainwindow/splitterSizes"
#define GC_SETTINGS_CALENDAR_SIZES "mainwindow/calendarSizes"
#define GC_SETTINGS_INTERVAL_METRICS "rideSummaryWindow/intervalMetrics"
#define GC_RIDE_PLOT_SMOOTHING "ridePlot/Smoothing"
#define GC_SETTINGS_INTERVAL_METRICS_DEFAULT "workout_time,total_distance,total_work,average_power,skiba_xpower,max_power,average_hr,ninety_five_percent_hr,average_cad,average_speed"
#define GC_DATETIME_FORMAT "ddd MMM dd, yyyy, hh:mm AP"
#define GC_UNIT "unit"