diff --git a/oscar/SleepLib/appsettings.cpp b/oscar/SleepLib/appsettings.cpp index 26af4018..c8cfd5ae 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_AllowDisableSessions, false); 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/dailySearchTab.cpp b/oscar/dailySearchTab.cpp index f9da21ae..3db02647 100644 --- a/oscar/dailySearchTab.cpp +++ b/oscar/dailySearchTab.cpp @@ -311,7 +311,9 @@ void DailySearchTab::populateControl() { commandList->addItem(calculateMaxSize(tr("Daily Duration"),ST_DAILY_USAGE)); commandList->addItem(calculateMaxSize(tr("Session Duration" ),ST_SESSION_LENGTH)); commandList->addItem(calculateMaxSize(tr("Days Skipped"),ST_DAYS_SKIPPED)); - commandList->addItem(calculateMaxSize(tr("Disabled Sessions"),ST_DISABLED_SESSIONS)); + if ( AppSetting->allowDisableSessions() ) { + commandList->addItem(calculateMaxSize(tr("Disabled Sessions"),ST_DISABLED_SESSIONS)); + } commandList->addItem(calculateMaxSize(tr("Number of Sessions"),ST_SESSIONS_QTY)); //commandList->insertSeparator(commandList->count()); // separate from events diff --git a/oscar/mainwindow.cpp b/oscar/mainwindow.cpp index 5f8e95e8..c9b570a3 100644 --- a/oscar/mainwindow.cpp +++ b/oscar/mainwindow.cpp @@ -292,6 +292,8 @@ void MainWindow::SetupGUI() ui->tabWidget->addTab(help, tr("Help Browser")); #endif setupRunning = false; + + m_allowDisableSessions = AppSetting->allowDisableSessions(); } void MainWindow::logMessage(QString msg) @@ -1398,6 +1400,12 @@ void MainWindow::on_action_Preferences_triggered() setApplicationFont(); + + if (m_allowDisableSessions != AppSetting->allowDisableSessions() ) { + m_allowDisableSessions = AppSetting->allowDisableSessions(); + reloadProfile(); + }; + if (daily) { daily->RedrawGraphs(); } diff --git a/oscar/mainwindow.h b/oscar/mainwindow.h index 2393bb76..d0ca54bb 100644 --- a/oscar/mainwindow.h +++ b/oscar/mainwindow.h @@ -404,6 +404,7 @@ private: // gGraphView *SnapshotGraph; QString bookmarkFilter; bool m_restartRequired; + bool m_allowDisableSessions = false; volatile bool m_inRecalculation; void PopulatePurgeMenu();