mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 17:20:04 +00:00
Inheriting GeneralSettings from SettingsCategory, making generic read/write JSON functions
This commit is contained in:
parent
78739cd627
commit
c93e776137
7 changed files with 184 additions and 96 deletions
|
|
@ -1,10 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <scwx/qt/settings/settings_category.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <boost/json.hpp>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
|
|
@ -14,7 +14,7 @@ namespace settings
|
|||
|
||||
class GeneralSettingsImpl;
|
||||
|
||||
class GeneralSettings
|
||||
class GeneralSettings : public SettingsCategory
|
||||
{
|
||||
public:
|
||||
explicit GeneralSettings();
|
||||
|
|
@ -29,16 +29,10 @@ public:
|
|||
bool debug_enabled() const;
|
||||
std::string default_radar_site() const;
|
||||
std::vector<int64_t> font_sizes() const;
|
||||
int64_t grid_height() const;
|
||||
int64_t grid_width() const;
|
||||
std::int64_t grid_height() const;
|
||||
std::int64_t grid_width() const;
|
||||
std::string mapbox_api_key() const;
|
||||
|
||||
boost::json::value ToJson() const;
|
||||
|
||||
static std::shared_ptr<GeneralSettings> Create();
|
||||
static std::shared_ptr<GeneralSettings> Load(const boost::json::value* json,
|
||||
bool& jsonDirty);
|
||||
|
||||
friend bool operator==(const GeneralSettings& lhs,
|
||||
const GeneralSettings& rhs);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue