diff --git a/sleepyhead/SleepLib/profiles.h b/sleepyhead/SleepLib/profiles.h index 017e9b15..8ed35add 100644 --- a/sleepyhead/SleepLib/profiles.h +++ b/sleepyhead/SleepLib/profiles.h @@ -331,6 +331,7 @@ const QString STR_US_TooltipTimeout = "TooltipTimeout"; const QString STR_US_ScrollDampening = "ScrollDampening"; const QString STR_US_ShowUnknownFlags = "ShowUnknownFlags"; const QString STR_US_StatReportMode = "StatReportMode"; +const QString STR_US_LastOverviewRange = "LastOverviewRange"; // Parent class for subclasses that manipulate the profile. class ProfileSettings @@ -776,6 +777,7 @@ class UserSettings : public ProfileSettings initPref(STR_US_ScrollDampening, (int)50); initPref(STR_US_StatReportMode, 0); initPref(STR_US_ShowUnknownFlags, false); + initPref(STR_US_LastOverviewRange, 4); } UnitSystem unitSystem() const { return (UnitSystem)getPref(STR_US_UnitSystem).toInt(); } @@ -793,6 +795,7 @@ class UserSettings : public ProfileSettings int scrollDampening() const { return getPref(STR_US_ScrollDampening).toInt(); } int statReportMode() const { return getPref(STR_US_StatReportMode).toInt(); } bool showUnknownFlags() const { return getPref(STR_US_ShowUnknownFlags).toBool(); } + int lastOverviewRange() const { return getPref(STR_US_LastOverviewRange).toInt(); } void setUnitSystem(UnitSystem us) { setPref(STR_US_UnitSystem, (int)us); } void setEventWindowSize(double size) { setPref(STR_US_EventWindowSize, size); } @@ -809,6 +812,7 @@ class UserSettings : public ProfileSettings void setScrollDampening(int i) { setPref(STR_US_ScrollDampening, i); } void setStatReportMode(int i) { setPref(STR_US_StatReportMode, i); } void setShowUnknownFlags(bool b) { setPref(STR_US_ShowUnknownFlags, b); } + void setLastOverviewRange(int i) { setPref(STR_US_LastOverviewRange, i); } }; //! \brief Returns a count of all files & directories in a supplied folder diff --git a/sleepyhead/overview.cpp b/sleepyhead/overview.cpp index a6565932..e9919482 100644 --- a/sleepyhead/overview.cpp +++ b/sleepyhead/overview.cpp @@ -316,7 +316,7 @@ Overview::Overview(QWidget *parent, gGraphView *shared) : // <--- The code to the previous marker is crap AHI->setPinned(false); - ui->rangeCombo->setCurrentIndex(6); + ui->rangeCombo->setCurrentIndex(p_profile->general->lastOverviewRange()); icon_on = new QIcon(":/icons/session-on.png"); icon_off = new QIcon(":/icons/session-off.png"); SES->setRecMinY(1); @@ -579,6 +579,7 @@ void Overview::ResetGraphLayout() void Overview::on_rangeCombo_activated(int index) { + p_profile->general->setLastOverviewRange(index); ui->dateStart->setMinimumDate(p_profile->FirstDay()); ui->dateEnd->setMaximumDate(p_profile->LastDay());