mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-09 04:30:43 +00:00
fix overview chart setting are removed when File->Preferences->Events OK button is pressed.
This commit is contained in:
parent
678659a70d
commit
b6974923d2
@ -155,6 +155,7 @@ Overview::Overview(QWidget *parent, gGraphView *shared) :
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Rebuild contents
|
// Rebuild contents
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
settingsLoaded=false;
|
||||||
RebuildGraphs(false);
|
RebuildGraphs(false);
|
||||||
|
|
||||||
ui->rangeCombo->setCurrentIndex(p_profile->general->lastOverviewRange());
|
ui->rangeCombo->setCurrentIndex(p_profile->general->lastOverviewRange());
|
||||||
@ -354,12 +355,15 @@ void Overview::RebuildGraphs(bool reset)
|
|||||||
if (reset) {
|
if (reset) {
|
||||||
GraphView->GetXBounds(minx, maxx);
|
GraphView->GetXBounds(minx, maxx);
|
||||||
}
|
}
|
||||||
|
if (settingsLoaded) GraphView->SaveSettings("Overview");
|
||||||
|
settingsLoaded=false;
|
||||||
minRangeStartDate=p_profile->LastDay(MT_CPAP);
|
minRangeStartDate=p_profile->LastDay(MT_CPAP);
|
||||||
maxRangeEndDate=minRangeStartDate.addDays(-1); // force a range change;
|
maxRangeEndDate=minRangeStartDate.addDays(-1); // force a range change;
|
||||||
disconnectgSummaryCharts() ;
|
disconnectgSummaryCharts() ;
|
||||||
GraphView->trashGraphs(true); // Remove all existing graphs
|
GraphView->trashGraphs(true); // Remove all existing graphs
|
||||||
CreateAllGraphs();
|
CreateAllGraphs();
|
||||||
|
GraphView->LoadSettings("Overview");
|
||||||
|
settingsLoaded = true;
|
||||||
|
|
||||||
if (reset) {
|
if (reset) {
|
||||||
GraphView->resetLayout();
|
GraphView->resetLayout();
|
||||||
|
@ -154,6 +154,8 @@ class Overview : public QWidget
|
|||||||
QHash<gSummaryChart*,gGraph*> chartsToBeMonitored;
|
QHash<gSummaryChart*,gGraph*> chartsToBeMonitored;
|
||||||
QHash<gSummaryChart*,gGraph* > chartsEmpty;
|
QHash<gSummaryChart*,gGraph* > chartsEmpty;
|
||||||
|
|
||||||
|
bool settingsLoaded ;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // OVERVIEW_H
|
#endif // OVERVIEW_H
|
||||||
|
Loading…
Reference in New Issue
Block a user