diff --git a/src/blackcore/application/applicationsettings.h b/src/blackcore/application/applicationsettings.h new file mode 100644 index 000000000..d3563f063 --- /dev/null +++ b/src/blackcore/application/applicationsettings.h @@ -0,0 +1,97 @@ +/* Copyright (C) 2015 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKCORE_APPLICATION_SETTINGS_H +#define BLACKCORE_APPLICATION_SETTINGS_H + +#include "blackmisc/settingscache.h" +#include "blackconfig/buildconfig.h" +#include "blackmisc/input/actionhotkeylist.h" +#include + +namespace BlackCore +{ + namespace Application + { + //! DBus server address + struct TDBusServerAddress : public BlackMisc::TSettingTrait + { + //! \copydoc BlackMisc::TSettingTrait::key + static const char *key() { return "network/dbusserver"; } + + //! \copydoc BlackMisc::TSettingTrait::defaultValue + static const QString &defaultValue() { static const QString dv("session"); return dv; } + }; + + //! User configured hotkeys + struct TActionHotkeys : public BlackMisc::TSettingTrait + { + //! \copydoc BlackMisc::TSettingTrait::key + static const char *key() { return "application/actionhotkeys"; } + + //! \copydoc BlackMisc::TSettingTrait::isValid + static bool isValid(const BlackMisc::Input::CActionHotkeyList &value) + { + for (const auto &actionHotkey : value) + { + if (actionHotkey.getApplicableMachine().getMachineName().isEmpty() || + actionHotkey.getAction().isEmpty() || + actionHotkey.getCombination().isEmpty()) { return false; } + } + return true; + } + }; + + //! Selected simulator plugins + struct TEnabledSimulators : public BlackMisc::TSettingTrait + { + //! \copydoc BlackCore::TSettingTrait::key + static const char *key() { return "application/enabledsimulators"; } + + //! \copydoc BlackCore::TSettingTrait::defaultValue + static const QStringList &defaultValue() + { + // All default simulators + static const QStringList enabledSimulators(defaultValueImpl()); + return enabledSimulators; + } + + private: + //! Determine default value + static QStringList defaultValueImpl() + { + if (BlackConfig::CBuildConfig::isRunningOnWindows10()) + { + // On WIN10 we have no direct play, so disable FS9 as per default + return QStringList + { + QStringLiteral("org.swift-project.plugins.simulator.fsx"), + QStringLiteral("org.swift-project.plugins.simulator.xplane") + }; + } + else if (BlackConfig::CBuildConfig::isRunningOnUnixPlatform()) + { + // On UNIX we likely run XP + return QStringList { QStringLiteral("org.swift-project.plugins.simulator.xplane") }; + } + + return QStringList + { + QStringLiteral("org.swift-project.plugins.simulator.fs9"), + QStringLiteral("org.swift-project.plugins.simulator.fsx"), + QStringLiteral("org.swift-project.plugins.simulator.xplane") + }; + } + }; + } // ns +} // ns + +#endif diff --git a/src/blackcore/audio/audiosettings.h b/src/blackcore/audio/audiosettings.h new file mode 100644 index 000000000..0cf2594c8 --- /dev/null +++ b/src/blackcore/audio/audiosettings.h @@ -0,0 +1,37 @@ +/* Copyright (C) 2015 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKCORE_AUDIO_SETTINGS_H +#define BLACKCORE_AUDIO_SETTINGS_H + +#include "blackmisc/settingscache.h" +#include "blackmisc/audio/audiosettings.h" + +namespace BlackCore +{ + namespace Audio + { + //! Audio related settings + struct TSettings : public BlackMisc::TSettingTrait + { + //! \copydoc BlackMisc::TSettingTrait::key + static const char *key() { return "audio/setup"; } + + //! \copydoc BlackMisc::TSettingTrait::defaultValue + static const BlackMisc::Audio::CSettings &defaultValue() { static const BlackMisc::Audio::CSettings a; return a; } + + //! \copydoc BlackMisc::TSettingTrait::isValid + static bool isValid(const BlackMisc::Audio::CSettings &value) { Q_UNUSED(value); return true; } + }; + } // ns +} // ns + +#endif diff --git a/src/blackcore/blackcore.pro b/src/blackcore/blackcore.pro index 131e91e31..23d9d0d35 100644 --- a/src/blackcore/blackcore.pro +++ b/src/blackcore/blackcore.pro @@ -23,10 +23,12 @@ precompile_header:!isEmpty(PRECOMPILED_HEADER) { DEFINES += LOG_IN_FILE BUILD_BLACKCORE_LIB HEADERS += *.h +HEADERS += $$PWD/application/*.h +HEADERS += $$PWD/audio/*.h HEADERS += $$PWD/context/*.h HEADERS += $$PWD/data/*.h HEADERS += $$PWD/db/*.h -HEADERS += $$PWD/settings/*.h +HEADERS += $$PWD/simulator/*.h HEADERS += $$PWD/vatsim/*.h SOURCES += *.cpp @@ -34,7 +36,6 @@ SOURCES += $$PWD/context/*.cpp SOURCES += $$PWD/data/*.cpp SOURCES += $$PWD/db/*.cpp SOURCES += $$PWD/vatsim/*.cpp -SOURCES += $$PWD/settings/*.cpp LIBS *= -lvatlib DESTDIR = $$DestRoot/lib diff --git a/src/blackcore/context/contextaudioimpl.h b/src/blackcore/context/contextaudioimpl.h index 7fd19ce06..a82083a25 100644 --- a/src/blackcore/context/contextaudioimpl.h +++ b/src/blackcore/context/contextaudioimpl.h @@ -16,7 +16,7 @@ #include "blackcore/blackcoreexport.h" #include "blackcore/context/contextaudio.h" #include "blackcore/corefacadeconfig.h" -#include "blackcore/settings/audio.h" +#include "blackcore/audio/audiosettings.h" #include "blackcore/voicechannel.h" #include "blackmisc/audio/audiodeviceinfolist.h" #include "blackmisc/audio/notificationsounds.h" @@ -183,7 +183,7 @@ namespace BlackCore QHash> m_voiceChannelMapping; // settings - BlackMisc::CSetting m_audioSettings { this }; + BlackMisc::CSetting m_audioSettings { this }; }; } // namespace } // namespace diff --git a/src/blackcore/context/contextownaircraftimpl.h b/src/blackcore/context/contextownaircraftimpl.h index 973d85b93..342ead209 100644 --- a/src/blackcore/context/contextownaircraftimpl.h +++ b/src/blackcore/context/contextownaircraftimpl.h @@ -15,7 +15,7 @@ #include "blackcore/blackcoreexport.h" #include "blackcore/context/contextownaircraft.h" #include "blackcore/corefacadeconfig.h" -#include "blackcore/settings/network.h" +#include "blackcore/vatsim/vatsimsettings.h" #include "blackmisc/aviation/aircraftparts.h" #include "blackmisc/aviation/airlineicaocode.h" #include "blackmisc/aviation/atcstation.h" @@ -170,7 +170,7 @@ namespace BlackCore QString m_voiceRoom2UrlOverride; //!< overridden voice room url mutable QReadWriteLock m_lockAircraft; //!< lock aircraft - BlackMisc::CSetting m_currentNetworkServer { this }; + BlackMisc::CSetting m_currentNetworkServer { this }; //! Init my very own aircraft with some defaults, before overridden by simulator void initOwnAircraft(); diff --git a/src/blackcore/context/contextsimulatorimpl.h b/src/blackcore/context/contextsimulatorimpl.h index 58c74f1ab..986628f90 100644 --- a/src/blackcore/context/contextsimulatorimpl.h +++ b/src/blackcore/context/contextsimulatorimpl.h @@ -15,7 +15,7 @@ #include "blackcore/blackcoreexport.h" #include "blackcore/context/contextsimulator.h" #include "blackcore/corefacadeconfig.h" -#include "blackcore/settings/application.h" +#include "blackcore/application/applicationsettings.h" #include "blackcore/weathermanager.h" #include "blackmisc/aviation/airportlist.h" #include "blackmisc/identifier.h" @@ -205,7 +205,7 @@ namespace BlackCore CPluginManagerSimulator *m_plugins = nullptr; BlackMisc::CRegularThread m_listenersThread; BlackCore::CWeatherManager m_weatherManager { this }; - BlackMisc::CSetting m_enabledSimulators { this, &CContextSimulator::restoreSimulatorPlugins }; + BlackMisc::CSetting m_enabledSimulators { this, &CContextSimulator::restoreSimulatorPlugins }; }; } // namespace } // namespace diff --git a/src/blackcore/corefacade.h b/src/blackcore/corefacade.h index 9b3d32cbe..8ad0f5811 100644 --- a/src/blackcore/corefacade.h +++ b/src/blackcore/corefacade.h @@ -13,7 +13,8 @@ #define BLACKCORE_COREFACADE_H #include "blackcore/blackcoreexport.h" -#include "blackcore/settings/network.h" +#include "blackcore/application/applicationsettings.h" +#include "blackcore/vatsim/vatsimsettings.h" #include "blackmisc/identifier.h" #include "blackmisc/settingscache.h" @@ -160,7 +161,7 @@ namespace BlackCore private: bool m_init = false; //!< flag - BlackMisc::CSetting m_dbusServerAddress { this }; + BlackMisc::CSetting m_dbusServerAddress { this }; // DBus BlackMisc::CDBusServer *m_dbusServer = nullptr; diff --git a/src/blackcore/inputmanager.h b/src/blackcore/inputmanager.h index df96667f3..d49576d36 100644 --- a/src/blackcore/inputmanager.h +++ b/src/blackcore/inputmanager.h @@ -13,7 +13,7 @@ #define BLACKCORE_INPUTMANAGER_H #include "blackcore/blackcoreexport.h" -#include "blackcore/settings/application.h" +#include "blackcore/application/applicationsettings.h" #include "blackinput/joystick.h" #include "blackinput/keyboard.h" #include "blackmisc/input/hotkeycombination.h" @@ -141,7 +141,7 @@ namespace BlackCore BlackMisc::Input::CHotkeyCombination m_lastCombination; BlackMisc::Input::CHotkeyCombination m_capturedCombination; - BlackMisc::CSetting m_actionHotkeys { this, &CInputManager::ps_changeHotkeySettings }; + BlackMisc::CSetting m_actionHotkeys { this, &CInputManager::ps_changeHotkeySettings }; }; } diff --git a/src/blackcore/registermetadata.cpp b/src/blackcore/registermetadata.cpp index 3aafacc8c..1976a8729 100644 --- a/src/blackcore/registermetadata.cpp +++ b/src/blackcore/registermetadata.cpp @@ -10,7 +10,7 @@ #include "blackcore/registermetadata.h" #include "blackcore/context/contextapplication.h" #include "blackcore/db/databasereader.h" -#include "blackcore/settings/reader.h" +#include "blackcore/vatsim/vatsimsettings.h" #include "blackcore/data/globalsetup.h" #include "blackcore/data/updateinfo.h" #include "blackcore/data/vatsimsetup.h" @@ -43,6 +43,6 @@ namespace BlackCore BlackCore::Data::CUpdateInfo::registerMetadata(); BlackCore::Data::CVatsimSetup::registerMetadata(); - BlackCore::Settings::CSettingsReader::registerMetadata(); + BlackCore::Vatsim::CReaderSettings::registerMetadata(); } } // namespace diff --git a/src/blackcore/settings/application.h b/src/blackcore/settings/application.h deleted file mode 100644 index d7b995792..000000000 --- a/src/blackcore/settings/application.h +++ /dev/null @@ -1,90 +0,0 @@ -/* Copyright (C) 2015 - * swift project Community / Contributors - * - * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -//! \file - -#ifndef BLACKCORE_SETTINGS_APPLICATION_H -#define BLACKCORE_SETTINGS_APPLICATION_H - -#include "blackmisc/settingscache.h" -#include "blackconfig/buildconfig.h" -#include "blackmisc/input/actionhotkeylist.h" -#include - -namespace BlackCore -{ - namespace Settings - { - namespace Application - { - //! User configured hotkeys - struct ActionHotkeys : public BlackMisc::CSettingTrait - { - //! \copydoc BlackMisc::CSettingTrait::key - static const char *key() { return "application/actionhotkeys"; } - - //! \copydoc BlackMisc::CSettingTrait::isValid - static bool isValid(const BlackMisc::Input::CActionHotkeyList &value) - { - for (const auto &actionHotkey : value) - { - if (actionHotkey.getApplicableMachine().getMachineName().isEmpty() || - actionHotkey.getAction().isEmpty() || - actionHotkey.getCombination().isEmpty()) { return false; } - } - return true; - } - }; - - //! Selected simulator plugins - struct EnabledSimulators : public BlackMisc::CSettingTrait - { - //! \copydoc BlackCore::CSettingTrait::key - static const char *key() { return "application/enabledsimulators"; } - - //! \copydoc BlackCore::CSettingTrait::defaultValue - static const QStringList &defaultValue() - { - // All default simulators - static const QStringList enabledSimulators(defaultValueImpl()); - return enabledSimulators; - } - - private: - //! Determine default value - static QStringList defaultValueImpl() - { - if (BlackConfig::CBuildConfig::isRunningOnWindows10()) - { - // On WIN10 we have no direct play, so disable FS9 as per default - return QStringList - { - QStringLiteral("org.swift-project.plugins.simulator.fsx"), - QStringLiteral("org.swift-project.plugins.simulator.xplane") - }; - } - else if (BlackConfig::CBuildConfig::isRunningOnUnixPlatform()) - { - // On UNIX we likely run XP - return QStringList { QStringLiteral("org.swift-project.plugins.simulator.xplane") }; - } - - return QStringList - { - QStringLiteral("org.swift-project.plugins.simulator.fs9"), - QStringLiteral("org.swift-project.plugins.simulator.fsx"), - QStringLiteral("org.swift-project.plugins.simulator.xplane") - }; - } - }; - } // ns - } // ns -} // ns - -#endif diff --git a/src/blackcore/settings/audio.h b/src/blackcore/settings/audio.h deleted file mode 100644 index 25763d9f4..000000000 --- a/src/blackcore/settings/audio.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 2015 - * swift project Community / Contributors - * - * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -//! \file - -#ifndef BLACKCORE_SETTINGS_AUDIO_H -#define BLACKCORE_SETTINGS_AUDIO_H - -#include "blackmisc/settingscache.h" -#include "blackmisc/audio/settings/settingsaudio.h" - -namespace BlackCore -{ - namespace Settings - { - namespace Audio - { - //! Name of text codec to use with text in FSD protocol - struct AudioSettings : public BlackMisc::CSettingTrait - { - //! \copydoc BlackMisc::CSettingTrait::key - static const char *key() { return "audio/setup"; } - - //! \copydoc BlackMisc::CSettingTrait::defaultValue - static const BlackMisc::Audio::Settings::CSettingsAudio &defaultValue() { static const BlackMisc::Audio::Settings::CSettingsAudio a; return a; } - - //! \copydoc BlackMisc::CSettingTrait::isValid - static bool isValid(const BlackMisc::Audio::Settings::CSettingsAudio &value) { Q_UNUSED(value); return true; } - }; - } // ns - } // ns -} // ns - -#endif diff --git a/src/blackcore/settings/distributorpreferences.h b/src/blackcore/settings/distributorpreferences.h deleted file mode 100644 index 2bb8cb796..000000000 --- a/src/blackcore/settings/distributorpreferences.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 2016 - * swift project Community / Contributors - * - * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -//! \file - -#ifndef BLACKCORE_SETTINGS_DISTRIBUTORPREFERENCES_H -#define BLACKCORE_SETTINGS_DISTRIBUTORPREFERENCES_H - -#include "blackmisc/settingscache.h" -#include "blackmisc/simulation/distributorlistpreferences.h" - -namespace BlackCore -{ - namespace Settings - { - //! DBus server address - struct DistributorListPreferences : public BlackMisc::CSettingTrait - { - //! \copydoc BlackMisc::CSettingTrait::key - static const char *key() { return "mapping/distributorpreferences"; } - }; - } // ns -} // ns - -#endif diff --git a/src/blackcore/settings/network.h b/src/blackcore/settings/network.h deleted file mode 100644 index 0cc025bed..000000000 --- a/src/blackcore/settings/network.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2015 - * swift project Community / Contributors - * - * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -//! \file - -#ifndef BLACKCORE_SETTINGS_NETWORK_H -#define BLACKCORE_SETTINGS_NETWORK_H - -#include "blackmisc/settingscache.h" -#include "blackmisc/network/serverlist.h" -#include - -namespace BlackCore -{ - namespace Settings - { - namespace Network - { - //! Virtual air traffic servers - struct TrafficServers : public BlackMisc::CSettingTrait - { - //! \copydoc BlackMisc::CSettingTrait::key - static const char *key() { return "network/trafficservers"; } - }; - - //! Currently selected virtual air traffic server - struct CurrentTrafficServer : public BlackMisc::CSettingTrait - { - //! \copydoc BlackMisc::CSettingTrait::key - static const char *key() { return "network/currenttrafficserver"; } - - //! \copydoc BlackMisc::CSettingTrait::defaultValue - static const BlackMisc::Network::CServer &defaultValue() - { - using namespace BlackMisc::Network; - static const CServer dv("Testserver", "Client project testserver", "vatsim-germany.org", 6809, CUser("guest", "Guest Client project", "", "guest")); - return dv; - } - }; - - //! DBus server address - struct DBusServerAddress : public BlackMisc::CSettingTrait - { - //! \copydoc BlackMisc::CSettingTrait::key - static const char *key() { return "network/dbusserver"; } - - //! \copydoc BlackMisc::CSettingTrait::defaultValue - static const QString &defaultValue() { static const QString dv("session"); return dv; } - }; - } // ns - } // ns -} // ns - -#endif diff --git a/src/blackcore/settings/simulator.h b/src/blackcore/settings/simulator.h deleted file mode 100644 index c69bc9f4c..000000000 --- a/src/blackcore/settings/simulator.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 2016 - * swift project Community / Contributors - * - * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -//! \file - -#ifndef BLACKCORE_SETTINGS_SIMULATOR_H -#define BLACKCORE_SETTINGS_SIMULATOR_H - -#include "blackmisc/settingscache.h" -#include "blackmisc/weather/weatherscenario.h" - -namespace BlackCore -{ - namespace Settings - { - namespace Simulator - { - //! Selected weather scenario - struct SelectedWeatherScenario : public BlackMisc::CSettingTrait - { - //! \copydoc BlackCore::CSettingTrait::key - static const char *key() { return "simulator/selectedweatherscenario"; } - - //! \copydoc BlackCore::CSettingTrait::defaultValue - static const BlackMisc::Weather::CWeatherScenario &defaultValue() - { - static const BlackMisc::Weather::CWeatherScenario scenario {}; - return scenario; - } - }; - } // ns - } // ns -} // ns - -#endif diff --git a/src/blackcore/simulator/simulatorsettings.h b/src/blackcore/simulator/simulatorsettings.h new file mode 100644 index 000000000..98cd3caaf --- /dev/null +++ b/src/blackcore/simulator/simulatorsettings.h @@ -0,0 +1,46 @@ +/* Copyright (C) 2016 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKCORE_SIMULATOR_SETTINGS_H +#define BLACKCORE_SIMULATOR_SETTINGS_H + +#include "blackmisc/settingscache.h" +#include "blackmisc/weather/weatherscenario.h" +#include "blackmisc/simulation/distributorlistpreferences.h" + +namespace BlackCore +{ + namespace Simulator + { + //! Selected weather scenario + struct TSelectedWeatherScenario : public BlackMisc::TSettingTrait + { + //! \copydoc BlackCore::TSettingTrait::key + static const char *key() { return "simulator/selectedweatherscenario"; } + + //! \copydoc BlackCore::TSettingTrait::defaultValue + static const BlackMisc::Weather::CWeatherScenario &defaultValue() + { + static const BlackMisc::Weather::CWeatherScenario scenario {}; + return scenario; + } + }; + + //! Mapping preferences for model distributor list + struct TDistributorListPreferences : public BlackMisc::TSettingTrait + { + //! \copydoc BlackMisc::TSettingTrait::key + static const char *key() { return "mapping/distributorpreferences"; } + }; + } // ns +} // ns + +#endif diff --git a/src/blackcore/threadedreader.cpp b/src/blackcore/threadedreader.cpp index 94a20faff..51ed85069 100644 --- a/src/blackcore/threadedreader.cpp +++ b/src/blackcore/threadedreader.cpp @@ -20,7 +20,7 @@ using namespace BlackMisc; using namespace BlackMisc::Network; -using namespace BlackCore::Settings; +using namespace BlackCore::Vatsim; namespace BlackCore { @@ -158,21 +158,21 @@ namespace BlackCore Q_ASSERT_X(QObject::thread() == QThread::currentThread(), Q_FUNC_INFO, "Wrong object thread"); } - CSettingsReader CThreadedReader::getSettings() const + CReaderSettings CThreadedReader::getSettings() const { - return CSettingsReader::neverUpdateSettings(); + return CReaderSettings::neverUpdateSettings(); } void CThreadedReader::setInitialTime() { - const CSettingsReader s = this->getSettings(); + const CReaderSettings s = this->getSettings(); const int ms = s.getInitialTime().toMs(); this->setInterval(s.isNeverUpdate() ? -1 : ms); } void CThreadedReader::setPeriodicTime() { - const CSettingsReader s = this->getSettings(); + const CReaderSettings s = this->getSettings(); const int ms = s.getPeriodicTime().toMs(); this->setInterval(s.isNeverUpdate() ? -1 : ms); } diff --git a/src/blackcore/threadedreader.h b/src/blackcore/threadedreader.h index 1af802072..f78985f62 100644 --- a/src/blackcore/threadedreader.h +++ b/src/blackcore/threadedreader.h @@ -12,7 +12,7 @@ #ifndef BLACKCORE_THREADED_READER_H #define BLACKCORE_THREADED_READER_H -#include "blackcore/settings/reader.h" +#include "blackcore/vatsim/vatsimsettings.h" #include "blackcore/blackcoreexport.h" #include "blackmisc/logcategorylist.h" #include "blackmisc/worker.h" @@ -87,8 +87,8 @@ namespace BlackCore //! Make sure everthing runs correctly in own thread void threadAssertCheck() const; - //! Get settings, default implementation returns BlackCore::Settings::CSettingsReader::neverUpdateSettings - virtual BlackCore::Settings::CSettingsReader getSettings() const; + //! Get settings, default implementation returns BlackCore::Settings::CReaderSettings::neverUpdateSettings + virtual BlackCore::Vatsim::CReaderSettings getSettings() const; //! Set initial time void setInitialTime(); diff --git a/src/blackcore/vatsim/networkvatlib.h b/src/blackcore/vatsim/networkvatlib.h index 910dbdd7f..a94f4bc5f 100644 --- a/src/blackcore/vatsim/networkvatlib.h +++ b/src/blackcore/vatsim/networkvatlib.h @@ -14,7 +14,7 @@ #include "blackcore/blackcoreexport.h" #include "blackcore/network.h" -#include "blackcore/settings/network.h" +#include "blackcore/vatsim/vatsimsettings.h" #include "blackcore/tokenbucket.h" #include "blackmisc/aviation/aircrafticaocode.h" #include "blackmisc/aviation/aircraftparts.h" diff --git a/src/blackcore/vatsim/vatsimbookingreader.cpp b/src/blackcore/vatsim/vatsimbookingreader.cpp index 81a5a267a..79da03d94 100644 --- a/src/blackcore/vatsim/vatsimbookingreader.cpp +++ b/src/blackcore/vatsim/vatsimbookingreader.cpp @@ -60,7 +60,7 @@ namespace BlackCore // void } - Settings::CSettingsReader CVatsimBookingReader::getSettings() const + CReaderSettings CVatsimBookingReader::getSettings() const { return this->m_settings.get(); } diff --git a/src/blackcore/vatsim/vatsimbookingreader.h b/src/blackcore/vatsim/vatsimbookingreader.h index 016704c4a..db0e11979 100644 --- a/src/blackcore/vatsim/vatsimbookingreader.h +++ b/src/blackcore/vatsim/vatsimbookingreader.h @@ -48,7 +48,7 @@ namespace BlackCore //! \name BlackCore::CThreadedReader overrides //! @{ virtual void cleanup() override; - virtual BlackCore::Settings::CSettingsReader getSettings() const override; + virtual BlackCore::Vatsim::CReaderSettings getSettings() const override; //! @} private slots: @@ -60,7 +60,7 @@ namespace BlackCore void ps_read(); private: - BlackMisc::CSettingReadOnly m_settings { this }; + BlackMisc::CSettingReadOnly m_settings { this }; }; } // ns } // ns diff --git a/src/blackcore/vatsim/vatsimdatafilereader.cpp b/src/blackcore/vatsim/vatsimdatafilereader.cpp index a4b39df66..3e77e0c54 100644 --- a/src/blackcore/vatsim/vatsimdatafilereader.cpp +++ b/src/blackcore/vatsim/vatsimdatafilereader.cpp @@ -52,7 +52,6 @@ using namespace BlackMisc::Geo; using namespace BlackMisc::Simulation; using namespace BlackMisc::PhysicalQuantities; using namespace BlackCore::Data; -using namespace BlackCore::Settings; namespace BlackCore { @@ -179,7 +178,7 @@ namespace BlackCore // void } - CSettingsReader CVatsimDataFileReader::getSettings() const + CReaderSettings CVatsimDataFileReader::getSettings() const { return this->m_settings.get(); } diff --git a/src/blackcore/vatsim/vatsimdatafilereader.h b/src/blackcore/vatsim/vatsimdatafilereader.h index 72cc8039c..ab7eaf0b1 100644 --- a/src/blackcore/vatsim/vatsimdatafilereader.h +++ b/src/blackcore/vatsim/vatsimdatafilereader.h @@ -128,7 +128,7 @@ namespace BlackCore //! \name BlackCore::CThreadedReader overrides //! @{ virtual void cleanup() override; - virtual BlackCore::Settings::CSettingsReader getSettings() const override; + virtual BlackCore::Vatsim::CReaderSettings getSettings() const override; //! @} private slots: @@ -142,7 +142,7 @@ namespace BlackCore BlackMisc::Aviation::CAtcStationList m_atcStations; BlackMisc::Simulation::CSimulatedAircraftList m_aircraft; BlackMisc::CData m_lastGoodSetup { this }; - BlackMisc::CSettingReadOnly m_settings { this }; + BlackMisc::CSettingReadOnly m_settings { this }; QMap m_voiceCapabilities; //! Split line and assign values to their corresponding attribute names diff --git a/src/blackcore/vatsim/vatsimmetarreader.cpp b/src/blackcore/vatsim/vatsimmetarreader.cpp index be7d83f6e..28b96149d 100644 --- a/src/blackcore/vatsim/vatsimmetarreader.cpp +++ b/src/blackcore/vatsim/vatsimmetarreader.cpp @@ -72,7 +72,7 @@ namespace BlackCore // void } - Settings::CSettingsReader CVatsimMetarReader::getSettings() const + CReaderSettings CVatsimMetarReader::getSettings() const { return m_settings.get(); } diff --git a/src/blackcore/vatsim/vatsimmetarreader.h b/src/blackcore/vatsim/vatsimmetarreader.h index 1df9cad63..866814cdf 100644 --- a/src/blackcore/vatsim/vatsimmetarreader.h +++ b/src/blackcore/vatsim/vatsimmetarreader.h @@ -63,7 +63,7 @@ namespace BlackCore //! \name BlackCore::CThreadedReader overrides //! @{ virtual void cleanup() override; - virtual BlackCore::Settings::CSettingsReader getSettings() const override; + virtual BlackCore::Vatsim::CReaderSettings getSettings() const override; //! @} private: @@ -77,7 +77,7 @@ namespace BlackCore private: BlackMisc::Weather::CMetarDecoder m_metarDecoder; BlackMisc::Weather::CMetarList m_metars; - BlackMisc::CSettingReadOnly m_settings { this }; + BlackMisc::CSettingReadOnly m_settings { this }; }; } // ns } // ns diff --git a/src/blackcore/settings/reader.cpp b/src/blackcore/vatsim/vatsimsettings.cpp similarity index 81% rename from src/blackcore/settings/reader.cpp rename to src/blackcore/vatsim/vatsimsettings.cpp index 678f07690..05f88a3be 100644 --- a/src/blackcore/settings/reader.cpp +++ b/src/blackcore/vatsim/vatsimsettings.cpp @@ -7,23 +7,23 @@ * contained in the LICENSE file. */ -#include "reader.h" +#include "vatsimsettings.h" using namespace BlackMisc; using namespace BlackMisc::PhysicalQuantities; namespace BlackCore { - namespace Settings + namespace Vatsim { - CSettingsReader::CSettingsReader() + CReaderSettings::CReaderSettings() { } - CSettingsReader::CSettingsReader(const CTime &initialTime, const CTime &periodicTime, bool neverUpdate) : + CReaderSettings::CReaderSettings(const CTime &initialTime, const CTime &periodicTime, bool neverUpdate) : m_initialTime(initialTime), m_periodicTime(periodicTime), m_neverUpdate(neverUpdate) { } - QString CSettingsReader::convertToQString(bool i18n) const + QString CReaderSettings::convertToQString(bool i18n) const { QString s("CReaderSettings"); s.append(" ").append(this->m_initialTime.convertToQString(i18n)); @@ -31,13 +31,13 @@ namespace BlackCore return s; } - const CSettingsReader &CSettingsReader::neverUpdateSettings() + const CReaderSettings &CReaderSettings::neverUpdateSettings() { - static const CSettingsReader s(CTime{ 1.0, CTimeUnit::d()}, CTime{ 1.0, CTimeUnit::d()}, true); + static const CReaderSettings s(CTime{ 1.0, CTimeUnit::d()}, CTime{ 1.0, CTimeUnit::d()}, true); return s; } - CVariant CSettingsReader::propertyByIndex(const BlackMisc::CPropertyIndex &index) const + CVariant CReaderSettings::propertyByIndex(const BlackMisc::CPropertyIndex &index) const { if (index.isMyself()) { return CVariant::from(*this); } ColumnIndex i = index.frontCasted(); @@ -54,9 +54,9 @@ namespace BlackCore } } - void CSettingsReader::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) + void CReaderSettings::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant) { - if (index.isMyself()) { (*this) = variant.to(); return; } + if (index.isMyself()) { (*this) = variant.to(); return; } ColumnIndex i = index.frontCasted(); switch (i) { diff --git a/src/blackcore/settings/reader.h b/src/blackcore/vatsim/vatsimsettings.h similarity index 52% rename from src/blackcore/settings/reader.h rename to src/blackcore/vatsim/vatsimsettings.h index a6232825e..c6113e2a4 100644 --- a/src/blackcore/settings/reader.h +++ b/src/blackcore/vatsim/vatsimsettings.h @@ -9,22 +9,49 @@ //! \file -#ifndef BLACKCORE_SETTINGS_READER_H -#define BLACKCORE_SETTINGS_READER_H +#ifndef BLACKCORE_VATSIM_SETTINGS_H +#define BLACKCORE_VATSIM_SETTINGS_H #include "blackcore/blackcoreexport.h" #include "blackmisc/settingscache.h" #include "blackmisc/valueobject.h" #include "blackmisc/pq/time.h" +#include "blackmisc/network/serverlist.h" namespace BlackCore { - namespace Settings + namespace Vatsim { + /*! + * Virtual air traffic servers + */ + struct TTrafficServers : public BlackMisc::TSettingTrait + { + //! \copydoc BlackMisc::TSettingTrait::key + static const char *key() { return "network/trafficservers"; } + }; + + /*! + * Currently selected virtual air traffic server + */ + struct TCurrentTrafficServer : public BlackMisc::TSettingTrait + { + //! \copydoc BlackMisc::TSettingTrait::key + static const char *key() { return "network/currenttrafficserver"; } + + //! \copydoc BlackMisc::TSettingTrait::defaultValue + static const BlackMisc::Network::CServer &defaultValue() + { + using namespace BlackMisc::Network; + static const CServer dv("Testserver", "Client project testserver", "vatsim-germany.org", 6809, CUser("guest", "Guest Client project", "", "guest")); + return dv; + } + }; + /*! * Settings used with readers */ - class BLACKCORE_EXPORT CSettingsReader : public BlackMisc::CValueObject + class BLACKCORE_EXPORT CReaderSettings : public BlackMisc::CValueObject { public: //! Properties by index @@ -36,10 +63,10 @@ namespace BlackCore }; //! Default constructor. - CSettingsReader(); + CReaderSettings(); //! Simplified constructor - CSettingsReader(const BlackMisc::PhysicalQuantities::CTime &initialTime, const BlackMisc::PhysicalQuantities::CTime &periodicTime, bool neverUpdate = false); + CReaderSettings(const BlackMisc::PhysicalQuantities::CTime &initialTime, const BlackMisc::PhysicalQuantities::CTime &periodicTime, bool neverUpdate = false); //! Get time const BlackMisc::PhysicalQuantities::CTime &getInitialTime() const { return m_initialTime; } @@ -66,7 +93,7 @@ namespace BlackCore QString convertToQString(bool i18n = false) const; //! Settings used when a reader is manually triggered and never updates - static const CSettingsReader &neverUpdateSettings(); + static const CReaderSettings &neverUpdateSettings(); private: BlackMisc::PhysicalQuantities::CTime m_initialTime { 30.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}; @@ -74,7 +101,7 @@ namespace BlackCore bool m_neverUpdate = false; BLACK_METACLASS( - CSettingsReader, + CReaderSettings, BLACK_METAMEMBER(initialTime), BLACK_METAMEMBER(periodicTime), BLACK_METAMEMBER(neverUpdate) @@ -82,51 +109,51 @@ namespace BlackCore }; //! Reader settings - struct SettingsVatsimBookings : public BlackMisc::CSettingTrait + struct TVatsimBookings : public BlackMisc::TSettingTrait { - //! \copydoc BlackCore::CSettingTrait::key + //! \copydoc BlackCore::TSettingTrait::key static const char *key() { return "vatsimreaders/bookings"; } - //! \copydoc BlackCore::CSettingTrait::defaultValue - static const BlackCore::Settings::CSettingsReader &defaultValue() + //! \copydoc BlackCore::TSettingTrait::defaultValue + static const BlackCore::Vatsim::CReaderSettings &defaultValue() { - static const BlackCore::Settings::CSettingsReader reader {{30.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}, {120.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}}; + static const BlackCore::Vatsim::CReaderSettings reader {{30.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}, {120.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}}; return reader; } }; //! Reader settings - struct SettingsVatsimDataFile : public BlackMisc::CSettingTrait + struct TVatsimDataFile : public BlackMisc::TSettingTrait { - //! \copydoc BlackCore::CSettingTrait::key + //! \copydoc BlackCore::TSettingTrait::key static const char *key() { return "vatsimreaders/datafile"; } - //! \copydoc BlackCore::CSettingTrait::defaultValue - static const BlackCore::Settings::CSettingsReader &defaultValue() + //! \copydoc BlackCore::TSettingTrait::defaultValue + static const BlackCore::Vatsim::CReaderSettings &defaultValue() { - static const BlackCore::Settings::CSettingsReader reader {{25.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}, {120.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}}; + static const BlackCore::Vatsim::CReaderSettings reader {{25.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}, {120.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}}; return reader; } }; //! Reader settings - struct SettingsVatsimMetars : public BlackMisc::CSettingTrait + struct TVatsimMetars : public BlackMisc::TSettingTrait { - //! \copydoc BlackCore::CSettingTrait::key + //! \copydoc BlackCore::TSettingTrait::key static const char *key() { return "vatsimreaders/metars"; } - //! \copydoc BlackCore::CSettingTrait::defaultValue - static const BlackCore::Settings::CSettingsReader &defaultValue() + //! \copydoc BlackCore::TSettingTrait::defaultValue + static const BlackCore::Vatsim::CReaderSettings &defaultValue() { - static const BlackCore::Settings::CSettingsReader reader {{35.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}, {300.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}}; + static const BlackCore::Vatsim::CReaderSettings reader {{35.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}, {300.0, BlackMisc::PhysicalQuantities::CTimeUnit::s()}}; return reader; } }; } // ns } // ns -Q_DECLARE_METATYPE(BlackCore::Settings::CSettingsReader) -Q_DECLARE_METATYPE(BlackMisc::CCollection) -Q_DECLARE_METATYPE(BlackMisc::CSequence) +Q_DECLARE_METATYPE(BlackCore::Vatsim::CReaderSettings) +Q_DECLARE_METATYPE(BlackMisc::CCollection) +Q_DECLARE_METATYPE(BlackMisc::CSequence) #endif diff --git a/src/blackcore/vatsim/vatsimstatusfilereader.cpp b/src/blackcore/vatsim/vatsimstatusfilereader.cpp index 62c952372..f593de709 100644 --- a/src/blackcore/vatsim/vatsimstatusfilereader.cpp +++ b/src/blackcore/vatsim/vatsimstatusfilereader.cpp @@ -35,7 +35,6 @@ using namespace BlackMisc::Network; using namespace BlackMisc::Simulation; using namespace BlackMisc::PhysicalQuantities; using namespace BlackCore::Data; -using namespace BlackCore::Settings; namespace BlackCore { diff --git a/src/blackgui/components/audiosetupcomponent.h b/src/blackgui/components/audiosetupcomponent.h index 57066cc40..b36e14665 100644 --- a/src/blackgui/components/audiosetupcomponent.h +++ b/src/blackgui/components/audiosetupcomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_AUDIOSETUPCOMPONENT_H #define BLACKGUI_AUDIOSETUPCOMPONENT_H -#include "blackcore/settings/audio.h" +#include "blackcore/audio/audiosettings.h" #include "blackgui/blackguiexport.h" #include "blackmisc/audio/audiodeviceinfolist.h" #include "blackmisc/settingscache.h" @@ -72,7 +72,7 @@ namespace BlackGui void initAudioDeviceLists(); QScopedPointer ui; - BlackMisc::CSetting m_audioSettings { this, &CAudioSetupComponent::ps_reloadSettings }; + BlackMisc::CSetting m_audioSettings { this, &CAudioSetupComponent::ps_reloadSettings }; }; } // namespace diff --git a/src/blackgui/components/dbownmodelsetcomponent.h b/src/blackgui/components/dbownmodelsetcomponent.h index 724b2e24d..defa942d5 100644 --- a/src/blackgui/components/dbownmodelsetcomponent.h +++ b/src/blackgui/components/dbownmodelsetcomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_COMPONENTS_DBOWNMODELSETCOMPONENT_H #define BLACKGUI_COMPONENTS_DBOWNMODELSETCOMPONENT_H -#include "blackcore/settings/distributorpreferences.h" +#include "blackcore/simulator/simulatorsettings.h" #include "blackgui/components/dbmappingcomponentaware.h" #include "blackgui/menus/menudelegate.h" #include "blackmisc/settingscache.h" @@ -141,7 +141,7 @@ namespace BlackGui QScopedPointer ui; QScopedPointer m_modelSetDialog; BlackMisc::Simulation::CAircraftModelSetLoader m_modelSetLoader { this }; - BlackMisc::CSetting m_distributorPreferences { this, &CDbOwnModelSetComponent::ps_distributorPreferencesChanged }; + BlackMisc::CSetting m_distributorPreferences { this, &CDbOwnModelSetComponent::ps_distributorPreferencesChanged }; // -------------------------- custom menus ----------------------------------- diff --git a/src/blackgui/components/distributorpreferencescomponent.h b/src/blackgui/components/distributorpreferencescomponent.h index ae450a8b2..7903ef4ae 100644 --- a/src/blackgui/components/distributorpreferencescomponent.h +++ b/src/blackgui/components/distributorpreferencescomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_COMPONENTS_DISTRIBUTORPREFERENCESCOMPONENT_H #define BLACKGUI_COMPONENTS_DISTRIBUTORPREFERENCESCOMPONENT_H -#include "blackcore/settings/distributorpreferences.h" +#include "blackcore/simulator/simulatorsettings.h" #include "blackmisc/settingscache.h" #include "blackmisc/simulation/aircraftmodelsetloader.h" #include "blackmisc/simulation/distributorlist.h" @@ -72,7 +72,7 @@ namespace BlackGui QScopedPointer ui; BlackGui::COverlayMessagesFrame *m_overlayMessageFrame = nullptr; BlackMisc::Simulation::CAircraftModelSetLoader m_modelSetLoader { this }; - BlackMisc::CSetting m_distributorPreferences { this, &CDistributorPreferencesComponent::ps_preferencesChanged }; + BlackMisc::CSetting m_distributorPreferences { this, &CDistributorPreferencesComponent::ps_preferencesChanged }; //! Update void updateContainerMaybeAsync(const BlackMisc::Simulation::CDistributorList &models, bool sortByOrder = true); diff --git a/src/blackgui/components/logincomponent.h b/src/blackgui/components/logincomponent.h index 47f9f27a2..0fc0c1436 100644 --- a/src/blackgui/components/logincomponent.h +++ b/src/blackgui/components/logincomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_LOGINCOMPONENT_H #define BLACKGUI_LOGINCOMPONENT_H -#include "blackcore/settings/network.h" +#include "blackcore/vatsim/vatsimsettings.h" #include "blackcore/data/vatsimsetup.h" #include "blackgui/blackguiexport.h" #include "blackgui/settings/guisettings.h" @@ -165,7 +165,7 @@ namespace BlackGui bool m_visible = false; //!< is this component selected? const int LogoffIntervalSeconds = 10; QTimer *m_logoffCountdownTimer { nullptr }; - BlackMisc::CSettingReadOnly m_otherTrafficNetworkServers { this, &CLoginComponent::ps_reloadSettings }; + BlackMisc::CSettingReadOnly m_otherTrafficNetworkServers { this, &CLoginComponent::ps_reloadSettings }; BlackMisc::CSetting m_currentAircraftModel { this }; BlackMisc::CData m_currentVatsimServer { this }; }; diff --git a/src/blackgui/components/settingshotkeycomponent.h b/src/blackgui/components/settingshotkeycomponent.h index c3ccbc116..b917cb721 100644 --- a/src/blackgui/components/settingshotkeycomponent.h +++ b/src/blackgui/components/settingshotkeycomponent.h @@ -13,7 +13,7 @@ #define BLACKGUI_COMPONENTS_SETTINGSHOTKEYCOMPONENT_H #include "blackcore/actionbind.h" -#include "blackcore/settings/application.h" +#include "blackcore/application/applicationsettings.h" #include "blackgui/blackguiexport.h" #include "blackgui/models/actionhotkeylistmodel.h" #include "blackmisc/input/actionhotkey.h" @@ -58,7 +58,7 @@ namespace BlackGui QScopedPointer ui; BlackGui::Models::CActionHotkeyListModel m_model; - BlackMisc::CSetting m_actionHotkeys { this }; + BlackMisc::CSetting m_actionHotkeys { this }; BlackCore::CActionBind m_action { "/Test/Message", this, &CSettingsHotkeyComponent::ps_hotkeySlot }; void ps_hotkeySlot(bool keyDown); diff --git a/src/blackgui/components/settingsnetworkcomponent.h b/src/blackgui/components/settingsnetworkcomponent.h index 5b5bedb4c..22f096c04 100644 --- a/src/blackgui/components/settingsnetworkcomponent.h +++ b/src/blackgui/components/settingsnetworkcomponent.h @@ -13,7 +13,7 @@ #define BLACKGUI_COMPONENTS_SETTINGSNETWORKCOMPONENT_H #include "blackgui/blackguiexport.h" -#include "blackcore/settings/network.h" +#include "blackcore/vatsim/vatsimsettings.h" #include #include diff --git a/src/blackgui/components/settingsnetworkserverscomponent.h b/src/blackgui/components/settingsnetworkserverscomponent.h index 13ffc2791..f1446a916 100644 --- a/src/blackgui/components/settingsnetworkserverscomponent.h +++ b/src/blackgui/components/settingsnetworkserverscomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_COMPONENTS_SETTINGSNETWORKSERVERSCOMPONENT_H #define BLACKGUI_COMPONENTS_SETTINGSNETWORKSERVERSCOMPONENT_H -#include "blackcore/settings/network.h" +#include "blackcore/vatsim/vatsimsettings.h" #include "blackgui/blackguiexport.h" #include "blackmisc/settingscache.h" @@ -54,7 +54,7 @@ namespace BlackGui private: QScopedPointer ui; - BlackMisc::CSetting m_trafficNetworkServers { this, &CSettingsNetworkServersComponent::ps_reloadSettings }; + BlackMisc::CSetting m_trafficNetworkServers { this, &CSettingsNetworkServersComponent::ps_reloadSettings }; }; } // ns } // ns diff --git a/src/blackgui/components/settingssimulatorcomponent.h b/src/blackgui/components/settingssimulatorcomponent.h index fa1270a81..ae50b8e32 100644 --- a/src/blackgui/components/settingssimulatorcomponent.h +++ b/src/blackgui/components/settingssimulatorcomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_SETTINGSSIMULATORCOMPONENT_H #define BLACKGUI_SETTINGSSIMULATORCOMPONENT_H -#include "blackcore/settings/application.h" +#include "blackcore/application/applicationsettings.h" #include "blackgui/blackguiexport.h" #include "blackmisc/settingscache.h" #include "blackmisc/simulation/simulatorplugininfolist.h" @@ -86,7 +86,7 @@ namespace BlackGui QScopedPointer ui; //!< UI bool m_pluginLoaded = false; //!< plugin loaded BlackCore::CPluginManagerSimulator* m_plugins = nullptr; - BlackMisc::CSetting m_enabledSimulators { this, &CSettingsSimulatorComponent::ps_reloadPluginConfig }; + BlackMisc::CSetting m_enabledSimulators { this, &CSettingsSimulatorComponent::ps_reloadPluginConfig }; }; } diff --git a/src/blackgui/components/settingsvatsimreaderscomponent.cpp b/src/blackgui/components/settingsvatsimreaderscomponent.cpp index fb049ec2b..941824f23 100644 --- a/src/blackgui/components/settingsvatsimreaderscomponent.cpp +++ b/src/blackgui/components/settingsvatsimreaderscomponent.cpp @@ -13,7 +13,7 @@ using namespace BlackMisc; using namespace BlackMisc::PhysicalQuantities; using namespace BlackCore; -using namespace BlackCore::Settings; +using namespace BlackCore::Vatsim; namespace BlackGui { @@ -46,17 +46,17 @@ namespace BlackGui const int newMetarSec = ui->sb_Metar->value(); if (newMetarSec != metarSec) { - this->m_settingsMetars.setAndSaveProperty(CSettingsReader::IndexPeriodicTime, CVariant::fromValue(CTime{static_cast(newMetarSec), CTimeUnit::s()})); + this->m_settingsMetars.setAndSaveProperty(CReaderSettings::IndexPeriodicTime, CVariant::fromValue(CTime{static_cast(newMetarSec), CTimeUnit::s()})); } const int newBookingsSec = ui->sb_Bookings->value(); if (newBookingsSec != bookingsSec) { - this->m_settingsBookings.setAndSaveProperty(CSettingsReader::IndexPeriodicTime, CVariant::fromValue(CTime{static_cast(newBookingsSec), CTimeUnit::s()})); + this->m_settingsBookings.setAndSaveProperty(CReaderSettings::IndexPeriodicTime, CVariant::fromValue(CTime{static_cast(newBookingsSec), CTimeUnit::s()})); } const int newDataFileSec = ui->sb_DataFile->value(); if (newDataFileSec != dataFileSec) { - this->m_settingsBookings.setAndSaveProperty(CSettingsReader::IndexPeriodicTime, CVariant::fromValue(CTime{static_cast(newDataFileSec), CTimeUnit::s()})); + this->m_settingsBookings.setAndSaveProperty(CReaderSettings::IndexPeriodicTime, CVariant::fromValue(CTime{static_cast(newDataFileSec), CTimeUnit::s()})); } } diff --git a/src/blackgui/components/settingsvatsimreaderscomponent.h b/src/blackgui/components/settingsvatsimreaderscomponent.h index cd40ce7d4..2ea7706e9 100644 --- a/src/blackgui/components/settingsvatsimreaderscomponent.h +++ b/src/blackgui/components/settingsvatsimreaderscomponent.h @@ -12,7 +12,7 @@ #ifndef BLACKGUI_COMPONENTS_SETTINGSVATSIMREADERSCOMPONENT_H #define BLACKGUI_COMPONENTS_SETTINGSVATSIMREADERSCOMPONENT_H -#include "blackcore/settings/reader.h" +#include "blackcore/vatsim/vatsimsettings.h" #include #include @@ -45,9 +45,9 @@ namespace BlackGui void initValues(); QScopedPointer ui; - BlackMisc::CSetting m_settingsBookings { this, &CSettingsVatsimReadersComponent::ps_settingsChanged }; - BlackMisc::CSetting m_settingsDataFile { this, &CSettingsVatsimReadersComponent::ps_settingsChanged }; - BlackMisc::CSetting m_settingsMetars { this, &CSettingsVatsimReadersComponent::ps_settingsChanged }; + BlackMisc::CSetting m_settingsBookings { this, &CSettingsVatsimReadersComponent::ps_settingsChanged }; + BlackMisc::CSetting m_settingsDataFile { this, &CSettingsVatsimReadersComponent::ps_settingsChanged }; + BlackMisc::CSetting m_settingsMetars { this, &CSettingsVatsimReadersComponent::ps_settingsChanged }; }; } // ns } // ns diff --git a/src/blackgui/components/weathercomponent.h b/src/blackgui/components/weathercomponent.h index e1dd939eb..422e92b72 100644 --- a/src/blackgui/components/weathercomponent.h +++ b/src/blackgui/components/weathercomponent.h @@ -15,7 +15,7 @@ #include "blackgui/blackguiexport.h" #include "blackgui/components/enablefordockwidgetinfoarea.h" #include "blackgui/components/updatetimer.h" -#include "blackcore/settings/simulator.h" +#include "blackcore/simulator/simulatorsettings.h" #include "blackmisc/geo/coordinategeodetic.h" #include "blackmisc/identifiable.h" #include "blackmisc/weather/weatherscenario.h" @@ -77,7 +77,7 @@ namespace BlackGui QVector m_weatherScenarios; QTimer m_weatherUpdateTimer { this }; BlackMisc::Geo::CCoordinateGeodetic m_lastOwnAircraftPosition; - BlackMisc::CSetting m_weatherScenarioSetting { this }; + BlackMisc::CSetting m_weatherScenarioSetting { this }; }; } // namespace } // namespace diff --git a/src/blackgui/editors/ownmodelsetform.h b/src/blackgui/editors/ownmodelsetform.h index 14a7a7a83..9a9988ecd 100644 --- a/src/blackgui/editors/ownmodelsetform.h +++ b/src/blackgui/editors/ownmodelsetform.h @@ -13,7 +13,7 @@ #define BLACKGUI_EDITORS_OWNMODELSETFORM_H #include "form.h" -#include "blackcore/settings/distributorpreferences.h" +#include "blackcore/simulator/simulatorsettings.h" #include "blackmisc/simulation/distributorlist.h" #include @@ -84,7 +84,7 @@ namespace BlackGui private: QScopedPointer ui; BlackMisc::Simulation::CSimulatorInfo m_simulator; - BlackMisc::CSetting m_distributorPreferences { this, &COwnModelSetForm::ps_preferencesChanged }; + BlackMisc::CSetting m_distributorPreferences { this, &COwnModelSetForm::ps_preferencesChanged }; }; } // ns } // ns diff --git a/src/plugins/simulator/fs9/simulatorfs9.h b/src/plugins/simulator/fs9/simulatorfs9.h index a1ab8556a..669e05451 100644 --- a/src/plugins/simulator/fs9/simulatorfs9.h +++ b/src/plugins/simulator/fs9/simulatorfs9.h @@ -16,7 +16,7 @@ #include "fs9client.h" #include "lobbyclient.h" #include "../fscommon/simulatorfscommon.h" -#include "blackcore/settings/simulator.h" +#include "blackcore/simulator/simulatorsettings.h" #include "blackcore/simulator.h" #include "blackmisc/interpolator.h" #include "blackmisc/simulation/simulatedaircraft.h" @@ -120,7 +120,7 @@ namespace BlackSimPlugin QSharedPointer m_lobbyClient; BlackMisc::Geo::CCoordinateGeodetic m_lastWeatherPosition; //!< Own aircraft position at which weather was fetched and injected last - BlackMisc::CSetting m_weatherScenarioSettings { this, &CSimulatorFs9::ps_reloadSettings }; + BlackMisc::CSetting m_weatherScenarioSettings { this, &CSimulatorFs9::ps_reloadSettings }; }; //! Listener for FS9 diff --git a/src/plugins/simulator/fsx/simulatorfsx.h b/src/plugins/simulator/fsx/simulatorfsx.h index 6dd64df22..b6a310f09 100644 --- a/src/plugins/simulator/fsx/simulatorfsx.h +++ b/src/plugins/simulator/fsx/simulatorfsx.h @@ -15,7 +15,7 @@ #include "simconnectdatadefinition.h" #include "simconnectobject.h" #include "../fscommon/simulatorfscommon.h" -#include "blackcore/settings/simulator.h" +#include "blackcore/simulator/simulatorsettings.h" #include "blackcore/simulator.h" #include "blackmisc/interpolatorlinear.h" #include "blackmisc/simulation/simulatorplugininfo.h" @@ -206,7 +206,7 @@ namespace BlackSimPlugin int m_statsUpdateAircraftCount = 0; BlackMisc::Geo::CCoordinateGeodetic m_lastWeatherPosition; //!< Own aircraft position at which weather was fetched and injected last - BlackMisc::CSetting m_weatherScenarioSettings { this, &CSimulatorFsx::ps_reloadSettings }; + BlackMisc::CSetting m_weatherScenarioSettings { this, &CSimulatorFsx::ps_reloadSettings }; }; //! Listener for FSX diff --git a/src/plugins/simulator/xplane/simulatorxplane.h b/src/plugins/simulator/xplane/simulatorxplane.h index 0ecf979f4..95bbf6556 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.h +++ b/src/plugins/simulator/xplane/simulatorxplane.h @@ -14,7 +14,7 @@ #include "blackcore/simulator.h" #include "blackcore/simulatorcommon.h" -#include "blackcore/settings/simulator.h" +#include "blackcore/simulator/simulatorsettings.h" #include "blackmisc/aviation/airportlist.h" #include "blackmisc/aviation/callsignset.h" #include "blackmisc/geo/coordinategeodetic.h" @@ -152,7 +152,7 @@ namespace BlackSimPlugin BlackMisc::Simulation::CAircraftModelList m_installedModels; //!< \todo Do we still need this, as we now focus on model set BlackMisc::Geo::CCoordinateGeodetic m_lastWeatherPosition; //!< Own aircraft position at which weather was fetched and injected last - BlackMisc::CSetting m_weatherScenarioSettings { this, &CSimulatorXPlane::ps_reloadSettings }; + BlackMisc::CSetting m_weatherScenarioSettings { this, &CSimulatorXPlane::ps_reloadSettings }; //! \todo Add units to members? pitchDeg?, altitudeFt? struct // data is written by DBus async method callbacks diff --git a/src/swiftlauncher/swiftlauncher.h b/src/swiftlauncher/swiftlauncher.h index 5384cb78c..d9a2ab13d 100644 --- a/src/swiftlauncher/swiftlauncher.h +++ b/src/swiftlauncher/swiftlauncher.h @@ -18,7 +18,7 @@ #include "blackcore/data/globalsetup.h" #include "blackcore/data/updateinfo.h" #include "blackcore/coremodeenums.h" -#include "blackcore/settings/network.h" +#include "blackcore/application/applicationsettings.h" #include #include #include @@ -78,7 +78,7 @@ private slots: private: QScopedPointer ui; BlackMisc::CData m_updateInfo { this, &CSwiftLauncher::ps_changedUpdateInfoCache }; //!< version cache - BlackMisc::CSetting m_dbusServerAddress { this }; //!< DBus address + BlackMisc::CSetting m_dbusServerAddress { this }; //!< DBus address QString m_executable; QStringList m_executableArgs;