diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index 1277e1143..e2bec0d60 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -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 settings = GetApplicationSettings(); + settings->setValue(GC_RIDE_PLOT_SMOOTHING, value); recalc(); } diff --git a/src/Settings.h b/src/Settings.h index ceccaca0d..43b55920f 100644 --- a/src/Settings.h +++ b/src/Settings.h @@ -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"