diff --git a/oscar/SleepLib/appsettings.h b/oscar/SleepLib/appsettings.h
index 420af546..8f5859f2 100644
--- a/oscar/SleepLib/appsettings.h
+++ b/oscar/SleepLib/appsettings.h
@@ -28,7 +28,8 @@ const QString STR_AS_GraphHeight = "GraphHeight";
const QString STR_AS_DailyPanelWidth = "DailyPanelWidth";
const QString STR_AS_RightPanelWidth = "RightPanelWidth";
const QString STR_AS_AntiAliasing = "UseAntiAliasing";
-const QString STR_AS_GraphSnapshots = "EnableGraphSnapshots";
+const QString STR_AS_GraphSnapshots = "EnableGraphSnapshots"; // Obsolete, replaced by ShowPieChart
+const QString STR_AS_ShowPieChart = "EnablePieChart";
const QString STR_AS_Animations = "AnimationsAndTransitions";
const QString STR_AS_SquareWave = "SquareWavePlots";
const QString STR_AS_OverlayType = "OverlayType";
@@ -80,7 +81,8 @@ public:
initPref(STR_AS_DailyPanelWidth, 250.0);
initPref(STR_AS_RightPanelWidth, 230.0);
m_antiAliasing=initPref(STR_AS_AntiAliasing, true).toBool();
- initPref(STR_AS_GraphSnapshots, true);
+// initPref(STR_AS_GraphSnapshots, true);
+ initPref(STR_AS_ShowPieChart, false);
m_animations = initPref(STR_AS_Animations, true).toBool();
m_squareWavePlots = initPref(STR_AS_SquareWave, false).toBool();
initPref(STR_AS_AllowYAxisScaling, true);
@@ -151,7 +153,7 @@ public:
//! \brief Returns true if AntiAliasing (the graphical smoothing method) is enabled
inline bool antiAliasing() const { return m_antiAliasing; }
//! \brief Returns true if renderPixmap function is in use, which takes snapshots of graphs
- bool graphSnapshots() const { return getPref(STR_AS_GraphSnapshots).toBool(); }
+ bool showPieChart() const { return getPref(STR_AS_ShowPieChart).toBool(); }
//! \brief Returns true if Graphical animations & Transitions will be drawn
bool animations() const { return m_animations; }
//! \brief Returns true if PixmapCaching acceleration will be used
@@ -200,7 +202,7 @@ public:
//! \brief Set to true to turn on AntiAliasing (the graphical smoothing method)
void setAntiAliasing(bool aa) { setPref(STR_AS_AntiAliasing, m_antiAliasing=aa); }
//! \brief Set to true if renderPixmap functions are in use, which takes snapshots of graphs.
- void setGraphSnapshots(bool gs) { setPref(STR_AS_GraphSnapshots, gs); }
+ void setShowPieChart(bool gs) { setPref(STR_AS_ShowPieChart, gs); }
//! \brief Set to true if Graphical animations & Transitions will be drawn
void setAnimations(bool anim) { setPref(STR_AS_Animations, m_animations=anim); }
//! \brief Set to true to use Pixmap Caching of Text and other graphics caching speedup techniques
diff --git a/oscar/daily.cpp b/oscar/daily.cpp
index 50871f99..3935d78a 100644
--- a/oscar/daily.cpp
+++ b/oscar/daily.cpp
@@ -1477,7 +1477,7 @@ void Daily::Load(QDate date)
html+="
\n";
// Show Event Breakdown pie chart
- if ((hours > 0) && AppSetting->graphSnapshots()) { // AHI Pie Chart
+ if ((hours > 0) && AppSetting->showPieChart()) { // AHI Pie Chart
if ((values[CPAP_Obstructive] + values[CPAP_Hypopnea] + values[CPAP_ClearAirway] + values[CPAP_Apnea] + values[CPAP_RERA] + values[CPAP_FlowLimit] + values[CPAP_SensAwake])>0) {
html+=" |
";
html+=QString("%1 |
").arg(tr("Event Breakdown"));
diff --git a/oscar/main.cpp b/oscar/main.cpp
index 71e6459d..e996783f 100644
--- a/oscar/main.cpp
+++ b/oscar/main.cpp
@@ -493,7 +493,7 @@ int main(int argc, char *argv[]) {
///////////////////////////////////////////////////////////////////////////////////////////
- // Initialize preferences system (Don't use p_pref before this point)
+ // Initialize preferences system (Don't use p_pref before this point!)
///////////////////////////////////////////////////////////////////////////////////////////
p_pref = new Preferences("Preferences");
p_pref->Open();
@@ -506,11 +506,8 @@ int main(int argc, char *argv[]) {
validateAllFonts();
setApplicationFont();
-// Clean up some legacy crap
-// QFile lf(p_pref->Get("{home}/Layout.xml"));
-// if (lf.exists()) {
-// lf.remove();
-// }
+ // one-time translate GraphSnapshots to ShowPieChart
+ p_pref->Rename(STR_AS_GraphSnapshots, STR_AS_ShowPieChart);
p_pref->Erase(STR_AppName);
p_pref->Erase(STR_GEN_SkipLogin);
diff --git a/oscar/mainwindow.cpp b/oscar/mainwindow.cpp
index 5f3bb66e..7f2da0ca 100644
--- a/oscar/mainwindow.cpp
+++ b/oscar/mainwindow.cpp
@@ -123,7 +123,7 @@ void MainWindow::SetupGUI()
#endif
ui->actionLine_Cursor->setChecked(AppSetting->lineCursorMode());
- ui->actionPie_Chart->setChecked(AppSetting->graphSnapshots());
+ ui->actionPie_Chart->setChecked(AppSetting->showPieChart());
ui->actionDebug->setChecked(AppSetting->showDebug());
ui->actionShow_Performance_Counters->setChecked(AppSetting->showPerformance());
@@ -211,6 +211,10 @@ void MainWindow::SetupGUI()
ui->action_Sidebar_Toggle->setChecked(b);
ui->toolBox->setVisible(b);
+ ui->actionPie_Chart->setChecked(AppSetting->showPieChart());
+
+ ui->actionDaily_Calendar->setChecked(AppSetting->calendarVisible());
+
on_tabWidget_currentChanged(0);
#ifndef REMSTAR_M_SUPPORT
@@ -2464,7 +2468,7 @@ void MainWindow::on_actionLine_Cursor_toggled(bool b)
void MainWindow::on_actionPie_Chart_toggled(bool visible)
{
- AppSetting->setGraphSnapshots(visible);
+ AppSetting->setShowPieChart(visible);
if (daily && ui->tabWidget->currentWidget() == daily) {
daily->ReloadGraphs();
}
diff --git a/oscar/mainwindow.ui b/oscar/mainwindow.ui
index 5676d96d..5062cf99 100644
--- a/oscar/mainwindow.ui
+++ b/oscar/mainwindow.ui
@@ -3068,6 +3068,9 @@ p, li { white-space: pre-wrap; }
true
+
+ true
+
Right &Sidebar
@@ -3148,7 +3151,7 @@ p, li { white-space: pre-wrap; }
true
- false
+ true
Daily Sidebar
@@ -3165,7 +3168,7 @@ p, li { white-space: pre-wrap; }
true
- false
+ true
Daily Calendar