diff --git a/Graphs/gGraphView.cpp b/Graphs/gGraphView.cpp index f872cd62..7d457d50 100644 --- a/Graphs/gGraphView.cpp +++ b/Graphs/gGraphView.cpp @@ -2485,6 +2485,7 @@ void gGraphView::timedRedraw(int ms) } void gGraphView::resetLayout() { + int default_height=PROFILE["GraphHeight"].toInt(); for (int i=0;isetHeight(default_height); } diff --git a/Graphs/gGraphView.h b/Graphs/gGraphView.h index 4d5f40eb..7c9bbb70 100644 --- a/Graphs/gGraphView.h +++ b/Graphs/gGraphView.h @@ -22,7 +22,7 @@ #define MAX(a,b) (((a)<(b)) ? (b) : (a)); enum FlagType { FT_Bar, FT_Dot, FT_Span }; -const int default_height=160; +//const int default_height=160; void InitGraphs(); void DoneGraphs(); diff --git a/daily.cpp b/daily.cpp index febb2a0a..dcc63675 100644 --- a/daily.cpp +++ b/daily.cpp @@ -72,6 +72,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw) layout->addWidget(GraphView,1); layout->addWidget(scrollbar,0); + int default_height=PROFILE["GraphHeight"].toInt(); SF=new gGraph(GraphView,"Event Flags",default_height); FRW=new gGraph(GraphView,"Flow Rate",default_height); AHI=new gGraph(GraphView,"AHI",default_height); @@ -79,12 +80,12 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw) PRD=new gGraph(GraphView,"Pressure",default_height); LEAK=new gGraph(GraphView,"Leak",default_height); SNORE=new gGraph(GraphView,"Snore",default_height); - RR=new gGraph(GraphView,"Respiratory Rate",default_height); + RR=new gGraph(GraphView,"Resp. Rate",default_height); TV=new gGraph(GraphView,"Tidal Volume",default_height); - MV=new gGraph(GraphView,"Minute Ventilation",default_height); - FLG=new gGraph(GraphView,"Flow Limitation",default_height); - PTB=new gGraph(GraphView,"Patient Trig. Breath",default_height); - RE=new gGraph(GraphView,"Respiratory Event",default_height); + MV=new gGraph(GraphView,"Minute Vent.",default_height); + FLG=new gGraph(GraphView,"Flow Limit.",default_height); + PTB=new gGraph(GraphView,"Patient Tr. Br.",default_height); + RE=new gGraph(GraphView,"Resp. Event",default_height); IE=new gGraph(GraphView,"I:E",default_height); TE=new gGraph(GraphView,"Te",default_height); TI=new gGraph(GraphView,"Ti",default_height); diff --git a/mainwindow.cpp b/mainwindow.cpp index 5147ef46..933998e3 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -119,6 +119,7 @@ MainWindow::MainWindow(QWidget *parent) : if (!PROFILE.Exists("SPO2DropDuration")) PROFILE["PulseChangeDuration"]=5; if (!PROFILE.Exists("PulseChangeBPM")) PROFILE["PulseChangeDuration"]=5; if (!PROFILE.Exists("PulseChangeDuration")) PROFILE["PulseChangeDuration"]=8; + if (!PROFILE.Exists("GraphHeight")) PROFILE["GraphHeight"]=180; //ui->actionUse_AntiAliasing->setChecked(PROFILE["UseAntiAliasing"].toBool()); ui->action_Link_Graph_Groups->setChecked(PROFILE["LinkGroups"].toBool()); diff --git a/overview.cpp b/overview.cpp index d2fe7900..f367de86 100644 --- a/overview.cpp +++ b/overview.cpp @@ -84,6 +84,7 @@ Overview::Overview(QWidget *parent,gGraphView * shared) : AHI=createGraph("AHI"); UC=createGraph("Usage"); + int default_height=PROFILE["GraphHeight"].toInt(); US=new gGraph(GraphView,"Session Usage",default_height,0); US->AddLayer(new gYAxisTime(),LayerLeft,gYAxis::Margin); gXAxis *x=new gXAxis(); @@ -172,6 +173,7 @@ Overview::~Overview() } gGraph * Overview::createGraph(QString name) { + int default_height=PROFILE["GraphHeight"].toInt(); gGraph *g=new gGraph(GraphView,name,default_height,0); g->AddLayer(new gYAxis(),LayerLeft,gYAxis::Margin); gXAxis *x=new gXAxis(); diff --git a/preferencesdialog.cpp b/preferencesdialog.cpp index 10006ffe..2e6c2d90 100644 --- a/preferencesdialog.cpp +++ b/preferencesdialog.cpp @@ -6,7 +6,9 @@ #include #include #include +#include #include "preferencesdialog.h" +#include "common_gui.h" #include @@ -51,6 +53,23 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) : on_maskTypeCombo_activated(i); } } + QLocale locale=QLocale::system(); + QString shortformat=locale.dateFormat(QLocale::ShortFormat); + if (!shortformat.toLower().contains("yyyy")) { + shortformat.replace("yy","yyyy"); + } + ui->startedUsingMask->setDisplayFormat(shortformat); + Qt::DayOfWeek dow=firstDayOfWeekFromLocale(); + + ui->startedUsingMask->calendarWidget()->setFirstDayOfWeek(dow); + + + // Stop both calendar drop downs highlighting weekends in red + QTextCharFormat format = ui->startedUsingMask->calendarWidget()->weekdayTextFormat(Qt::Saturday); + format.setForeground(QBrush(Qt::black, Qt::SolidPattern)); + ui->startedUsingMask->calendarWidget()->setWeekdayTextFormat(Qt::Saturday, format); + ui->startedUsingMask->calendarWidget()->setWeekdayTextFormat(Qt::Sunday, format); + //ui->leakProfile->setColumnWidth(1,ui->leakProfile->width()/2); @@ -144,6 +163,13 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) : general["SkipEmptyDays"]=Preference(p_profile,"SkipEmptyDays",PT_Checkbox,"Skip Empty Days","Skip over calendar days that don't have any data",true); general["EnableMultithreading"]=Preference(p_profile,"EnableMultithreading",PT_Checkbox,"Enable Multithreading","Try to use extra processor cores where possible",false); general["MemoryHog"]=Preference(p_profile,"MemoryHog",PT_Checkbox,"Cache Session Data","Keep session data in memory to improve load speed revisiting the date.",false); + general["GraphHeight"]=Preference(p_profile,"GraphHeight",PT_Checkbox,"Graph Height","Default Graph Height",160); + general["MaskDescription"]=Preference(p_profile,"MaskDescription",PT_Checkbox,"Mask Description","Whatever you want to record about your mask.",QString()); + general["MaskStartDate"]=Preference(p_profile,"GraphHeight",PT_Checkbox,"Graph Height","Default Graph Height",QDate::currentDate()); + + + ui->maskDescription->setText(general["MaskDescription"].value().toString()); + ui->startedUsingMask->setDate(general["MaskStartDate"].value().toDate()); ui->useAntiAliasing->setChecked(general["UseAntiAliasing"].value().toBool()); ui->useSquareWavePlots->setChecked(general["SquareWavePlots"].value().toBool()); @@ -152,6 +178,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent,Profile * _profile) : ui->skipEmptyDays->setChecked(general["SkipEmptyDays"].value().toBool()); ui->enableMultithreading->setChecked(general["EnableMultithreading"].value().toBool()); ui->cacheSessionData->setChecked(general["MemoryHog"].value().toBool()); + ui->graphHeight->setValue(general["GraphHeight"].value().toInt()); if (!PREF.Exists("Updates_AutoCheck")) PREF["Updates_AutoCheck"]=true; ui->automaticallyCheckUpdates->setChecked(PREF["Updates_AutoCheck"].toBool()); @@ -266,7 +293,9 @@ void PreferencesDialog::Save() general["SkipEmptyDays"].setValue(ui->skipEmptyDays->isChecked()); general["EnableMultithreading"].setValue(ui->enableMultithreading->isChecked()); general["MemoryHog"].setValue(ui->cacheSessionData->isChecked()); - + general["MaskDescription"].setValue(ui->maskDescription->text()); + (*profile)["MaskStartDate"]=ui->startedUsingMask->date(); + (*profile)["GraphHeight"]=ui->graphHeight->value(); if ((*profile)["CombineCloserSessions"].toInt()!=ui->combineSlider->value()) needs_restart=true; if ((*profile)["IgnoreShorterSessions"].toInt()!=ui->IgnoreSlider->value()) needs_restart=true; diff --git a/preferencesdialog.ui b/preferencesdialog.ui index 5aced710..f15a86b4 100644 --- a/preferencesdialog.ui +++ b/preferencesdialog.ui @@ -38,7 +38,7 @@ - 3 + 6 @@ -1214,13 +1214,25 @@ this application to be unstable with this feature enabled. - + 0 0 + + 50 + + + 600 + + + 10 + + + 180 +