mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 19:50:45 +00:00
Remove version.h dependency from appsettings.h to reduce unnecessary recompiling.
This commit is contained in:
parent
fb32e16c96
commit
d898581ca4
59
oscar/SleepLib/appsettings.cpp
Normal file
59
oscar/SleepLib/appsettings.cpp
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/* SleepLib AppSettings Initialization
|
||||||
|
*
|
||||||
|
* This isolates the initialization and its dependencies from the header file,
|
||||||
|
* which is widely included.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020 The OSCAR Team
|
||||||
|
*
|
||||||
|
* This file is subject to the terms and conditions of the GNU General Public
|
||||||
|
* License. See the file COPYING in the main directory of the sourcecode. */
|
||||||
|
|
||||||
|
#include "appsettings.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
AppWideSetting::AppWideSetting(Preferences *pref) : PrefSettings(pref)
|
||||||
|
{
|
||||||
|
// m_multithreading = initPref(STR_IS_Multithreading, idealThreads() > 1).toBool();
|
||||||
|
m_multithreading = false; // too dangerous to allow
|
||||||
|
m_showPerformance = initPref(STR_US_ShowPerformance, false).toBool();
|
||||||
|
m_showDebug = initPref(STR_US_ShowDebug, false).toBool();
|
||||||
|
initPref(STR_AS_CalendarVisible, false);
|
||||||
|
m_scrollDampening = initPref(STR_US_ScrollDampening, (int)50).toInt();
|
||||||
|
m_tooltipTimeout = initPref(STR_US_TooltipTimeout, (int)2500).toInt();
|
||||||
|
m_graphHeight=initPref(STR_AS_GraphHeight, 180).toInt();
|
||||||
|
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_IncludeSerial, false);
|
||||||
|
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);
|
||||||
|
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();
|
||||||
|
m_olm = (OverviewLinechartModes)initPref(STR_AS_OverviewLinechartMode, (int)OLC_Bartop).toInt();
|
||||||
|
m_lineThickness=initPref(STR_AS_LineThickness, 1.0).toFloat();
|
||||||
|
m_lineCursorMode = initPref(STR_AS_LineCursorMode, true).toBool();
|
||||||
|
initPref(STR_AS_RightSidebarVisible, false);
|
||||||
|
initPref(STR_CS_UserEventPieChart, false);
|
||||||
|
initPref(STR_US_ShowSerialNumbers, false);
|
||||||
|
initPref(STR_US_OpenTabAtStart, 1);
|
||||||
|
initPref(STR_US_OpenTabAfterImport, 0);
|
||||||
|
initPref(STR_US_AutoLaunchImport, false);
|
||||||
|
m_cacheSessions = initPref(STR_IS_CacheSessions, false).toBool();
|
||||||
|
initPref(STR_US_RemoveCardReminder, true);
|
||||||
|
m_profileName = initPref(STR_GEN_Profile, "").toString();
|
||||||
|
initPref(STR_GEN_AutoOpenLastUsed, true);
|
||||||
|
|
||||||
|
#ifndef NO_UPDATER
|
||||||
|
initPref(STR_GEN_UpdatesAutoCheck, true);
|
||||||
|
initPref(STR_GEN_UpdateCheckFrequency, 7);
|
||||||
|
initPref(STR_PREF_AllowEarlyUpdates, false);
|
||||||
|
initPref(STR_GEN_UpdatesLastChecked, QDateTime());
|
||||||
|
#endif
|
||||||
|
initPref(STR_PREF_VersionString, VersionString);
|
||||||
|
m_language = initPref(STR_GEN_Language, "en_US").toString();
|
||||||
|
initPref(STR_GEN_ShowAboutDialog, 0); // default to about screen, set to -1 afterwards
|
||||||
|
}
|
@ -1,7 +1,8 @@
|
|||||||
/* SleepLib AppSettings Header
|
/* SleepLib AppSettings Header
|
||||||
*
|
*
|
||||||
* This file for all settings related stuff to clean up Preferences & Profiles.
|
* This file for all settings related stuff to clean up Preferences & Profiles.
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2020 The OSCAR Team
|
||||||
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
||||||
*
|
*
|
||||||
* This file is subject to the terms and conditions of the GNU General Public
|
* This file is subject to the terms and conditions of the GNU General Public
|
||||||
@ -13,7 +14,6 @@
|
|||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "version.h"
|
|
||||||
|
|
||||||
|
|
||||||
class Preferences;
|
class Preferences;
|
||||||
@ -68,53 +68,7 @@ const QString STR_PREF_AllowEarlyUpdates = "AllowEarlyUpdates";
|
|||||||
class AppWideSetting: public PrefSettings
|
class AppWideSetting: public PrefSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AppWideSetting(Preferences *pref)
|
AppWideSetting(Preferences *pref);
|
||||||
: PrefSettings(pref)
|
|
||||||
{
|
|
||||||
// m_multithreading = initPref(STR_IS_Multithreading, idealThreads() > 1).toBool();
|
|
||||||
m_multithreading = false; // too dangerous to allow
|
|
||||||
m_showPerformance = initPref(STR_US_ShowPerformance, false).toBool();
|
|
||||||
m_showDebug = initPref(STR_US_ShowDebug, false).toBool();
|
|
||||||
initPref(STR_AS_CalendarVisible, false);
|
|
||||||
m_scrollDampening = initPref(STR_US_ScrollDampening, (int)50).toInt();
|
|
||||||
m_tooltipTimeout = initPref(STR_US_TooltipTimeout, (int)2500).toInt();
|
|
||||||
m_graphHeight=initPref(STR_AS_GraphHeight, 180).toInt();
|
|
||||||
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_IncludeSerial, false);
|
|
||||||
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);
|
|
||||||
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();
|
|
||||||
m_olm = (OverviewLinechartModes)initPref(STR_AS_OverviewLinechartMode, (int)OLC_Bartop).toInt();
|
|
||||||
m_lineThickness=initPref(STR_AS_LineThickness, 1.0).toFloat();
|
|
||||||
m_lineCursorMode = initPref(STR_AS_LineCursorMode, true).toBool();
|
|
||||||
initPref(STR_AS_RightSidebarVisible, false);
|
|
||||||
initPref(STR_CS_UserEventPieChart, false);
|
|
||||||
initPref(STR_US_ShowSerialNumbers, false);
|
|
||||||
initPref(STR_US_OpenTabAtStart, 1);
|
|
||||||
initPref(STR_US_OpenTabAfterImport, 0);
|
|
||||||
initPref(STR_US_AutoLaunchImport, false);
|
|
||||||
m_cacheSessions = initPref(STR_IS_CacheSessions, false).toBool();
|
|
||||||
initPref(STR_US_RemoveCardReminder, true);
|
|
||||||
m_profileName = initPref(STR_GEN_Profile, "").toString();
|
|
||||||
initPref(STR_GEN_AutoOpenLastUsed, true);
|
|
||||||
|
|
||||||
#ifndef NO_UPDATER
|
|
||||||
initPref(STR_GEN_UpdatesAutoCheck, true);
|
|
||||||
initPref(STR_GEN_UpdateCheckFrequency, 7);
|
|
||||||
initPref(STR_PREF_AllowEarlyUpdates, false);
|
|
||||||
initPref(STR_GEN_UpdatesLastChecked, QDateTime());
|
|
||||||
#endif
|
|
||||||
initPref(STR_PREF_VersionString, VersionString);
|
|
||||||
m_language = initPref(STR_GEN_Language, "en_US").toString();
|
|
||||||
initPref(STR_GEN_ShowAboutDialog, 0); // default to about screen, set to -1 afterwards
|
|
||||||
}
|
|
||||||
|
|
||||||
bool m_usePixmapCaching, m_antiAliasing, m_squareWavePlots,m_graphTooltips, m_lineCursorMode, m_animations;
|
bool m_usePixmapCaching, m_antiAliasing, m_squareWavePlots,m_graphTooltips, m_lineCursorMode, m_animations;
|
||||||
bool m_showPerformance, m_showDebug;
|
bool m_showPerformance, m_showDebug;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* SleepLib Profiles Implementation
|
/* SleepLib Profiles Implementation
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019 The OSCAR Team
|
* Copyright (c) 2019-2020 The OSCAR Team
|
||||||
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
||||||
*
|
*
|
||||||
* This file is subject to the terms and conditions of the GNU General Public
|
* This file is subject to the terms and conditions of the GNU General Public
|
||||||
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "translation.h"
|
#include "translation.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
extern MainWindow *mainwin;
|
extern MainWindow *mainwin;
|
||||||
Preferences *p_pref;
|
Preferences *p_pref;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/* SleepLib Session Implementation
|
/* SleepLib Session Implementation
|
||||||
* This stuff contains the base calculation smarts
|
* This stuff contains the base calculation smarts
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2019-2020 The OSCAR Team
|
||||||
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
||||||
*
|
*
|
||||||
* This file is subject to the terms and conditions of the GNU General Public
|
* This file is subject to the terms and conditions of the GNU General Public
|
||||||
@ -8,6 +9,7 @@
|
|||||||
* for more details. */
|
* for more details. */
|
||||||
|
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
|
#include "version.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@ -245,6 +245,9 @@ bool migrateFromSH(QString destDir) {
|
|||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
initializeStrings();
|
||||||
|
qDebug() << STR_TR_OSCAR + " " + getBranchVersion();
|
||||||
|
|
||||||
AutoTest::run(argc, argv);
|
AutoTest::run(argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/* Create New Profile Implementation
|
/* Create New Profile Implementation
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2019-2020 The OSCAR Team
|
||||||
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
||||||
*
|
*
|
||||||
* This file is subject to the terms and conditions of the GNU General Public
|
* This file is subject to the terms and conditions of the GNU General Public
|
||||||
@ -19,6 +20,7 @@
|
|||||||
#include "newprofile.h"
|
#include "newprofile.h"
|
||||||
#include "ui_newprofile.h"
|
#include "ui_newprofile.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
extern MainWindow *mainwin;
|
extern MainWindow *mainwin;
|
||||||
|
|
||||||
|
@ -304,6 +304,7 @@ SOURCES += \
|
|||||||
SleepLib/progressdialog.cpp \
|
SleepLib/progressdialog.cpp \
|
||||||
SleepLib/loader_plugins/cms50f37_loader.cpp \
|
SleepLib/loader_plugins/cms50f37_loader.cpp \
|
||||||
profileselector.cpp \
|
profileselector.cpp \
|
||||||
|
SleepLib/appsettings.cpp \
|
||||||
SleepLib/loader_plugins/edfparser.cpp \
|
SleepLib/loader_plugins/edfparser.cpp \
|
||||||
aboutdialog.cpp \
|
aboutdialog.cpp \
|
||||||
welcome.cpp
|
welcome.cpp
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "statistics.h"
|
#include "statistics.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "newprofile.h"
|
#include "newprofile.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
extern MainWindow * mainwin;
|
extern MainWindow * mainwin;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* Reports/Printing Module
|
/* Reports/Printing Module
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019 The OSCAR Team
|
* Copyright (c) 2019-2020 The OSCAR Team
|
||||||
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
||||||
*
|
*
|
||||||
* This file is subject to the terms and conditions of the GNU General Public
|
* This file is subject to the terms and conditions of the GNU General Public
|
||||||
@ -18,6 +18,7 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "common_gui.h"
|
#include "common_gui.h"
|
||||||
#include "SleepLib/progressdialog.h"
|
#include "SleepLib/progressdialog.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
extern MainWindow *mainwin;
|
extern MainWindow *mainwin;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* Statistics Report Generator Implementation
|
/* Statistics Report Generator Implementation
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019 The OSCAR Team
|
* Copyright (c) 2019-2020 The OSCAR Team
|
||||||
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
* Copyright (c) 2011-2018 Mark Watkins <mark@jedimark.net>
|
||||||
*
|
*
|
||||||
* This file is subject to the terms and conditions of the GNU General Public
|
* This file is subject to the terms and conditions of the GNU General Public
|
||||||
@ -22,6 +22,7 @@
|
|||||||
#include "statistics.h"
|
#include "statistics.h"
|
||||||
#include "cprogressbar.h"
|
#include "cprogressbar.h"
|
||||||
#include "SleepLib/common.h"
|
#include "SleepLib/common.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
extern MainWindow *mainwin;
|
extern MainWindow *mainwin;
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ static QString prs1OutputPath(const QString & inpath, const QString & serial, in
|
|||||||
|
|
||||||
void PRS1Tests::initTestCase(void)
|
void PRS1Tests::initTestCase(void)
|
||||||
{
|
{
|
||||||
initializeStrings();
|
|
||||||
qDebug() << STR_TR_OSCAR + " " + getBranchVersion();
|
|
||||||
QString profile_path = TESTDATA_PATH "profile/";
|
QString profile_path = TESTDATA_PATH "profile/";
|
||||||
Profiles::Create("test", &profile_path);
|
Profiles::Create("test", &profile_path);
|
||||||
|
|
||||||
|
@ -16,8 +16,6 @@ static void iterateTestCards(const QString & root, void (*action)(const QString
|
|||||||
|
|
||||||
void ResmedTests::initTestCase(void)
|
void ResmedTests::initTestCase(void)
|
||||||
{
|
{
|
||||||
initializeStrings();
|
|
||||||
qDebug() << STR_TR_OSCAR + " " + getBranchVersion();
|
|
||||||
QString profile_path = TESTDATA_PATH "profile/";
|
QString profile_path = TESTDATA_PATH "profile/";
|
||||||
Profiles::Create("test", &profile_path);
|
Profiles::Create("test", &profile_path);
|
||||||
p_pref = new Preferences("Preferences");
|
p_pref = new Preferences("Preferences");
|
||||||
|
Loading…
Reference in New Issue
Block a user