mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-01 08:10:04 +00:00
Refactor settings to be managed by singletons
This commit is contained in:
parent
acc782b2bc
commit
b66ca2cb09
21 changed files with 138 additions and 133 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#include <scwx/qt/map/alert_layer.hpp>
|
||||
#include <scwx/qt/manager/settings_manager.hpp>
|
||||
#include <scwx/qt/manager/text_event_manager.hpp>
|
||||
#include <scwx/qt/settings/palette_settings.hpp>
|
||||
#include <scwx/qt/util/color.hpp>
|
||||
#include <scwx/util/logger.hpp>
|
||||
#include <scwx/util/threads.hpp>
|
||||
|
|
@ -394,7 +394,7 @@ static void AddAlertLayer(std::shared_ptr<QMapLibreGL::Map> map,
|
|||
const QString& beforeLayer)
|
||||
{
|
||||
settings::PaletteSettings& paletteSettings =
|
||||
manager::SettingsManager::palette_settings();
|
||||
settings::PaletteSettings::Instance();
|
||||
|
||||
QString sourceId = GetSourceId(phenomenon, alertActive);
|
||||
QString idSuffix = GetSuffix(phenomenon, alertActive);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#include <scwx/qt/map/map_provider.hpp>
|
||||
#include <scwx/qt/manager/settings_manager.hpp>
|
||||
#include <scwx/qt/settings/general_settings.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
|
|
@ -128,12 +128,10 @@ std::string GetMapProviderApiKey(MapProvider mapProvider)
|
|||
switch (mapProvider)
|
||||
{
|
||||
case MapProvider::Mapbox:
|
||||
return manager::SettingsManager::general_settings()
|
||||
.mapbox_api_key()
|
||||
.GetValue();
|
||||
return settings::GeneralSettings::Instance().mapbox_api_key().GetValue();
|
||||
|
||||
case MapProvider::MapTiler:
|
||||
return manager::SettingsManager::general_settings()
|
||||
return settings::GeneralSettings::Instance()
|
||||
.maptiler_api_key()
|
||||
.GetValue();
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include <scwx/qt/manager/font_manager.hpp>
|
||||
#include <scwx/qt/manager/placefile_manager.hpp>
|
||||
#include <scwx/qt/manager/radar_product_manager.hpp>
|
||||
#include <scwx/qt/manager/settings_manager.hpp>
|
||||
#include <scwx/qt/map/alert_layer.hpp>
|
||||
#include <scwx/qt/map/color_table_layer.hpp>
|
||||
#include <scwx/qt/map/layer_wrapper.hpp>
|
||||
|
|
@ -13,6 +12,8 @@
|
|||
#include <scwx/qt/map/radar_product_layer.hpp>
|
||||
#include <scwx/qt/map/radar_range_layer.hpp>
|
||||
#include <scwx/qt/model/imgui_context_model.hpp>
|
||||
#include <scwx/qt/settings/general_settings.hpp>
|
||||
#include <scwx/qt/settings/palette_settings.hpp>
|
||||
#include <scwx/qt/util/file.hpp>
|
||||
#include <scwx/qt/util/maplibre.hpp>
|
||||
#include <scwx/qt/util/tooltip.hpp>
|
||||
|
|
@ -81,8 +82,7 @@ public:
|
|||
prevBearing_ {0.0},
|
||||
prevPitch_ {0.0}
|
||||
{
|
||||
auto& generalSettings =
|
||||
scwx::qt::manager::SettingsManager::general_settings();
|
||||
auto& generalSettings = settings::GeneralSettings::Instance();
|
||||
|
||||
SetRadarSite(generalSettings.default_radar_site().GetValue());
|
||||
|
||||
|
|
@ -1227,7 +1227,7 @@ void MapWidgetImpl::InitializeNewRadarProductView(
|
|||
auto radarProductView = context_->radar_product_view();
|
||||
|
||||
std::string colorTableFile =
|
||||
manager::SettingsManager::palette_settings()
|
||||
settings::PaletteSettings::Instance()
|
||||
.palette(colorPalette)
|
||||
.GetValue();
|
||||
if (!colorTableFile.empty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue