EventFlags - SessionBar treat like permissive Mode initialization

This commit is contained in:
LoudSnorer 2023-06-17 09:27:24 -04:00
parent cfe6a94b6a
commit b63c62d2b1
5 changed files with 18 additions and 8 deletions

View File

@ -231,7 +231,7 @@ void gFlagsGroup::paint(QPainter &painter, gGraph &g, const QRegion &region)
}
// graph each session at top
if ( AppSetting->eventFlagSessionBar() && m_sessions.size()>1 ) {
if ( p_profile->appearance->eventFlagSessionBar() && m_sessions.size()>1 ) {
QRect sessBox(0,g.top,0,sessionBarHeight());
double adjustment = width/(double)m_duration;
for (const auto & sess : m_sessions) {

View File

@ -27,7 +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_EventFlagSessionBar, false);
initPref(STR_AS_ShowPieChart, false);
m_animations = initPref(STR_AS_Animations, true).toBool();
m_squareWavePlots = initPref(STR_AS_SquareWave, false).toBool();

View File

@ -46,7 +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_EventFlagSessionBar = "EventFlagSessionBar";
const QString STR_AS_GraphTooltips = "GraphTooltips";
const QString STR_AS_LineThickness = "LineThickness";
const QString STR_AS_LineCursorMode = "LineCursorMode";
@ -138,7 +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(); }
//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; }
@ -199,7 +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); }
// 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)

View File

@ -355,6 +355,8 @@ const QString STR_IS_LockSummarySessions = "LockSummarySessions";
const QString STR_IS_WarnOnUntestedMachine = "WarnOnUntestedMachine";
const QString STR_IS_WarnOnUnexpectedData = "WarnOnUnexpectedData";
//Apperance Settings
const QString STR_AS_EventFlagSessionBar = "EventFlagSessionBar";
// UserSettings Strings
const QString STR_US_UnitSystem = "UnitSystem";
@ -739,8 +741,16 @@ class AppearanceSettings : public PrefSettings
AppearanceSettings(Profile *profile)
: PrefSettings(profile)
{
m_eventFlagSessionBar = initPref(STR_AS_EventFlagSessionBar, false).toBool();
}
//Getters
bool eventFlagSessionBar() const { return m_eventFlagSessionBar; }
//Setters
void setEventFlagSessionBar(bool b) { setPref(STR_AS_EventFlagSessionBar, m_eventFlagSessionBar = b); }
bool m_eventFlagSessionBar;
};
/*! \class UserSettings

View File

@ -241,7 +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->eventFlagSessionBar->setChecked(profile->appearance->eventFlagSessionBar());
ui->complianceHours->setValue(profile->cpap->complianceHours());
ui->clinicalMode->setChecked(profile->cpap->clinicalMode());
ui->clinicalTextEdit->setPlainText(clinicalHelp());
@ -858,7 +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->appearance->setEventFlagSessionBar(ui->eventFlagSessionBar->isChecked());
p_profile->cpap->setClinicalMode(ui->clinicalMode->isChecked());
AppSetting->setGraphTooltips(ui->graphTooltips->isChecked());