diff options
| author | FintasticMan <finlay.neon.kid@gmail.com> | 2023-07-15 02:23:10 +0200 |
|---|---|---|
| committer | JF <JF002@users.noreply.github.com> | 2023-12-23 21:42:16 +0100 |
| commit | d889f3e4446107ce5bdd45c6791281e37cadf5b0 (patch) | |
| tree | a0b7d59842dd0a1a97b524bc093bfe69948bd521 /src/components/settings | |
| parent | c04813b6d303f4b341e5c7df885809913e83060a (diff) | |
settings: Add settings item for weather format
Diffstat (limited to 'src/components/settings')
| -rw-r--r-- | src/components/settings/Settings.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h index 89c2ba97..06312077 100644 --- a/src/components/settings/Settings.h +++ b/src/components/settings/Settings.h @@ -10,6 +10,7 @@ namespace Pinetime { class Settings { public: enum class ClockType : uint8_t { H24, H12 }; + enum class WeatherFormat : uint8_t { Metric, Imperial }; enum class Notification : uint8_t { On, Off, Sleep }; enum class ChimesOption : uint8_t { None, Hours, HalfHours }; enum class WakeUpMode : uint8_t { SingleTap = 0, DoubleTap = 1, RaiseWrist = 2, Shake = 3, LowerWrist = 4 }; @@ -180,6 +181,17 @@ namespace Pinetime { return settings.clockType; }; + void SetWeatherFormat(WeatherFormat weatherFormat) { + if (weatherFormat != settings.weatherFormat) { + settingsChanged = true; + } + settings.weatherFormat = weatherFormat; + }; + + WeatherFormat GetWeatherFormat() const { + return settings.weatherFormat; + }; + void SetNotificationStatus(Notification status) { if (status != settings.notificationStatus) { settingsChanged = true; @@ -274,7 +286,7 @@ namespace Pinetime { private: Pinetime::Controllers::FS& fs; - static constexpr uint32_t settingsVersion = 0x0006; + static constexpr uint32_t settingsVersion = 0x0007; struct SettingsData { uint32_t version = settingsVersion; @@ -282,6 +294,7 @@ namespace Pinetime { uint32_t screenTimeOut = 15000; ClockType clockType = ClockType::H24; + WeatherFormat weatherFormat = WeatherFormat::Metric; Notification notificationStatus = Notification::On; Pinetime::Applications::WatchFace watchFace = Pinetime::Applications::WatchFace::Digital; |
