diff --git a/oscar/Graphs/gFlagsLine.cpp b/oscar/Graphs/gFlagsLine.cpp index f3aab8a2..1713b169 100644 --- a/oscar/Graphs/gFlagsLine.cpp +++ b/oscar/Graphs/gFlagsLine.cpp @@ -231,7 +231,7 @@ void gFlagsGroup::paint(QPainter &painter, gGraph &g, const QRegion ®ion) } // graph each session at top - if (m_sessions.size()>1 ) { + if ( AppSetting->eventFlagSessionBar() && m_sessions.size()>1 ) { QRect sessBox(0,g.top,0,sessionBarHeight()); double adjustment = width/(double)m_duration; for (const auto & sess : m_sessions) { diff --git a/oscar/SleepLib/appsettings.cpp b/oscar/SleepLib/appsettings.cpp index 26af4018..f6699ca1 100644 --- a/oscar/SleepLib/appsettings.cpp +++ b/oscar/SleepLib/appsettings.cpp @@ -27,6 +27,7 @@ AppWideSetting::AppWideSetting(Preferences *pref) : PrefSettings(pref) // initPref(STR_AS_GraphSnapshots, true); initPref(STR_AS_IncludeSerial, false); initPref(STR_AS_MonochromePrinting, false); + initPref(STR_AS_EventFlagSessionBar, true); initPref(STR_AS_ShowPieChart, false); m_animations = initPref(STR_AS_Animations, true).toBool(); m_squareWavePlots = initPref(STR_AS_SquareWave, false).toBool(); diff --git a/oscar/SleepLib/appsettings.h b/oscar/SleepLib/appsettings.h index 9146db40..0a11a2b7 100644 --- a/oscar/SleepLib/appsettings.h +++ b/oscar/SleepLib/appsettings.h @@ -46,6 +46,7 @@ const QString STR_AS_UsePixmapCaching = "UsePixmapCaching"; const QString STR_AS_AllowYAxisScaling = "AllowYAxisScaling"; const QString STR_AS_IncludeSerial = "IncludeSerial"; const QString STR_AS_MonochromePrinting = "PrintBW"; +const QString STR_AS_EventFlagSessionBar = "EventFlagSessionBar"; const QString STR_AS_GraphTooltips = "GraphTooltips"; const QString STR_AS_LineThickness = "LineThickness"; const QString STR_AS_LineCursorMode = "LineCursorMode"; @@ -137,6 +138,7 @@ public: bool includeSerial() const { return getPref(STR_AS_IncludeSerial).toBool(); } //! \brief Whether to print reports in black and white, which can be more legible on non-color printers bool monochromePrinting() const { return getPref(STR_AS_MonochromePrinting).toBool(); } + bool eventFlagSessionBar() const { return getPref(STR_AS_EventFlagSessionBar).toBool(); } //! \Allow disabling of sessions //! \brief Whether to show graph tooltips inline bool graphTooltips() const { return m_graphTooltips; } @@ -197,6 +199,7 @@ public: void setIncludeSerial(bool b) { setPref(STR_AS_IncludeSerial, b); } //! \brief Sets whether to print reports in black and white, which can be more legible on non-color printers void setMonochromePrinting(bool b) { setPref(STR_AS_MonochromePrinting, b); } + void setEventFlagSessionBar(bool b) { setPref(STR_AS_EventFlagSessionBar, b); } //! \brief Sets whether to allow double clicking on Y-Axis labels to change vertical scaling mode void setGraphTooltips(bool b) { setPref(STR_AS_GraphTooltips, m_graphTooltips=b); } //! \brief Sets the type of overlay flags (which are displayed over the Flow Waveform) diff --git a/oscar/preferencesdialog.cpp b/oscar/preferencesdialog.cpp index fcc8b1b4..697d60a2 100644 --- a/oscar/preferencesdialog.cpp +++ b/oscar/preferencesdialog.cpp @@ -241,6 +241,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) : ui->allowYAxisScaling->setChecked(AppSetting->allowYAxisScaling()); ui->includeSerial->setChecked(AppSetting->includeSerial()); ui->monochromePrinting->setChecked(AppSetting->monochromePrinting()); + ui->eventFlagSessionBar->setChecked(AppSetting->eventFlagSessionBar()); ui->complianceHours->setValue(profile->cpap->complianceHours()); ui->clinicalMode->setChecked(profile->cpap->clinicalMode()); ui->clinicalTextEdit->setPlainText(clinicalHelp()); @@ -857,6 +858,7 @@ bool PreferencesDialog::Save() AppSetting->setAllowYAxisScaling(ui->allowYAxisScaling->isChecked()); AppSetting->setIncludeSerial(ui->includeSerial->isChecked()); AppSetting->setMonochromePrinting(ui->monochromePrinting->isChecked()); + AppSetting->setEventFlagSessionBar(ui->eventFlagSessionBar->isChecked()); p_profile->cpap->setClinicalMode(ui->clinicalMode->isChecked()); AppSetting->setGraphTooltips(ui->graphTooltips->isChecked()); diff --git a/oscar/preferencesdialog.ui b/oscar/preferencesdialog.ui index 243c2512..4e206e8d 100644 --- a/oscar/preferencesdialog.ui +++ b/oscar/preferencesdialog.ui @@ -2887,6 +2887,16 @@ Try it and see if you like it. + + + + For multiple sessions, displays a thin gray line for each session at the top of the Event Flag graph. + + + Enables SessionBar in Event Flags Graph + + +