diff --git a/oscar/SleepLib/appsettings.cpp b/oscar/SleepLib/appsettings.cpp index 721007e1..26af4018 100644 --- a/oscar/SleepLib/appsettings.cpp +++ b/oscar/SleepLib/appsettings.cpp @@ -34,7 +34,9 @@ AppWideSetting::AppWideSetting(Preferences *pref) : PrefSettings(pref) m_graphTooltips = initPref(STR_AS_GraphTooltips, true).toBool(); m_usePixmapCaching = initPref(STR_AS_UsePixmapCaching, false).toBool(); m_odt = (OverlayDisplayType)initPref(STR_AS_OverlayType, (int)ODT_Bars).toInt(); +#ifndef REMOVE_FITNESS m_olm = (OverviewLinechartModes)initPref(STR_AS_OverviewLinechartMode, (int)OLC_Bartop).toInt(); +#endif m_lineThickness=initPref(STR_AS_LineThickness, 1.0).toFloat(); m_lineCursorMode = initPref(STR_AS_LineCursorMode, true).toBool(); initPref(STR_AS_RightSidebarVisible, false); diff --git a/oscar/SleepLib/appsettings.h b/oscar/SleepLib/appsettings.h index 23b343c7..b6f75e6c 100644 --- a/oscar/SleepLib/appsettings.h +++ b/oscar/SleepLib/appsettings.h @@ -18,7 +18,12 @@ class Preferences; +#define REMOVE_FITNESS +/* valid values are REMOVE_FITNESS or REMOVE_FITNESS_OFF */ + +#ifndef REMOVE_FITNESS enum OverviewLinechartModes { OLC_Bartop, OLC_Lines }; +#endif // ApplicationWideSettings Strings @@ -33,7 +38,9 @@ const QString STR_AS_ShowPieChart = "EnablePieChart"; const QString STR_AS_Animations = "AnimationsAndTransitions"; const QString STR_AS_SquareWave = "SquareWavePlots"; const QString STR_AS_OverlayType = "OverlayType"; +#ifndef REMOVE_FITNESS const QString STR_AS_OverviewLinechartMode = "OverviewLinechartMode"; +#endif const QString STR_AS_UsePixmapCaching = "UsePixmapCaching"; const QString STR_AS_AllowYAxisScaling = "AllowYAxisScaling"; const QString STR_AS_IncludeSerial = "IncludeSerial"; @@ -82,7 +89,9 @@ public: float m_lineThickness; OverlayDisplayType m_odt; +#ifndef REMOVE_FITNESS OverviewLinechartModes m_olm; +#endif QString m_profileName, m_language; QString versionString() const { return getPref(STR_PREF_VersionString).toString(); } @@ -137,8 +146,10 @@ public: bool rightSidebarVisible() const { return getPref(STR_AS_RightSidebarVisible).toBool(); } //! \brief Returns the type of overlay flags (which are displayed over the Flow Waveform) inline OverlayDisplayType overlayType() const { return m_odt; } +#ifndef REMOVE_FITNESS //! \brief Returns the display type of Overview pages linechart inline OverviewLinechartModes overviewLinechartMode() const { return m_olm; } +#endif bool userEventPieChart() const { return getPref(STR_CS_UserEventPieChart).toBool(); } bool showSerialNumbers() const { return getPref(STR_US_ShowSerialNumbers).toBool(); } int openTabAtStart() const { return getPref(STR_US_OpenTabAtStart).toInt(); } @@ -187,7 +198,9 @@ public: //! \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) +#ifndef REMOVE_FITNESS void setOverviewLinechartMode(OverviewLinechartModes olm) { setPref(STR_AS_OverviewLinechartMode, (int)(m_olm=olm)); } +#endif //! \brief Set the pen width of line plots. void setLineThickness(float size) { setPref(STR_AS_LineThickness, m_lineThickness=size); } //! \brief Sets whether to display Line Cursor diff --git a/oscar/SleepLib/profiles.cpp b/oscar/SleepLib/profiles.cpp index 95a1947a..64217a31 100644 --- a/oscar/SleepLib/profiles.cpp +++ b/oscar/SleepLib/profiles.cpp @@ -1087,7 +1087,11 @@ int CleanupProfile(Profile *prof) << STR_AS_AntiAliasing << STR_AS_LineThickness << STR_AS_UsePixmapCaching << STR_AS_SquareWave << STR_AS_RightPanelWidth << STR_US_TooltipTimeout << STR_AS_Animations << STR_AS_AllowYAxisScaling << STR_AS_GraphTooltips - << STR_CS_UserEventPieChart << STR_AS_OverlayType << STR_AS_OverviewLinechartMode; + << STR_CS_UserEventPieChart << STR_AS_OverlayType + #ifndef REMOVE_FITNESS + << STR_AS_OverviewLinechartMode + #endif + ; int cnt = 0; for (auto & prf :migrateList) { diff --git a/oscar/daily.cpp b/oscar/daily.cpp index 3c401cd4..488727fe 100644 --- a/oscar/daily.cpp +++ b/oscar/daily.cpp @@ -136,7 +136,6 @@ Daily::Daily(QWidget *parent,gGraphView * shared) // Remove Incomplete Extras Tab //ui->tabWidget->removeTab(3); - ZombieMeterMoved=false; BookmarksChanged=false; lastcpapday=nullptr; @@ -503,6 +502,9 @@ Daily::Daily(QWidget *parent,gGraphView * shared) ui->splitter->setVisible(false); +#ifndef REMOVE_FITNESS + ZombieMeterMoved=false; + if (p_profile->general->unitSystem()==US_English) { ui->weightSpinBox->setSuffix(STR_UNIT_POUND); ui->weightSpinBox->setDecimals(0); @@ -513,6 +515,12 @@ Daily::Daily(QWidget *parent,gGraphView * shared) ui->weightSpinBox->setDecimals(1); ui->weightSpinBox->setSuffix(STR_UNIT_KG); } +#else // REMOVE_FITNESS + // hide the parent widget to make the gridlayout invisible + QWidget *myparent ; + myparent = ui->gridLayout->parentWidget(); + if(myparent) myparent->hide(); +#endif GraphView->setEmptyImage(QPixmap(":/icons/logo-md.png")); GraphView->setEmptyText(STR_Empty_NoData); @@ -926,9 +934,12 @@ void Daily::on_ReloadDay() // GraphView->fadeOut(); Unload(previous_date); } + unload_time=time.restart(); //bool fadedir=previous_date < ui->calendar->selectedDate(); +#ifndef REMOVE_FITNESS ZombieMeterMoved=false; +#endif Load(ui->calendar->selectedDate()); load_time=time.restart(); @@ -937,6 +948,9 @@ void Daily::on_ReloadDay() ui->calButton->setText(ui->calendar->selectedDate().toString(MedDateFormat)); ui->calendar->setFocus(Qt::ActiveWindowFocusReason); +#ifndef REMOVE_FITNESS + ZombieMeterMoved=false; + if (p_profile->general->unitSystem()==US_English) { ui->weightSpinBox->setSuffix(STR_UNIT_POUND); ui->weightSpinBox->setDecimals(0); @@ -947,6 +961,7 @@ void Daily::on_ReloadDay() ui->weightSpinBox->setDecimals(1); ui->weightSpinBox->setSuffix(STR_UNIT_KG); } +#endif this->setCursor(Qt::ArrowCursor); other_time=time.restart(); @@ -1882,6 +1897,7 @@ void Daily::Load(QDate date) //sl.append(tr("Starts")); //sl.append(tr("Notes")); ui->bookmarkTable->setHorizontalHeaderLabels(sl); +#ifndef REMOVE_FITNESS ui->ZombieMeter->blockSignals(true); ui->weightSpinBox->blockSignals(true); ui->ouncesSpinBox->blockSignals(true); @@ -1895,16 +1911,18 @@ void Daily::Load(QDate date) ui->BMI->display(0); ui->BMI->setVisible(false); ui->BMIlabel->setVisible(false); +#endif ui->toggleGraphs->setVisible(false); ui->toggleEvents->setVisible(false); BookmarksChanged=false; Session *journal=GetJournalSession(date); if (journal) { - bool ok; if (journal->settings.contains(Journal_Notes)) ui->JournalNotes->setHtml(journal->settings[Journal_Notes].toString()); +#ifndef REMOVE_FITNESS + bool ok; if (journal->settings.contains(Journal_Weight)) { double kg=journal->settings[Journal_Weight].toDouble(&ok); @@ -1947,6 +1965,7 @@ void Daily::Load(QDate date) ui->ZombieMeter->setValue(journal->settings[Journal_ZombieMeter].toDouble(&ok)); ui->ZombieMeter->blockSignals(false); } +#endif if (journal->settings.contains(Bookmark_Start)) { QVariantList start=journal->settings[Bookmark_Start].toList(); @@ -1984,6 +2003,7 @@ void Daily::Load(QDate date) void Daily::UnitsChanged() { +#ifndef REMOVE_FITNESS double kg; if (p_profile->general->unitSystem()==US_English) { kg=ui->weightSpinBox->value(); @@ -2005,6 +2025,7 @@ void Daily::UnitsChanged() ui->ouncesSpinBox->setVisible(false); ui->weightSpinBox->setSuffix(STR_UNIT_KG); } +#endif } void Daily::clearLastDay() @@ -2491,6 +2512,7 @@ void Daily::on_removeBookmarkButton_clicked() } mainwin->updateFavourites(); } +#ifndef REMOVE_FITNESS void Daily::on_ZombieMeter_valueChanged(int action) { Q_UNUSED(action); @@ -2503,6 +2525,7 @@ void Daily::on_ZombieMeter_valueChanged(int action) journal->SetChanged(true); mainwin->updateOverview(); } +#endif void Daily::on_bookmarkTable_itemChanged(QTableWidgetItem *item) { @@ -2510,6 +2533,7 @@ void Daily::on_bookmarkTable_itemChanged(QTableWidgetItem *item) update_Bookmarks(); } +#ifndef REMOVE_FITNESS void Daily::on_weightSpinBox_valueChanged(double arg1) { // This is called if up/down arrows are used, in which case editingFinished is @@ -2596,6 +2620,7 @@ void Daily::on_ouncesSpinBox_editingFinished() // This is functionally identical to the weightSpinBox_editingFinished, so just call that this->on_weightSpinBox_editingFinished(); } +#endif QString Daily::GetDetailsText() { diff --git a/oscar/daily.h b/oscar/daily.h index 315ae0e0..71198971 100644 --- a/oscar/daily.h +++ b/oscar/daily.h @@ -10,7 +10,6 @@ #ifndef DAILY_H #define DAILY_H - #include #include #include @@ -25,12 +24,12 @@ #include "SleepLib/profiles.h" #include "mainwindow.h" -#include "Graphs/gSummaryChart.h" #include "Graphs/gGraphView.h" #include "Graphs/gLineChart.h" #include "sessionbar.h" #include "mytextbrowser.h" + namespace Ui { class Daily; } @@ -230,7 +229,12 @@ private slots: */ void on_bookmarkTable_itemChanged(QTableWidgetItem *item); + void on_graphCombo_activated(int index); + void on_toggleGraphs_clicked(bool checked); + + +#ifndef REMOVE_FITNESS /*! \fn on_ouncesSpinBox_valueChanged(int arg1); \brief Called when the zombie slider has been moved.. Updates the BMI dislpay and journal objects. @@ -238,10 +242,6 @@ private slots: */ void on_ZombieMeter_valueChanged(int value); - void on_graphCombo_activated(int index); - - void on_toggleGraphs_clicked(bool checked); - /*! \fn on_weightSpinBox_editingFinished(); \brief Called when weight has changed.. Updates the BMI dislpay and journal objects. @@ -260,6 +260,7 @@ private slots: void on_ouncesSpinBox_valueChanged(int arg1); void on_weightSpinBox_valueChanged(double arg1); +#endif void doToggleSession(Session *); @@ -354,7 +355,9 @@ private: gLineChart *leakchart; +#ifndef REMOVE_FITNESS bool ZombieMeterMoved; +#endif bool BookmarksChanged; }; diff --git a/oscar/preferencesdialog.cpp b/oscar/preferencesdialog.cpp index aae0bda2..a2f5ea19 100644 --- a/oscar/preferencesdialog.cpp +++ b/oscar/preferencesdialog.cpp @@ -290,13 +290,18 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) : ui->updateCheckEvery->setValue(AppSetting->updateCheckFrequency()); if (AppSetting->updatesLastChecked().isValid()) { RefreshLastChecked(); - } else { + } else { ui->updateLastChecked->setText(tr("Never")); } #endif ui->overlayFlagsCombo->setCurrentIndex(AppSetting->overlayType()); + #ifndef REMOVE_FITNESS ui->overviewLinecharts->setCurrentIndex(AppSetting->overviewLinechartMode()); + #else + ui->overviewLinecharts->hide(); + ui->overviewLinechartsLabel->hide(); + #endif ui->ahiGraphWindowSize->setEnabled(false); ui->ahiGraphWindowSize->setValue(profile->cpap->AHIWindow()); @@ -883,7 +888,9 @@ bool PreferencesDialog::Save() profile->cpap->setClockDrift(s); AppSetting->setOverlayType((OverlayDisplayType)ui->overlayFlagsCombo->currentIndex()); + #ifndef REMOVE_FITNESS AppSetting->setOverviewLinechartMode((OverviewLinechartModes)ui->overviewLinecharts->currentIndex()); + #endif profile->oxi->setSpO2DropPercentage(ui->spo2Drop->value()); profile->oxi->setSpO2DropDuration(ui->spo2DropTime->value()); diff --git a/oscar/preferencesdialog.ui b/oscar/preferencesdialog.ui index fa76507d..48f0c49b 100644 --- a/oscar/preferencesdialog.ui +++ b/oscar/preferencesdialog.ui @@ -2632,7 +2632,7 @@ Mainly affects the importer. - + Overview Linecharts