summaryrefslogtreecommitdiff
path: root/src/components/settings
diff options
context:
space:
mode:
authorJames A. Jerkins <evergreen@jamesjerkinscomputer.com>2021-12-24 02:30:14 (GMT)
committerJames A. Jerkins <evergreen@jamesjerkinscomputer.com>2021-12-24 02:30:14 (GMT)
commit319030d9e16e833cf8bff569a9ecfa452165ea27 (patch)
treeae2890204710ac41fd7f637ac1c367c09f671009 /src/components/settings
parent3b0b48020d96353fc6cd114aa80fc2fec98363a3 (diff)
Add airplane mode feature
Implements 'Airplane mode' feature to disable and enable bluetooth/ble Adds airplaneMode as a non-persisted setting Adds a setting menu for switching airplane mode on and off Displays an airplane symbol on the Digital watch face and the PineTimeStyle watch face when airplane mode is enabled Always enables bluetooth/ble on boot (disable airplane mode) Alphabetizes the settings menu options Style cleanups Closes #632
Diffstat (limited to 'src/components/settings')
-rw-r--r--src/components/settings/Settings.h39
1 files changed, 35 insertions, 4 deletions
diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h
index 2d7973d..a1529fe 100644
--- a/src/components/settings/Settings.h
+++ b/src/components/settings/Settings.h
@@ -17,7 +17,23 @@ namespace Pinetime {
RaiseWrist = 2,
};
enum class Colors : uint8_t {
- White, Silver, Gray, Black, Red, Maroon, Yellow, Olive, Lime, Green, Cyan, Teal, Blue, Navy, Magenta, Purple, Orange
+ White,
+ Silver,
+ Gray,
+ Black,
+ Red,
+ Maroon,
+ Yellow,
+ Olive,
+ Lime,
+ Green,
+ Cyan,
+ Teal,
+ Blue,
+ Navy,
+ Magenta,
+ Purple,
+ Orange
};
struct PineTimeStyle {
Colors ColorTime = Colors::Teal;
@@ -146,18 +162,29 @@ namespace Pinetime {
}
settings.brightLevel = level;
};
+
Controllers::BrightnessController::Levels GetBrightness() const {
return settings.brightLevel;
};
- void SetStepsGoal( uint32_t goal ) {
- if ( goal != settings.stepsGoal ) {
+ void SetStepsGoal(uint32_t goal) {
+ if (goal != settings.stepsGoal) {
settingsChanged = true;
}
settings.stepsGoal = goal;
};
- uint32_t GetStepsGoal() const { return settings.stepsGoal; };
+ uint32_t GetStepsGoal() const {
+ return settings.stepsGoal;
+ };
+
+ void SetAirplaneMode(bool mode) {
+ airplaneMode = mode;
+ };
+
+ bool GetAirplaneMode() const {
+ return airplaneMode;
+ };
private:
Pinetime::Controllers::FS& fs;
@@ -185,6 +212,10 @@ namespace Pinetime {
uint8_t appMenu = 0;
uint8_t settingsMenu = 0;
+ /* airplaneMode is intentionally not saved with the other watch settings and initialized
+ * to off (false) on every boot because we always want ble to be enabled on startup
+ */
+ bool airplaneMode = false;
void LoadSettingsFromFile();
void SaveSettingsToFile();