fix overview chart setting are removed when File->Preferences->Events OK button is pressed.

This commit is contained in:
LoudSnorer 2022-03-01 08:20:18 -05:00
parent 678659a70d
commit b6974923d2
2 changed files with 7 additions and 1 deletions

View File

@ -155,6 +155,7 @@ Overview::Overview(QWidget *parent, gGraphView *shared) :
///////////////////////////////////////////////////////////////////////////////
// Rebuild contents
///////////////////////////////////////////////////////////////////////////////
settingsLoaded=false;
RebuildGraphs(false);
ui->rangeCombo->setCurrentIndex(p_profile->general->lastOverviewRange());
@ -354,12 +355,15 @@ void Overview::RebuildGraphs(bool reset)
if (reset) {
GraphView->GetXBounds(minx, maxx);
}
if (settingsLoaded) GraphView->SaveSettings("Overview");
settingsLoaded=false;
minRangeStartDate=p_profile->LastDay(MT_CPAP);
maxRangeEndDate=minRangeStartDate.addDays(-1); // force a range change;
disconnectgSummaryCharts() ;
GraphView->trashGraphs(true); // Remove all existing graphs
CreateAllGraphs();
GraphView->LoadSettings("Overview");
settingsLoaded = true;
if (reset) {
GraphView->resetLayout();

View File

@ -154,6 +154,8 @@ class Overview : public QWidget
QHash<gSummaryChart*,gGraph*> chartsToBeMonitored;
QHash<gSummaryChart*,gGraph* > chartsEmpty;
bool settingsLoaded ;
};
#endif // OVERVIEW_H